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

Build broken on macOS Sonoma (14.4.1) #1748

Open
cpick opened this issue Mar 25, 2024 · 0 comments
Open

Build broken on macOS Sonoma (14.4.1) #1748

cpick opened this issue Mar 25, 2024 · 0 comments

Comments

@cpick
Copy link

cpick commented Mar 25, 2024

On macOS with:

$ uname -a
Darwin hostname 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:11:05 PDT 2024; root:xnu-10063.101.17~1/RELEASE_X86_64 x86_64
$ xcode-select --version
xcode-select version 2406.

But without Xcode installed, builds fail with the following error (the client example is used to illustrate the issue):

$ cargo build --example client
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
warning: [email protected]: macOS deployment target (10.7) too low, it will be increased
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
warning: [email protected]: macOS deployment target (10.7) too low, it will be increased
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
   Compiling quiche v0.20.0 (/Users/cpick/src/quiche/quiche)
error: linking with `cc` failed: exit status: 1
  |
  = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/bin:/Users/cpick/opt/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/Little Snitch.app/Contents/Components:/Users/cpick/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/Users/cpick/.cargo/bin:/Users/cpick/opt/bin:/usr/local/sbin:/usr/local/sbin" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-arch" "x86_64" "-m64" "/var/folders/80/16mrb8bs2y782gm7xh5czrg40000gn/T/rustclAlYPP/symbols.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.13k6yotfaw10do3s.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.13qfq0h55xpo8sh5.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.19vztorrv7c4j2ec.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.1duxr17m9wnvior5.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.1gz16gay5zuchnxm.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.1i4k06v1cmrsgib0.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.1ojcff2z3jxu4k2m.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.1q32xsds3f5ybbgd.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.1sbav02lgxwbhenb.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.1t6wuc879jgicyjs.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.204kx6meqqcn3iq4.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.209f22hc6tvpetzy.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.21m9rnvk2h6oe2jq.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.285bi3v5d01jrkck.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.28ppu0ifaid8zsby.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.2ewlx2bfav2gw3ic.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.2jqh63xukg1h2v.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.2n0uk3d77gs8qfvz.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.2rdmjho204o5lwr7.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.2rjb3jzixpip8863.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.2yqnsb5igzdxr200.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.2yszld2fm00hkym9.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.2z3w5qibmbyfpro4.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.37zev1i50zk7du61.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.3hb5qybavfzikki6.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.3u71czotctsov3t2.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.48crd6j4fjuyg767.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.4x15pxn2qhh47rey.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.517sltdxdsr59k7g.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.529sfi20moxq50vc.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.59z2vztbdk7wbbip.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.78gys2zl1i4cog4.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.cekpis4n4rkthzm.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.dghukxer66jwfwh.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.dgrwad7rrhv8w5b.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.f3cxbcukk6p3mpm.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.fbt2ldjywsv4kxx.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.jvzao4878zv7rle.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.kiuee9si0ij046.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.lmn18p9u5nrwji2.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.ny7ftf1qathwjn3.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.o8qw6s4twzz7dp0.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.rih6f6ak21ltd06.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.tkg626wzvej3gvv.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.tkhc3ngu4hbzah6.rcgu.o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0.3ki23b6gh48rqdu3.rcgu.o" "-L" "/Users/cpick/src/quiche/target/debug/deps" "-L" "/Users/cpick/src/quiche/target/debug/build/quiche-0b2fd3e2e616f06c/out/build/" "-L" "/Users/cpick/src/quiche/target/debug/build/ring-978c4b8fda33feca/out" "-L" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/cpick/src/quiche/target/debug/deps/libquiche.rlib" "/Users/cpick/src/quiche/target/debug/deps/liblibm-2e2875cc79d9f030.rlib" "/Users/cpick/src/quiche/target/debug/deps/libsfv-60edd0e9c5d293a9.rlib" "/Users/cpick/src/quiche/target/debug/deps/librust_decimal-8f90936f35110e34.rlib" "/Users/cpick/src/quiche/target/debug/deps/libarrayvec-b7e1c01c0a69b8fc.rlib" "/Users/cpick/src/quiche/target/debug/deps/libnum_traits-68936484161a5afd.rlib" "/Users/cpick/src/quiche/target/debug/deps/libdata_encoding-f24b2dd4a1b95eb7.rlib" "/Users/cpick/src/quiche/target/debug/deps/liboctets-2b0494d7d29c9100.rlib" "/Users/cpick/src/quiche/target/debug/deps/libonce_cell-c8efe44cfac0a5cf.rlib" "/Users/cpick/src/quiche/target/debug/deps/libintrusive_collections-fd39cf8581b99b3d.rlib" "/Users/cpick/src/quiche/target/debug/deps/libmemoffset-6751ffecf06f4244.rlib" "/Users/cpick/src/quiche/target/debug/deps/libeither-991b3658e21dc0cc.rlib" "/Users/cpick/src/quiche/target/debug/deps/libslab-c12462bb92b62411.rlib" "/Users/cpick/src/quiche/target/debug/deps/libqlog-5d255ca0b17e189b.rlib" "/Users/cpick/src/quiche/target/debug/deps/libserde_json-2c68e15417277dd9.rlib" "/Users/cpick/src/quiche/target/debug/deps/libitoa-c2dfc4545b0373e2.rlib" "/Users/cpick/src/quiche/target/debug/deps/libryu-b5d9d84eab8ae0a9.rlib" "/Users/cpick/src/quiche/target/debug/deps/libindexmap-a87cf176d6ed18a4.rlib" "/Users/cpick/src/quiche/target/debug/deps/libequivalent-1987a04a349eb12e.rlib" "/Users/cpick/src/quiche/target/debug/deps/libhashbrown-f99643c2a51c2834.rlib" "/Users/cpick/src/quiche/target/debug/deps/libserde_with-6c1cd026b2cd7429.rlib" "/Users/cpick/src/quiche/target/debug/deps/libsmallvec-253c7fa9d166ae36.rlib" "/Users/cpick/src/quiche/target/debug/deps/libserde-1ac5d4ad0ec0f170.rlib" "/Users/cpick/src/quiche/target/debug/deps/libmio-fc29a90a0fe5f5a2.rlib" "/Users/cpick/src/quiche/target/debug/deps/liburl-0047ac4043ec5577.rlib" "/Users/cpick/src/quiche/target/debug/deps/libidna-b6524f527b13859b.rlib" "/Users/cpick/src/quiche/target/debug/deps/libunicode_normalization-d67f0ad94df05092.rlib" "/Users/cpick/src/quiche/target/debug/deps/libtinyvec-8aae1cfd39a0343c.rlib" "/Users/cpick/src/quiche/target/debug/deps/libtinyvec_macros-eb5d43ec0dd0cc25.rlib" "/Users/cpick/src/quiche/target/debug/deps/libunicode_bidi-69325144e7e2e875.rlib" "/Users/cpick/src/quiche/target/debug/deps/libform_urlencoded-017e44d986475d50.rlib" "/Users/cpick/src/quiche/target/debug/deps/libpercent_encoding-34e6bd0e1ce943f4.rlib" "/Users/cpick/src/quiche/target/debug/deps/libring-868910881db8bdaa.rlib" "/Users/cpick/src/quiche/target/debug/deps/libgetrandom-6bbf658ec1871f1a.rlib" "/Users/cpick/src/quiche/target/debug/deps/liblibc-ac40b9d085166371.rlib" "/Users/cpick/src/quiche/target/debug/deps/libspin-7fdc7109a0d593ff.rlib" "/Users/cpick/src/quiche/target/debug/deps/libuntrusted-93e96d23ebb0168e.rlib" "/Users/cpick/src/quiche/target/debug/deps/libcfg_if-8c34475493eb3b02.rlib" "/Users/cpick/src/quiche/target/debug/deps/liblog-3016222b816e7987.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-960d4882ff352024.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-61ac09eb9be89a58.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-47725dcc4098cefe.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-f8075422c0b8c742.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-333b26104db8a51e.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-ab6b55175b2e2ae9.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-29a9acdc4ae14eff.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-e989c97d15cfeae5.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-c87c5072a08d7306.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-b964ee6492071d33.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-d5d75efd4755d33e.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-cf16ab2c411e205e.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-7e2b54a40363364d.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-4aa674aa8fc55f75.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-750520551ac43257.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-f6c8d089a103a2bd.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-2390f4e89b0bad84.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-cc0f94a01fd3aac7.rlib" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-1f8f519f74859613.rlib" "-liconv" "-lSystem" "-lc" "-lm" "-L" "/Users/cpick/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/cpick/src/quiche/target/debug/examples/client-2c46ad0fe25c42d0" "-Wl,-dead_strip" "-nodefaultlibs" "-Wl,-rpath,/Users/cpick/src/quiche/target/debug/build/quiche-0b2fd3e2e616f06c/out"
  = note: Undefined symbols for architecture x86_64:
            "___isPlatformVersionAtLeast", referenced from:
                _init_once in libquiche.rlib[384](bcm.c.o)
                _fill_with_entropy in libquiche.rlib[384](bcm.c.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


The following warnings were emitted during compilation:

warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
warning: [email protected]: macOS deployment target (10.7) too low, it will be increased
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
warning: [email protected]: macOS deployment target (10.7) too low, it will be increased
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'

error: could not compile `quiche` (example "client") due to 1 previous error

It looks like this is due to an upstream issue in the "cc" crate. While they work on a more comprehensive solution the following workaround worked for me by appending the following section to this repository's top-level Cargo.toml:

[patch.crates-io]
# fix the following error:
# $ cargo build --example client
# warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
# warning: [email protected]: xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
# see: https://github.com/rust-lang/cc-rs/issues/1001
cc = { git = "https://github.com/rust-lang/cc-rs", rev = "refs/pull/1007/head" }
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

No branches or pull requests

1 participant