Opened 5 months ago

#65487 assigned defect

gate: doesn't select default qt / qt5 variant when geant4.10.5 is not yet installed

Reported by: ryandesign (Ryan Schmidt) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc:
Port: gate

Description

The gate portfile contains this code:

# some ugly code to make sure that the variants for Qt version used
# are consistent between Gate and Geant4; looking for suggestions for improvement
if {![catch {set result [active_variants geant4.10.5 qt5 qt]}]} {
    if {$result} {
        default_variants-append +qt5
    } else {
        default_variants-append +qt4
    }
}

This doesn't work well if geant4.10.5 was not installed at the time that sudo port install gate was run. That was the case for me, and then the gate build was interrupted (it failed because of #65404) and then when I tried to build again it failed because it was now choosing different default variants:

Error: Requested variants "+geant4105+qt5" do not match those the build was started with: "+geant4105".
Error: Please use the same variants again, or run 'port clean gate' first to remove the existing partially completed build.

The geant4.10.5 portfile currently contains this:

        if {![variant_isset qt] && ![variant_isset qt5]} {
            # almost an arbitrary version of Geant4 (earlier versions had worse support for Qt5)
            # TODO: the default version should also depend on macOS version, but not sure where to cut the line
            if {${geant.version} < "10.3"} {
                default_variants-append +qt
            } else {
                default_variants-append +qt5
            }
        }

Perhaps the gate port should be modified so that, if geant4.10.5 is not installed yet, it chooses a default variant that matches the default variant that geant4.10.5 will use.

Incidentally, version numbers like ${geant.version} should be compared using the vercmp procedure, not the < operator (which is for integers and floating point numbers, not version numbers).

Change History (0)

Note: See TracTickets for help on using tickets.