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

1.0.86 producing clang: error: invalid version number in '-mmacosx-version-min=1.1' on macos 10.14 #963

Closed
terakilobyte opened this issue Feb 22, 2024 · 11 comments · Fixed by #1007

Comments

@terakilobyte
Copy link

We build for a variety of platforms and noticed build failures on macOS 10.14, clang: error: invalid version number in '-mmacosx-version-min=1.1'. After investigating, we found that the issue is related to cc 1.0.86. Manually editing our lock file and pinning to 1.0.83 resolves the issue. We do not directly depend on cc.

@NobodyXu
Copy link
Collaborator

cc @BlackHoleFox

@BlackHoleFox
Copy link
Contributor

Uhh that's a new one. I'll try and see how 1.1 is getting passed there. That's definitely a bug with how low it is.

@terakilobyte Do you set MACOSX_DEPLOYMENT_TARGET anywhere in your build?

@terakilobyte
Copy link
Author

@BlackHoleFox we don't set anything ourselves. The specific dependency that is causing the issue is ring. However, changing versions doesn't change the outcome, and grepping the code doesn't show this value anywhere.

The specific trace from cargo is

--- stdout
cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_8_
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
cargo:rerun-if-env-changed=CC_x86_64-apple-darwin
CC_x86_64-apple-darwin = None
cargo:rerun-if-env-changed=CC_x86_64_apple_darwin
CC_x86_64_apple_darwin = None
cargo:rerun-if-env-changed=HOST_CC
HOST_CC = None
cargo:rerun-if-env-changed=CC
CC = None
running: "cc" "--version"
exit status: 0
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
running: "xcrun" "--show-sdk-platform-version" "--sdk" "macosx"
exit status: 0
cargo:rerun-if-env-changed=CFLAGS_x86_64-apple-darwin
CFLAGS_x86_64-apple-darwin = None
cargo:rerun-if-env-changed=CFLAGS_x86_64_apple_darwin
CFLAGS_x86_64_apple_darwin = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
running: env -u IPHONEOS_DEPLOYMENT_TARGET "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "-m64" "--target=x86_64-apple-darwin" "-mmacosx-version-min=1.1" "-I" "include" "-I" "/data/mci/85ccc5054d6fa2249fab3ef8c2b8b331/mongosql-rs/test_target/release/build/ring-1263077dba426390/out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-gfull" "-DNDEBUG" "-o" "/data/mci/85ccc5054d6fa2249fab3ef8c2b8b331/mongosql-rs/test_target/release/build/ring-1263077dba426390/out/fad98b632b8ce3cc-curve25519.o" "-c" "crypto/curve25519/curve25519.c"
cargo:warning=clang: error: invalid version number in '-mmacosx-version-min=1.1'
exit status: 1
--- stderr

I also checked an env dump on the host and it's not being set there.

@NobodyXu
Copy link
Collaborator

I skimmed through ring's build.rs and I don't think it sets any environment variable.

@BlackHoleFox
Copy link
Contributor

It seems likely that the crate hitting it is just a red herring.

@BlackHoleFox
Copy link
Contributor

@terakilobyte Can you run xcrun --show-sdk-platform-version --sdk macosx on that system as well and drop the result here? I wonder if I'm parsing something wrong.

@terakilobyte
Copy link
Author

@BlackHoleFox Here's the output from the host:

echo XCRUN SDK VERSION: $(xcrun --show-sdk-platform-version --sdk macosx)
[2024/02/26 08:04:43.974] XCRUN SDK VERSION: 1.1

@BlackHoleFox
Copy link
Contributor

uhhhh weird. I'll look into that through this week. After downloading XCode 11.3.1 I don't even see that value in the SDKSettings JSON.

@terakilobyte
Copy link
Author

These are mac stadium hosts and moving from 10.14 to 11 makes the issue go away, so it could be something specific to our setup. It's not blocking us so please don't burn the candle at both ends.

@BlackHoleFox
Copy link
Contributor

Think I've figured the issue out here and a more robust solution. Gonna need a few days to find the time to implement it though apologies.

@suomela
Copy link

suomela commented Mar 28, 2024

I noticed that rustsat-cadical fails to compile on macOS; works fine after cargo add cc@=1.0.83

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

Successfully merging a pull request may close this issue.

4 participants