Compiling a port statically
Richard L. Hamilton
rlhamil at smart.net
Sun Dec 6 21:52:32 UTC 2020
I'm going to play devil's advocate on this and another post (with competing positions, so don't feel bad).
MacPorts knows the library dependencies of a port. While it does not now (AFAIK) record the specific versions of each used to build an installed port, in principle, it could; at which point it could (also in principle) determine whether any of them had changed, thus requiring a rebuild of the port that depended on them, even if its version hadn't changed.
That's NOT a feature request, or probably even a practical idea. But IMO, it does indicate that there are solutions such that the library ports would NOT have to be aware of what used them.
> On Dec 6, 2020, at 15:46, Ryan Schmidt <ryandesign at macports.org> wrote:
> 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