Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console output is full of xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation #1001

Closed
Zalathar opened this issue Mar 8, 2024 · 9 comments · Fixed by #1007 · May be fixed by #1009
Closed

Comments

@Zalathar
Copy link

Zalathar commented Mar 8, 2024

After rust-lang/rust updated cc from 1.0.79 to 1.0.90 (rust-lang/rust#119199), I started seeing several copies of this message appearing on my console during a build:

warning: profiler_builtins@0.0.0: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: profiler_builtins@0.0.0: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'

warning: rustc_llvm@0.0.0: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: rustc_llvm@0.0.0: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'

My build still seems to work just fine, so I'm trying to figure out the appropriate way to resolve these annoying console messages.

It seems that the changes made in #943 don't interact nicely with macOS systems that have the command-line developer tools installed, but don't have a full Xcode installation.

@NobodyXu
Copy link
Collaborator

NobodyXu commented Mar 8, 2024

I seem to have the same warnings on my macOS, which also don't have the full xcode installed

cc @BlackHoleFox

@Zalathar
Copy link
Author

Zalathar commented Mar 8, 2024

For reference, the xcrun message is the same as what I would get when running this command manually:

$ xcrun --show-sdk-platform-version
xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'

For whatever reason, the --show-sdk-platform-version flag doesn't work with Apple's own CommandLineTools.

@BlackHoleFox
Copy link
Contributor

@Zalathar xcrun --show-sdk-path works still with the CommandLineTools right?

Also would you mind confirming /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/SDKSettings.json exists in your installation? Its been ages since I haven't had the full XCode installed.

@NobodyXu This will get fixed by the patch I'm working on that will handle #963 too.

@Zalathar
Copy link
Author

Zalathar commented Mar 8, 2024

Yes, --show-sdk-path, --show-sdk-version, and --show-sdk-build-version all work fine with CommandLineTools.

It's only --show-sdk-platform-path and --show-sdk-platform-version that are broken.

@Zalathar
Copy link
Author

Zalathar commented Mar 8, 2024

And yes, /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/SDKSettings.json exists and seems to be full of information.

@BlackHoleFox
Copy link
Contributor

Those ended platform flags up not being what I thought they were (shocker, a poorly documented command line flag was deceptive!) so I'm removing their usage soon. The new changeset will just read from the SDK's JSON file (thanks for confirming its there for you) to get the data it needs. This is exactly what clang does so hopefully the weird issues go away.

@ToufeeqP
Copy link

This issue was not there until version 1.0.83, I switched back to 1.0.83 from 1.0.90 and it works.

@C-B-Elite
Copy link

C-B-Elite commented Mar 29, 2024

I encountered a similar issue:
cargo:warning=xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation cargo:warning=xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' cargo:warning=macOS deployment target (10.7) too low, it will be increase
My Mac information:
ProductName: macOS
ProductVersion: 14.4.1
BuildVersion: 23E22

This error message showed that xcrun could not find the version number. After finding the answer in a post on
Stack Overflow, and install the Xcode APP
Finally, I solved the problem by downloading the Xcode application and successfully compiled librocksdb-sys.
Hope this helps you.

@ritalin
Copy link

ritalin commented Apr 3, 2024

I've occured on building duckdb-rs.

In this case, setting MACOSX_DEPLOYMENT_TARGET environment variable led to work around this problem.

export MACOSX_DEPLOYMENT_TARGET=10.11
cargo run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants