Compiling a port statically
ryandesign at macports.org
Sun Dec 6 20:46:49 UTC 2020
On Dec 6, 2020, at 09:31, Riccardo Mottola wrote:
> I can think of two scenarios:
> - building "always safe" binaries which can be used at system level, e.g. login shells, tools, things put in launchd. That is things you want to always work, even if you are during a MacPorts upgrade. NetBSD offers two packages for the same thing, e.g. bash and bash-static, IIRC. perhaps in MacPorts it could be a "variant"?
No, we should not offer a variant of any port to do a static build. Static build means all of the libraries that a program depends on are copied into the program executable. That means if we later update one of those libraries to a newer version, the statically-built program will not benefit from those fixes, unless its revision is increased to rebuild it, but whoever updated the library would not know that that needs to be done. We should not introduce more situations into MacPorts where developers updating library ports need to know about increasing the revisions of ports that use the library. Instead we should do the opposite, identifying those ports that only build a static library and fixing them so that they also or instead build a dynamic library so that ports that link with them can benefit from new versions without needing to be rebuilt.
More information about the macports-users