[MacPorts] #55469: snowleopard_fixes portgroup behavior changed, causing some ports to fail to build

MacPorts noreply at macports.org
Tue Dec 5 04:40:52 UTC 2017


#55469: snowleopard_fixes portgroup behavior changed, causing some ports to fail to
build
------------------------+-------------------
 Reporter:  ryandesign  |      Owner:  kencu
     Type:  defect      |     Status:  new
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:
 Keywords:              |       Port:
------------------------+-------------------
 The snowleopard_fixes portgroup's behavior changed in
 [40ae4799e2e766c658b20d09d23830cdab5adfcc/macports-ports] in which the use
 of `port::register_callback` was introduced. The reason given for the
 change was so that ports that use the portgroup are not forced to use
 `depends_lib-append` instead of `depends_lib`.

 This effectively makes the code of the portgroup execute at the end of the
 portfile's code, rather than at the point where the portgroup is included,
 which is usually at the beginning. This is not how other portgroups work,
 and is therefore confusing.

 This change causes some ports to fail to build, namely those that need
 access to the changes the portgroup is making. For example, the moreutils
 port does not have a configure phase, so it gets the value of
 `${configure.ldflags}` to set flags for the build phase.

 Now that the portgroup no longer changes `configure.ldflags` until after
 the portfile has been executed, the portfile doesn't have access to the
 changed variable, so [attachment:moreutils-port::register_callback-
 main.log the build fails] because `-lsnowleopardfixes` isn't in the
 ldflags. It [attachment:moreutils-main.log succeeded before the change].

 The moreutils port could adapt to this changed behavior by enclosing the
 `build.args-append` command inside a `pre-build {...}` block. But if the
 point of making the portgroup use `port::register_callback` was to avoid
 having to change portfiles, then it fails at that goal.

 I suggest the use of `port::register_callback` be reverted. The fact that
 its name contains `:` characters also indicates it was not intended to be
 called from portfiles or portgroups.

 Ports that want the portgroup's code to be executed at the end of the
 portfile can include the portgroup at the end of the portfile.

--
Ticket URL: <https://trac.macports.org/ticket/55469>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list