Opened 4 years ago

Last modified 8 months ago

#52128 new enhancement

ld64: don't add unsupported subports

Reported by: mojca (Mojca Miklavec) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: jmroot (Joshua Root), ryandesign (Ryan Schmidt)
Port: ld64

Description

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)")

Change History (5)

comment:1 Changed 4 years ago by mojca (Mojca Miklavec)

Here is the preliminary patch:

  • Portfile

     
    4242                    sha256  307f73678a3e5c9ed4d1bcf77da7399d84efac32916c5df6cd477c3b5c36f953
    4343
    4444
     45# Not supported on Yosemite or later.
     46if {${os.major} < 14} {
    4547subport ld64-97 {
    4648    # XCode 3.2.6
    4749    version             97.17
     
    6264        ld64-97-no-Availability.h.patch \
    6365        ld64-97-BaseAtomImplicitDecl.patch \
    6466        ld64-97-no-ppc-thread_status.patch
    65 
    66     if {${os.major} >= 14} {
    67         pre-fetch {
    68             ui_error "$subport is not supported on Yosemite or later."
    69             error "unsupported platform"
    70         }
    71     }
    7267}
     68}
    7369
    7470subport ld64-127 {
    7571    # XCode 4.2
     
    9490        ld64-ppc-9610466.patch
    9591}
    9692
     93# Not supported on Leopard or earlier.  It requires the blocks runtime.
     94if {${os.major} > 9} {
    9795subport ld64-136 {
    9896    # XCode 4.6
    9997    version             136
     
    113111    if {${configure.cxx_stdlib} eq "libstdc++"} {
    114112        patchfiles-append   ld64-136-hash_set.patch
    115113    }
    116 
    117     if {${os.major} <= 9} {
    118         pre-fetch {
    119             ui_error "$subport is not supported on Leopard or earlier.  It requires the blocks runtime."
    120             error "unsupported platform"
    121         }
    122     }
    123114}
    124115
    125116subport ld64-236 {
     
    146137    if {${configure.cxx_stdlib} eq "libstdc++"} {
    147138        patchfiles-append   ld64-236-hash_set.patch
    148139    }
    149 
    150     if {${os.major} <= 9} {
    151         pre-fetch {
    152             ui_error "$subport is not supported on Leopard or earlier.  It requires the blocks runtime."
    153             error "unsupported platform"
    154         }
    155     }
    156140}
     141}
    157142
    158143subport ld64-latest {
    159144    # XCode 7.3.1
     
    193178    build {}
    194179    use_configure no
    195180
    196     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)} {}
     181    if {${os.major} < 14} {
     182        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)} {}
     183    }
    197184    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)} {}
    198     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)} {}
    199     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++)} {}
     185    if {${os.major} > 9} {
     186        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)} {}
     187        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++)} {}
     188    }
    200189    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)} {}
    201190
    202191    if {![variant_isset ld64_97] && ![variant_isset ld64_127] && ![variant_isset ld64_136]} {

I intentionally kept the indentation of subports to minimize the diff.

comment:2 in reply to:  description Changed 4 years ago by mojca (Mojca Miklavec)

Replying to 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.

comment:3 Changed 4 years ago by jeremyhu (Jeremy Huddleston Sequoia)

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?

comment:4 Changed 4 years ago by mojca (Mojca Miklavec)

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.

comment:5 Changed 8 months ago by jmroot (Joshua Root)

Sometimes defining subports and sometimes not causes a number of problems. They should be defined everywhere and set known_fail to avoid buildbot failure messages.

Note: See TracTickets for help on using tickets.