[MacPorts] #52739: perl5 @5.22.2: build_arch and universal not fully respected
#52739: perl5 @5.22.2: build_arch and universal not fully respected ---------------------------------+--------------------- Reporter: MarcusCalhoun-Lopez | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: haspatch | Port: perl5 ---------------------------------+--------------------- The .bundle files are not built with arch flags, so they do not respect build_arch and are not built universal.[[BR]] Attached are several proposed solutions. * Portfile1.diff adds {{{-Alddlflags="$LDFLAGS"}}} to configure.post_args. It adds the arch flags, but it also adds {{{-L/opt/local/lib -Wl,-headerpad_max_install_names}}}, which might not be desirable. * Portfile2.diff and Portfile2.diff just add {{{"-Alddlflags=\"[get_canonical_archflags ld]\""}}} to configure.post_args. Extra code, however, is required to make {{{get_canonical_archflags}}} work correctly. {{{get_canonical_archflags}}} determines if universal flags are required using the following code: {{{ if {![variant_exists universal] || ![variant_isset universal]} { }}} When configure.post_args-append is run, however, the universal variant has not yet been created. I assume this is to give the Portfile a chance to create its own. -- Ticket URL: <https://trac.macports.org/ticket/52739> MacPorts <https://www.macports.org/> Ports system for OS X
#52739: perl5 @5.22.2: build_arch and universal not fully respected ----------------------------------+---------------------- Reporter: MarcusCalhoun-Lopez | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: haspatch Port: perl5 | ----------------------------------+---------------------- Changes (by MarcusCalhoun-Lopez): * Attachment "Portfile1.diff" added. -- Ticket URL: <https://trac.macports.org/ticket/52739> MacPorts <https://www.macports.org/> Ports system for OS X
#52739: perl5 @5.22.2: build_arch and universal not fully respected ----------------------------------+---------------------- Reporter: MarcusCalhoun-Lopez | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: haspatch Port: perl5 | ----------------------------------+---------------------- Changes (by MarcusCalhoun-Lopez): * Attachment "Portfile2.diff" added. -- Ticket URL: <https://trac.macports.org/ticket/52739> MacPorts <https://www.macports.org/> Ports system for OS X
#52739: perl5 @5.22.2: build_arch and universal not fully respected ----------------------------------+---------------------- Reporter: MarcusCalhoun-Lopez | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: haspatch Port: perl5 | ----------------------------------+---------------------- Changes (by MarcusCalhoun-Lopez): * Attachment "Portfile3.diff" added. -- Ticket URL: <https://trac.macports.org/ticket/52739> MacPorts <https://www.macports.org/> Ports system for OS X
#52739: perl5 @5.22.2: build_arch and universal not fully respected ----------------------------------+---------------------- Reporter: MarcusCalhoun-Lopez | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: haspatch Port: perl5 | ----------------------------------+---------------------- Comment (by ryandesign): Option 1 looks good to me. Using `-headerpad_max_install_names` is always good. Using `-L/opt/local/lib` can very occasionally be problematic; I don't know if it is problematic for perl. -- Ticket URL: <https://trac.macports.org/ticket/52739#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#52739: perl5 @5.22.2: build_arch and universal not fully respected ----------------------------------+---------------------- Reporter: MarcusCalhoun-Lopez | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: perl5 | ----------------------------------+---------------------- Changes (by mojca): * cc: larryv, dbevans (added) * version: 2.3.4 => Comment: Thansk a lot for explanation. So basically you don't care which of the three patches is used if I understand correctly?
`Portfile2.diff` and `Portfile3.diff` just add `"-Alddlflags=\"[get_canonical_archflags ld]\""` to `configure.post_args`. Extra code, however, is required to make `get_canonical_archflags` work correctly. `get_canonical_archflags` determines if universal flags are required using the following code: {{{ if {![variant_exists universal] || ![variant_isset universal]} { }}} When `configure.post_args-append` is run, however, the universal variant has not yet been created. I assume this is to give the `Portfile` a chance to create its own.
I would imagine that a more logical solution than to create a variant manually or to put the code inside the `pre-configure {}` block would be to use {{{ if {[variant_isset universal]} { configure.post_args-append "-Alddlflags=\"[get_canonical_archflags ld]\"" } }}} Does that work properly? Just curious, what's the difference (if any) between `configure`'s `post- args` and `args`? Why not appending it simply to `args`? Regarding the `MACOSX_DEPLOYMENT_TARGET`:
The perl port already handles it in a much better way with: {{{ -Dld="env MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET $CC” }}} Sorry for not seeing this earlier.
Well, no, I just removed it in r154367 because I thought it was handled properly by the new patches. I wouldn't mind filing another "bug report" with a patch upstream though that would fix this for older OSes in case it's broken there. What's the easiest way to test? A few bonus questions: * I would be grateful for a hint how to test building `.bundle` files. * Do any of those patches address #52290? * Unrelated: We've been asked to test whether perl built specifically on 10.12 with `MACOSX_DEPLOYMENT_TARGET` set to support an earlier OS actually works on that older OS. If anyone is eager to test that, I would be grateful. -- Ticket URL: <https://trac.macports.org/ticket/52739#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#52739: perl5 @5.22.2: build_arch and universal not fully respected ----------------------------------+---------------------- Reporter: MarcusCalhoun-Lopez | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: perl5 | ----------------------------------+---------------------- Description changed by mojca: Old description:
The .bundle files are not built with arch flags, so they do not respect build_arch and are not built universal.[[BR]] Attached are several proposed solutions.
* Portfile1.diff adds {{{-Alddlflags="$LDFLAGS"}}} to configure.post_args. It adds the arch flags, but it also adds {{{-L/opt/local/lib -Wl,-headerpad_max_install_names}}}, which might not be desirable.
* Portfile2.diff and Portfile2.diff just add {{{"-Alddlflags=\"[get_canonical_archflags ld]\""}}} to configure.post_args. Extra code, however, is required to make {{{get_canonical_archflags}}} work correctly. {{{get_canonical_archflags}}} determines if universal flags are required using the following code: {{{ if {![variant_exists universal] || ![variant_isset universal]} { }}} When configure.post_args-append is run, however, the universal variant has not yet been created. I assume this is to give the Portfile a chance to create its own.
New description: The `.bundle` files are not built with arch flags, so they do not respect `build_arch` and are not built universal.[[BR]] Attached are several proposed solutions. * [attachment:"Portfile1.diff" Portfile1.diff] adds `-Alddlflags="$LDFLAGS"` to `configure.post_args`. It adds the arch flags, but it also adds `-L/opt/local/lib -Wl,-headerpad_max_install_names`, which might not be desirable. * [attachment:"Portfile2.diff" Portfile2.diff] and [attachment:"Portfile3.diff" Portfile3.diff] just add `"-Alddlflags=\"[get_canonical_archflags ld]\""` to `configure.post_args`. Extra code, however, is required to make `get_canonical_archflags` work correctly. `get_canonical_archflags` determines if universal flags are required using the following code: {{{ if {![variant_exists universal] || ![variant_isset universal]} { }}} When `configure.post_args-append` is run, however, the universal variant has not yet been created. I assume this is to give the `Portfile` a chance to create its own. -- -- Ticket URL: <https://trac.macports.org/ticket/52739#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#52739: perl5 @5.22.2: build_arch and universal not fully respected ----------------------------------+---------------------- Reporter: MarcusCalhoun-Lopez | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: perl5 | ----------------------------------+---------------------- Comment (by MarcusCalhoun-Lopez): Replying to [comment:2 mojca]:
So basically you don't care which of the three patches is used if I understand correctly? Personally, I have no strong feelings about which is best.
I would imagine that a more logical solution than to create a variant manually or to put the code inside the `pre-configure {}` block would be to use {{{ if {[variant_isset universal]} { configure.post_args-append "-Alddlflags=\"[get_canonical_archflags ld]\"" } }}} Does that work properly? I do not believe this would work.[[BR]] At this point in the Portfile, {{{get_canonical_archflags}}} would not work properly without the workarounds provided earlier.[[BR]] Further, {{{build_arch}}} would still not be respected.
Just curious, what's the difference (if any) between `configure`'s `post-args` and `args`? Why not appending it simply to `args`? I am not sure why {{{configure.post_args}}} is used.[[BR]] I do not see the harm, but {{{configure.args}}} seems like a more nature choice.
I would be grateful for a hint how to test building `.bundle` files. Personally, I use the command {{{find ./ -name \*.bundle -exec file {} \;}}} in the destroot directory to check to check.
Do any of those patches address #52290? Since I can not reproduce the exact error, I am not sure.[[BR]] Based on the error, however, it would seem likely that these two bugs are related.
-- Ticket URL: <https://trac.macports.org/ticket/52739#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts