Hi all, invoking cargo build from Xcode on Big Sur currently fails when a crate needs to link against a system library from a build script, unless SDKROOT has been explicitly set to the path of the macOS SDK. Test project here.
When invoking cargo build from an Xcode build script, SDKROOT is set for the platform that's being built. #64254 made it so that SDKROOT gets un-set if the target platform doesn't match the host platform. This seems reasonable to me, but then I don't understand why there's now a difference in behaviour between Xcode and non-Xcode builds.
I logged a similiar issue for cargo-lipo, which has a different workaround of instead setting LIBRARY_PATH.
Hi all, invoking
cargo buildfrom Xcode on Big Sur currently fails when a crate needs to link against a system library from a build script, unlessSDKROOThas been explicitly set to the path of the macOS SDK. Test project here.When invoking
cargo buildfrom an Xcode build script,SDKROOTis set for the platform that's being built. #64254 made it so thatSDKROOTgets un-set if the target platform doesn't match the host platform. This seems reasonable to me, but then I don't understand why there's now a difference in behaviour between Xcode and non-Xcode builds.I logged a similiar issue for
cargo-lipo, which has a different workaround of instead settingLIBRARY_PATH.