Opened 3 years ago
Closed 3 years ago
#64276 closed defect (invalid)
macports will not build ports with Xcode 13.2.1
Reported by: | AgilentGCMS | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.1 |
Keywords: | Cc: | ||
Port: | gperf |
Description
I recently updated my mac to Big Sur, and Xcode to 13.2.1. I cleaned out my old port tree and started to build the necessary ports from scratch. Unfortunately, I've failed to build even a single port successfully (yes, I have installed the SDK, it's 12.1). Finally, "port diagnose" told me:
Error: currently installed version of Xcode, 13.2.1, is not supported by MacPorts. For your currently installed system, only the following versions of Xcode are supported: 13.1 13.0 12.5.1 12.5 12.4 12.3 12.2
I've never before faced the problem of my Xcode or SDK being too new. Is there a way to build ports with Xcode 13.2.1, or must I downgrade Xcode?
Attachments (3)
Change History (21)
comment:1 follow-up: 5 Changed 3 years ago by AgilentGCMS
comment:2 follow-up: 6 Changed 3 years ago by reneeotten (Renee Otten)
please attach the mentioned main.log
- it's hard to tell whether the configure failure is related to the warning message about the macOS 11 SDK.
The error from port diagnose
is just that nobody has added the newly released Xcode version yet to the supported list; that doesn't necessarily mean that it will not work.
comment:3 Changed 3 years ago by reneeotten (Renee Otten)
Owner: | set to reneeotten |
---|---|
Port: | gperf added |
Status: | new → assigned |
comment:4 Changed 3 years ago by reneeotten (Renee Otten)
Owner: | reneeotten deleted |
---|
comment:5 follow-up: 8 Changed 3 years ago by jmroot (Joshua Root)
Replying to AgilentGCMS:
I do have an SDK installed,
But that's a macOS 12 SDK, so that doesn't mean the error message is incorrect. You need to have /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
. I would suggest trying the steps in ProblemHotlist#reinstall-clt.
comment:6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
comment:8 Changed 3 years ago by AgilentGCMS
Replying to jmroot:
Replying to AgilentGCMS:
I do have an SDK installed,
But that's a macOS 12 SDK, so that doesn't mean the error message is incorrect. You need to have
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
. I would suggest trying the steps in ProblemHotlist#reinstall-clt.
Well yes, but isn't it odd that macports is looking specifically for macos 11 SDK? Is that hard-coded somewhere?
comment:9 Changed 3 years ago by AgilentGCMS
I should also say here that I used to get the warning about missing macos 11 SDK even on Catalina, but that didn't prevent ports from being built.
comment:10 Changed 3 years ago by mouse07410 (Mouse)
I concur - one should not need MacOS11.sdk to build Big Sur apps in or outside of Macports if MacOS12.sdk is present. So, at worst this should be a warning message, not an error.
comment:11 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
MacPorts wants an SDK that matches the major version of the OS you're on. There are ports that will not build correctly if that is not the case. That's why you get a warning. (It's not an error.)
The main.log says the problem is:
configure: error: C compiler cannot create executables
The config.log says:
configure:2976: === configuring in lib (/Users/sbasu1/packages/macports/var/macports/build/_Users_sbasu1_packages_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gperf/gperf/work/gperf-3.1/lib) configure:3039: running /bin/sh ./configure --disable-option-checking '--prefix=/Users/sbasu1/packages/macports' '--infodir=/Users/sbasu1/packages/macports/share/info' --cache-file=/dev/null --srcdir=. configure:3044: error: ./configure failed for lib
So I guess there is a second config.log file inside the lib directory and that's the one we'll need to see to understand what the problem is.
Changed 3 years ago by AgilentGCMS
Attachment: | config.2.log added |
---|
config.log found inside /Users/sbasu1/packages/macports/var/macports/build/_Users_sbasu1_packages_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gperf/gperf/work/gperf-3.1/lib
comment:12 Changed 3 years ago by AgilentGCMS
There was indeed another config.log inside the lib folder. I've attached that now.
comment:13 Changed 3 years ago by jmroot (Joshua Root)
clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11.0'
Command Line Tools are too old.
comment:14 Changed 3 years ago by AgilentGCMS
I installed Xcode 13.2.1, then the associated command line tools with xcode-select --install
$ clang --version Apple clang version 13.0.0 (clang-1300.0.29.30) Target: x86_64-apple-darwin20.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
If this is too old, then where/how do I get a newer version?
comment:15 Changed 3 years ago by AgilentGCMS
Looking at the config.log
in more details, I see the following block where the CLT version is being checked:
configure:1936: checking for gcc configure:1963: result: /usr/bin/clang configure:2192: checking for C compiler version configure:2201: /usr/bin/clang --version >&5 Apple clang version 11.0.3 (clang-1103.0.32.29) Target: x86_64-apple-darwin20.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
However, there's an inconsistency. If port simply used /usr/bin/clang
, it would be fine.
$ which clang /usr/bin/clang $ `which clang` --version Apple clang version 13.0.0 (clang-1300.0.29.30) Target: x86_64-apple-darwin20.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Instead, it uses an older version of clang
$ /Library/Developer/CommandLineTools/usr/bin/clang --version Apple clang version 11.0.3 (clang-1103.0.32.29) Target: x86_64-apple-darwin20.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
I have no idea why that older version is there. Now the question is: Why does macports use that older version, when (according to the configure output) it found /usr/bin/clang
, which should point it to the newer version of clang
?
comment:16 Changed 3 years ago by AgilentGCMS
In other words, even though configure
says it found /usr/bin/clang
, it is actually using a different clang
executable.
comment:17 Changed 3 years ago by AgilentGCMS
After following the instructions at ProblemHotlist#reinstall-clt it seems that macports can find the correct version of clang. I'll try building some ports and report back if that has fixed everything.
comment:18 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
For example, I tried installing
htop
, with the following error:I do have an SDK installed,
and I've already run
xcode-select --install