To decipher the changes made:
1) We need to add +universal to the MacPorts install of icu libs or we only get libs matching the architecture of the build machine (i.e., x64 or arm64). That would leave one architecture always broken, and it would vary which is broken depending on whether an arm64 or x64 machine was used for building. Universal libraries are basically containers that contain 2 libraries, one for x64 and one for arm64. Our build process doesn't provide a simple way to build separately for different architectures, so including universal libraries is a simple fix even though it makes the download larger since you'll always include code that isn't for your architecture. Because I'm not sure if every build of ICU on MacPorts will include universal libs, I locked in the version number to one that does.
2) We need to fix up the loader paths embedded inside each dylib so it doesn't look for its dependent dylibs only in the path where they were on the machine used to build the ICU dylib files originally that we download from MacPorts. As it stands now, when you load one of the ICU dylibs, it always looks for its dependencies under /opt/local/lib. Unless the machine running Platform.Bible has ICU installed from MacPorts (which puts them under /opt/local/lib), then loading ICU dylibs will not work in P.B. Apple provides a tool (install_name_tool) that can rewrite locations inside of a library where to look for each dependency.
3) I updated the .NET copying of ICU libs to exclude two that are only meant for testing. They aren't needed in production, and we don't need them for our own testing, either. icu.net might use them, but P.B does not.
4) I updated the version of icu.net to one that includes trace logging if loading ICU libraries fails. I updated the .NET program to log that extra trace information to the console when running on macOS. I didn't add it for other OSes for now. We can always adjust that later easily.
To decipher the changes made: 1) We need to add
+universal
to the MacPorts install of icu libs or we only get libs matching the architecture of the build machine (i.e., x64 or arm64). That would leave one architecture always broken, and it would vary which is broken depending on whether an arm64 or x64 machine was used for building. Universal libraries are basically containers that contain 2 libraries, one for x64 and one for arm64. Our build process doesn't provide a simple way to build separately for different architectures, so including universal libraries is a simple fix even though it makes the download larger since you'll always include code that isn't for your architecture. Because I'm not sure if every build of ICU on MacPorts will include universal libs, I locked in the version number to one that does. 2) We need to fix up the loader paths embedded inside eachdylib
so it doesn't look for its dependentdylibs
only in the path where they were on the machine used to build the ICUdylib
files originally that we download from MacPorts. As it stands now, when you load one of the ICUdylib
s, it always looks for its dependencies under/opt/local/lib
. Unless the machine running Platform.Bible has ICU installed from MacPorts (which puts them under/opt/local/lib
), then loading ICUdylib
s will not work in P.B. Apple provides a tool (install_name_tool
) that can rewrite locations inside of a library where to look for each dependency. 3) I updated the .NET copying of ICU libs to exclude two that are only meant for testing. They aren't needed in production, and we don't need them for our own testing, either.icu.net
might use them, but P.B does not. 4) I updated the version oficu.net
to one that includes trace logging if loading ICU libraries fails. I updated the .NET program to log that extra trace information to the console when running on macOS. I didn't add it for other OSes for now. We can always adjust that later easily.This change is