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

CI: Update Xcode version #121058

Open
ehuss opened this issue Feb 13, 2024 · 0 comments
Open

CI: Update Xcode version #121058

ehuss opened this issue Feb 13, 2024 · 0 comments
Labels
A-ci Area: Our Github Actions CI O-macos Operating system: macOS T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@ehuss
Copy link
Contributor

ehuss commented Feb 13, 2024

In #120914 we downgraded Xcode from 14 to 13 due to two issues:

  • invalid r_symbolnum when testing cranelift
  • cmake fails to verify that clang can build a simple test program.

We will need to upgrade eventually since GitHub removes older xcode versions over time. My rough estimate is that we probably have about a year before that happens. I think it would be good to be prepared. There is also the possibility that GitHub will drop the x86_64 macos runners, in which case this will be moot.

I tested Xcode 15, but that still had the same problems.

Cmake error

The cmake error looks like this:

-- Check for working C compiler: /Users/runner/work/rust/rust/clang+llvm-14.0.5-x86_64-apple-darwin/bin/clang - broken
  The C compiler

    "/Users/runner/work/rust/rust/clang+llvm-14.0.5-x86_64-apple-darwin/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/runner/work/rust/rust/build/x86_64-apple-ios/native/sanitizers/build/CMakeFiles/CMakeScratch/TryCompile-DlTLuP'
    
    Run Build Command(s): /usr/local/bin/ninja -v cmTC_4a181
    [1/2] /Users/runner/work/rust/rust/clang+llvm-14.0.5-x86_64-apple-darwin/bin/clang --target=x86_64-apple-ios   -fPIC --target=x86_64-apple-ios -m64 -mios-simulator-version-min=7.0 -isysroot /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk -fembed-bitcode -fdebug-prefix-map=/Users/runner/work/rust/rust=/rustc/llvm -fembed-bitcode=off -MD -MT CMakeFiles/cmTC_4a181.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_4a181.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_4a181.dir/testCCompiler.c.o -c /Users/runner/work/rust/rust/build/x86_64-apple-ios/native/sanitizers/build/CMakeFiles/CMakeScratch/TryCompile-DlTLuP/testCCompiler.c
    [2/2] : && /Users/runner/work/rust/rust/clang+llvm-14.0.5-x86_64-apple-darwin/bin/clang --target=x86_64-apple-ios -fPIC --target=x86_64-apple-ios -m64 -mios-simulator-version-min=7.0 -isysroot /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk -fembed-bitcode -fdebug-prefix-map=/Users/runner/work/rust/rust=/rustc/llvm -fembed-bitcode=off -Wl,-search_paths_first  -static-libstdc++ CMakeFiles/cmTC_4a181.dir/testCCompiler.c.o -o cmTC_4a181   && :
    FAILED: cmTC_4a181 
    : && /Users/runner/work/rust/rust/clang+llvm-14.0.5-x86_64-apple-darwin/bin/clang --target=x86_64-apple-ios -fPIC --target=x86_64-apple-ios -m64 -mios-simulator-version-min=7.0 -isysroot /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk -fembed-bitcode -fdebug-prefix-map=/Users/runner/work/rust/rust=/rustc/llvm -fembed-bitcode=off -Wl,-search_paths_first  -static-libstdc++ CMakeFiles/cmTC_4a181.dir/testCCompiler.c.o -o cmTC_4a181   && :
    clang-14: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
    ld: unknown options: -ios_simulator_version_min 
    clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:14 (project)

One workaround is to set USE_XCODE_CLANG: 1 in ci.yml. I'm not sure if there is a strong reason to use USE_XCODE_CLANG or not. Another possibility is to update the pre-built clang to match the version in Xcode and see if that helps. My guess is that having clang and ld out of sync might contribute to the problem.

@ehuss ehuss added O-macos Operating system: macOS T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. A-ci Area: Our Github Actions CI labels Feb 13, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 13, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ci Area: Our Github Actions CI O-macos Operating system: macOS T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants