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)

config.log (3.9 KB) - added by AgilentGCMS 3 years ago.
config.log
main.log (22.1 KB) - added by AgilentGCMS 3 years ago.
main.log
config.2.log (6.8 KB) - added by AgilentGCMS 3 years ago.
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

Download all attachments as: .zip

Change History (21)

comment:1 Changed 3 years ago by AgilentGCMS

For example, I tried installing htop, with the following error:

$ port install htop
Warning: The macOS 11 SDK does not appear to be installed. Ports may not build correctly.
Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'.
--->  Computing dependencies for htop
The following dependencies will be installed:
 autoconf
 automake
 gettext
 gettext-runtime
 gettext-tools-libs
 gperf
 libiconv
 libtextstyle
 libtool
 m4
 ncurses
 pkgconfig
 xz
Continue? [Y/n]:
Warning: The macOS 11 SDK does not appear to be installed. Ports may not build correctly.
Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'.
--->  Configuring gperf
Error: Failed to configure gperf: consult /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/config.log
Error: Failed to configure gperf: configure failure: command execution failed
Error: See /Users/sbasu1/packages/macports/var/macports/logs/_Users_sbasu1_packages_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gperf/gperf/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port htop failed

I do have an SDK installed,

$ ls -l /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
total 0
drwxr-xr-x  7 root  wheel  224 Nov 19 17:25 MacOSX.sdk
lrwxr-xr-x  1 root  wheel   10 Dec 22 11:13 MacOSX12.1.sdk -> MacOSX.sdk

and I've already run xcode-select --install

comment:2 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: newassigned

comment:4 Changed 3 years ago by reneeotten (Renee Otten)

Owner: reneeotten deleted

comment:5 in reply to:  1 ; 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 in reply to:  2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to reneeotten:

please attach the mentioned main.log

and config.log

Changed 3 years ago by AgilentGCMS

Attachment: config.log added

config.log

Changed 3 years ago by AgilentGCMS

Attachment: main.log added

main.log

comment:7 Changed 3 years ago by AgilentGCMS

config.log and main.log now attached

comment:8 in reply to:  5 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.

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:18 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: invalid
Status: assignedclosed
Note: See TracTickets for help on using tickets.