[MacPorts] #67825: Possible to add CI and/or buildbots with GCC (on Intel)?
MacPorts
noreply at macports.org
Tue Jul 25 22:46:02 UTC 2023
#67825: Possible to add CI and/or buildbots with GCC (on Intel)?
----------------------------+---------------------
Reporter: barracuda156 | Owner: admin@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: buildbot/mpbb | Version: 2.8.1
Resolution: | Keywords:
Port: |
----------------------------+---------------------
Comment (by ryandesign):
Adding automated builds that use gcc on modern macOS on Intel (or Apple
Silicon) seems unlikely.
For the buildbot, the answer is a clear no. The buildbot exists to build
binaries of ports for each OS in whatever configuration a user would
normally encounter on that system. Our buildbot workers for Mac OS X 10.6
and later already do that. If a port indicates it needs gcc or some other
compiler, that is used; otherwise MacPorts chooses clang.
As for adding a CI runner to build ports with gcc, there isn't a good way
to do that. The obvious way to do it is specifying e.g.
`configure.compiler=macports-gcc-12` on the command line but that would
override any compiler settings in the port so even if a port already
indicated via `compiler.blacklist *gcc*` that it is not compatible with
gcc, or forced the use of another compiler by setting `configure.compiler
macports-clang-16` or `compiler.whitelist macports-clang-16`, a build with
gcc would happen anyway, would fail, and would waste people's time re-
investigating a failure that was already known and declared.
Also, you can't mix and match C++ standard libraries. MacPorts uses libc++
with clang++ on Mac OS X 10.6 and later so any port that uses C++ on 10.6
or later has to use libc++. Historically, g++ uses libstdc++, so a port
built with g++ on 10.6 or later will fail to link if the port uses any
other C++ libraries built by MacPorts using libc++. g++ 10 and later have
the ability to use libc++ and support for that was
[changeset:ebd226139d5ba8389367606761658ad0e3bb5cce/macports-base added to
MacPorts base] last year but there hasn't been a release of MacPorts base
containing that change yet and I don't know how well g++ works with
libc++.
IIRC there have also been problems where some macOS system headers, in at
least some macOS SDK versions, were not compatible with gcc.
If I find a bug report (even outside of MacPorts) where someone is
encountering a problem building something on macOS with gcc, I'm likely to
advise them to stop trying and to use clang instead. It is the compiler
everyone uses on macOS now. Trying to use something different is going to
cause lots of problems.
I understand that your goal is to improve the situation for PowerPC Macs
where clang is not available and gcc has to be used. But I don't think
trying a gcc build on modern Intel macOS is a good proxy for whether
something builds on an old PowerPC Mac.
That leaves setting up actual PowerPC Macs buildbot workers which is
#66288.
--
Ticket URL: <https://trac.macports.org/ticket/67825#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list