[MacPorts] #70144: Incorrect conditions for making decisions based on Xcode or Xcode command line tools version
MacPorts
noreply at macports.org
Mon Jun 3 07:50:10 UTC 2024
#70144: Incorrect conditions for making decisions based on Xcode or Xcode command
line tools version
------------------------+--------------------
Reporter: ryandesign | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: | Port:
------------------------+--------------------
Multiple ports and the mpi 1.0 portgroup use code such as this to decide
whether to use the pre-Xcode-15 linker:
{{{#!tcl
platform darwin {
if {([vercmp ${xcodeversion} >= 15]) || ([vercmp ${xcodecltversion} >=
15])} {
configure.ldflags-append -Wl,-ld_classic
}
}
}}}
This is wrong because it does not take into consideration whether Xcode or
the Xcode command line tools will be used for the build.
* If the user only has the Xcode command line tools installed, then the
Xcode command line tools will be used.
* If the user only has Xcode installed, then Xcode will be used.
* If the user has both Xcode and the Xcode command line tools installed,
then Xcode will be used if `use_xcode yes` is set, otherwise the Xcode
command line tools will be used.
The current code works fine if the user has the same version of Xcode and
the Xcode command line tools but that is not necessarily the case. Even
two of the GitHub Actions CI runners are currently configured with
mismatched Xcode and Xcode command line tools versions; see #69668.
I found these affected ports: gcc-devel, gcc10-bootstrap, gcc11, gcc12,
gcc13, zig, scip, sundials5, ffmpeg-devel, ffmpeg, ffmpeg6, basix, root6.
gcc8, gcc9, and gcc10 use a similarly incorrect check for Xcode or CLT
version 12.5.
I don't know what the correct code would be but once it's figured out what
it is it can be fixed in all the places.
--
Ticket URL: <https://trac.macports.org/ticket/70144>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list