[MacPorts] #52128: ld64: don't add unsupported subports
#52128: ld64: don't add unsupported subports -------------------------+------------------------ Reporter: mojca@… | Owner: jeremyhu@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: | Port: ld64 -------------------------+------------------------ I mentioned this in comment:9:ticket:52091, but it's probably best to open a standalone ticket. I would like to request removal of subports that are not supported on a particular OS. Not that this is a problem in practice (not sure why users would intentionally try to install an unsupported dependency), but it generates "red flags" and "annoying" emails from the buildbot. Below is a patch that needs some additional cleanup (which Joshua might be eager to do :) to remove non-existing variants from the conflict list. Another minor disadvantage is that conditions like {{{ if {${os.major} < 14} }}} are currently repeated twice. It would be more elegant to be able to write that condition just once (potentially next to variant description like "`(last version that works on Leopard)`") -- Ticket URL: <https://trac.macports.org/ticket/52128> MacPorts <https://www.macports.org/> Ports system for OS X
#52128: ld64: don't add unsupported subports --------------------------+------------------------ Reporter: mojca@… | Owner: jeremyhu@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: ld64 | --------------------------+------------------------ Comment (by mojca@…): Here is the preliminary patch: {{{ #!diff --- Portfile (revision 152090) +++ Portfile (working copy) @@ -42,6 +42,8 @@ sha256 307f73678a3e5c9ed4d1bcf77da7399d84efac32916c5df6cd477c3b5c36f953 +# Not supported on Yosemite or later. +if {${os.major} < 14} { subport ld64-97 { # XCode 3.2.6 version 97.17 @@ -62,14 +64,8 @@ ld64-97-no-Availability.h.patch \ ld64-97-BaseAtomImplicitDecl.patch \ ld64-97-no-ppc-thread_status.patch - - if {${os.major} >= 14} { - pre-fetch { - ui_error "$subport is not supported on Yosemite or later." - error "unsupported platform" - } - } } +} subport ld64-127 { # XCode 4.2 @@ -94,6 +90,8 @@ ld64-ppc-9610466.patch } +# Not supported on Leopard or earlier. It requires the blocks runtime. +if {${os.major} > 9} { subport ld64-136 { # XCode 4.6 version 136 @@ -113,13 +111,6 @@ if {${configure.cxx_stdlib} eq "libstdc++"} { patchfiles-append ld64-136-hash_set.patch } - - if {${os.major} <= 9} { - pre-fetch { - ui_error "$subport is not supported on Leopard or earlier. It requires the blocks runtime." - error "unsupported platform" - } - } } subport ld64-236 { @@ -146,14 +137,8 @@ if {${configure.cxx_stdlib} eq "libstdc++"} { patchfiles-append ld64-236-hash_set.patch } - - if {${os.major} <= 9} { - pre-fetch { - ui_error "$subport is not supported on Leopard or earlier. It requires the blocks runtime." - error "unsupported platform" - } - } } +} subport ld64-latest { # XCode 7.3.1 @@ -193,10 +178,14 @@ build {} use_configure no - variant ld64_97 conflicts ld64_127 ld64_136 ld64_236 ld64_xcode description {Use ld64-97 as the default linker (last version that works on Tiger)} {} + if {${os.major} < 14} { + variant ld64_97 conflicts ld64_127 ld64_136 ld64_236 ld64_xcode description {Use ld64-97 as the default linker (last version that works on Tiger)} {} + } variant ld64_127 conflicts ld64_97 ld64_136 ld64_236 ld64_xcode description {Use ld64-127 as the default linker (last version to support ppc)} {} - variant ld64_136 conflicts ld64_97 ld64_127 ld64_236 ld64_xcode description {Use ld64-136 as the default linker (last version that works on Leopard)} {} - variant ld64_236 conflicts ld64_97 ld64_127 ld64_136 ld64_xcode description {Use ld64-236 as the default linker (last version that builds against OS X's libstdc++)} {} + if {${os.major} > 9} { + variant ld64_136 conflicts ld64_97 ld64_127 ld64_236 ld64_xcode description {Use ld64-136 as the default linker (last version that works on Leopard)} {} + variant ld64_236 conflicts ld64_97 ld64_127 ld64_136 ld64_xcode description {Use ld64-236 as the default linker (last version that builds against OS X's libstdc++)} {} + } variant ld64_xcode conflicts ld64_97 ld64_127 ld64_136 ld64_236 description {Use ld64-xcode as the default linker (version provided by the selected Xcode.app toolchain)} {} if {![variant_isset ld64_97] && ![variant_isset ld64_127] && ![variant_isset ld64_136]} { }}} I intentionally kept the indentation of subports to minimize the diff. -- Ticket URL: <https://trac.macports.org/ticket/52128#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#52128: ld64: don't add unsupported subports --------------------------+------------------------ Reporter: mojca@… | Owner: jeremyhu@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: ld64 | --------------------------+------------------------ Comment (by mojca@…): Replying to [ticket:52128 mojca@…]:
I would like to request removal of subports that are not supported on a
particular OS. Not that this is a problem in practice (not sure why users would intentionally try to install an unsupported dependency) I was slightly wrong here. Unsupported variants (or subports for that matter) are also a problem for users who upgrade. This was a problem for `ld64_latest +llvm33` or `+llvm34` that triggered errors. It's probably not a problem in this specific case, but I still believe that it would be nice to only list and allow supported variants and subports. -- Ticket URL: <https://trac.macports.org/ticket/52128#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#52128: ld64: don't add unsupported subports --------------------------+------------------------ Reporter: mojca@… | Owner: jeremyhu@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: ld64 | --------------------------+------------------------ Comment (by jeremyhu@…): Yeah, I was think that as well, but I left it alone since I wasn't sure how to safely do it. This is consistent with the way we exclude full ports that are not supported on a particular OS (older gcc versions, etc), how should we exclude those? -- Ticket URL: <https://trac.macports.org/ticket/52128#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#52128: ld64: don't add unsupported subports --------------------------+------------------------ Reporter: mojca@… | Owner: jeremyhu@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: ld64 | --------------------------+------------------------ Comment (by mojca@…): Ryan recently brought it up on the mailing list and we didn't reach any conclusion yet. We'll probably have to extend base (or some portgroup) to cover that case. We should open a ticket for that if there isn't one open already. At the moment an ugly "workaround" is to declare the port obsolete to avoid a build failure on the buildbot. But I wouldn't argue that we should "keep this broken" just because there's another similar case that we don't know how to handle yet. One option would be to add something like {{{ if {${os.major} > 9} { stop-reading-this-file } }}} at the top of the `Portfile`. This wouldn't work in cases where the main port is not installable, but a subport is. But let's move that part of discussion elsewhere. -- Ticket URL: <https://trac.macports.org/ticket/52128#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts