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

Closed
ehuss opened this issue Feb 13, 2024 · 2 comments · Fixed by #131570
Closed

CI: Update Xcode version #121058

ehuss opened this issue Feb 13, 2024 · 2 comments · Fixed by #131570
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 15 to 14 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.

Discussion that led up to this: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Weird.20CI.20failure.20on.20x86_64-apple-1.3A.20invalid.20r_symbolnum.3D14

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
@bjorn3
Copy link
Member

bjorn3 commented Jun 30, 2024

rust-lang/rustc_codegen_cranelift#1456 when testing cranelift

#127162 will fix this.

@ehuss
Copy link
Contributor Author

ehuss commented Oct 10, 2024

#131494 points out that removal of xcode 14 is imminent via actions/runner-images#10703.

bors added a commit to rust-lang-ci/rust that referenced this issue Oct 16, 2024
(ci) Update macOS Xcode to 15

This updates the macOS builders to Xcode 15. The aarch64 images will be removing Xcode 14 and 16 very soon (actions/runner-images#10703), so we will need to make the switch to continue operating. The linked issue also documents GitHub's new policy for how they will be updating Xcode in the future. Also worth being aware of is the future plans for x86 runners documented in actions/runner-images#9255 and actions/runner-images#10686, which will impact our future upgrade behaviors.

I decided to also update the Xcode in the x86_64 runners, even though they are not being removed. It felt better to me to have all macOS runners on the same (major) version of Xcode. However, note that the x86_64 runners do not have the latest version of 15 (15.4), so I left them at 15.2 (which is currently the default Xcode of the runner).

Xcode 15 was previously causing problems (see rust-lang#121058) which seem to be resolved now. `@bjorn3` fixed the `invalid r_symbolnum` issue with cranelift. The issue with clang failing to link seems to be fixed, possibly by the update of the pre-built LLVM from 14 to llvm 15 in rust-lang#124850, or an update in our source version of LLVM. I have run some try builds and at least LLVM seems to build (I did not run any tests).

Closes rust-lang#121058
@bors bors closed this as completed in 4392847 Oct 21, 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

Successfully merging a pull request may close this issue.

4 participants