Opened 7 years ago

Last modified 6 years ago

#55469 closed defect

snowleopard_fixes portgroup behavior changed, causing some ports to fail to build — at Initial Version

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port:

Description

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 the build fails because -lsnowleopardfixes isn't in the ldflags. It 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.

Change History (2)

Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: moreutils-main.log added

Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Note: See TracTickets for help on using tickets.