Skip to content

Always use Xcode-provided Clang in macOS CI#152192

Open
madsmtm wants to merge 3 commits intorust-lang:mainfrom
madsmtm:remove-use-xcode-clang
Open

Always use Xcode-provided Clang in macOS CI#152192
madsmtm wants to merge 3 commits intorust-lang:mainfrom
madsmtm:remove-use-xcode-clang

Conversation

@madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Feb 5, 2026

Most of our macOS CI runners use the Xcode-provided Clang. dist-apple-various still downloads Clang from LLVM's prebuilt sources, which is a bit problematic, because we're still using the Xcode-provided headers.

As a concrete example, using Xcode's Clang is required by #152013, as otherwise updating to Xcode 26 headers fails with an obscure fatal error: 'net/route.h' file not found, see this build log. I suspect this is because building the new headers isn't officially supported with the older LLVM/Clang 15.

This PR removes that functionality, so that we instead always build with the Xcode-provided Clang. This is effectively the same as setting USE_XCODE_CLANG=1 on dist-apple-various as well, but I thought I'd clean things up while I'm at it.

I didn't find the reason why we did this in first place, maybe because the Xcode Clang at the time was too out of date to build LLVM? It doesn't seem to be a problem anymore though.

r? t-infra

Instead, always use the Xcode-provided Clang to build LLVM.
Bootstrap no longer infers the archiver as `clang-ar`, so we don't need
to set this explicitly.
Instead of manually setting up CC/CXX environment variables, use the
default configuration that Xcode gives us.
@madsmtm madsmtm 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 5, 2026
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 5, 2026
@madsmtm madsmtm added the O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) label Feb 5, 2026
@madsmtm
Copy link
Contributor Author

madsmtm commented Feb 5, 2026

@bors try jobs=apple

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 5, 2026
Always use Xcode-provided Clang in macOS CI


try-job: *apple*
@madsmtm madsmtm mentioned this pull request Feb 5, 2026
@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 6, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 6, 2026

💥 Test timed out after 21600s

@madsmtm
Copy link
Contributor Author

madsmtm commented Feb 6, 2026

@bors retry

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 6, 2026

❗ You can only retry pull requests that are approved and have a previously failed auto build.

@madsmtm
Copy link
Contributor Author

madsmtm commented Feb 6, 2026

Right, I wanted you to retry the try, not retry the merge ;)

@bors try jobs=apple

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 6, 2026
Always use Xcode-provided Clang in macOS CI


try-job: *apple*
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 6, 2026

☀️ Try build successful (CI)
Build commit: c4619b7 (c4619b7af1e6bb62315400fb998598d9d3012bb0, parent: a3ceeeb26c31eb15ace604890cef17d75a735ed2)

@madsmtm
Copy link
Contributor Author

madsmtm commented Feb 6, 2026

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 6, 2026
@shepmaster
Copy link
Member

I'm happy to bring more things into alignment!

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 6, 2026

📌 Commit 3882573 has been approved by shepmaster

It is now in the queue for this repository.

@rust-bors rust-bors bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 6, 2026
@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 6, 2026
@shepmaster
Copy link
Member

we instead always build with the Xcode-provided Clang. This is effectively the same as setting USE_XCODE_CLANG=1 on dist-apple-various

For my own notes: we were setting USE_XCODE_CLANG=1 on all the big-name jobs (e.g. aarch64 and x86_64 dist builds), so there's not as much change as it looks at first.

I didn't find the reason why we did this in first place

I think that was me, and if I recall, it was because there was no upstream clang that could do the cross-compilation to aarch64 at the time, only the special version that Apple shipped on the DTKs.

TaKO8Ki added a commit to TaKO8Ki/rust that referenced this pull request Feb 6, 2026
…shepmaster

Always use Xcode-provided Clang in macOS CI

Most of our macOS CI runners use the Xcode-provided Clang. `dist-apple-various` still downloads Clang from LLVM's prebuilt sources, which is a bit problematic, because we're still using the Xcode-provided _headers_.

As a concrete example, using Xcode's Clang is required by rust-lang#152013, as otherwise updating to Xcode 26 headers fails with an obscure `fatal error: 'net/route.h' file not found`, see [this build log](rust-lang#152013 (comment)). I suspect this is because building the new headers isn't officially supported with the older LLVM/Clang 15.

This PR removes that functionality, so that we instead always build with the Xcode-provided Clang. This is effectively the same as setting `USE_XCODE_CLANG=1` on `dist-apple-various` as well, but I thought I'd clean things up while I'm at it.

I didn't find the reason why we did this in first place, maybe because the Xcode Clang at the time was too out of date to build LLVM? It doesn't seem to be a problem anymore though.

r? t-infra
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 6, 2026
…shepmaster

Always use Xcode-provided Clang in macOS CI

Most of our macOS CI runners use the Xcode-provided Clang. `dist-apple-various` still downloads Clang from LLVM's prebuilt sources, which is a bit problematic, because we're still using the Xcode-provided _headers_.

As a concrete example, using Xcode's Clang is required by rust-lang#152013, as otherwise updating to Xcode 26 headers fails with an obscure `fatal error: 'net/route.h' file not found`, see [this build log](rust-lang#152013 (comment)). I suspect this is because building the new headers isn't officially supported with the older LLVM/Clang 15.

This PR removes that functionality, so that we instead always build with the Xcode-provided Clang. This is effectively the same as setting `USE_XCODE_CLANG=1` on `dist-apple-various` as well, but I thought I'd clean things up while I'm at it.

I didn't find the reason why we did this in first place, maybe because the Xcode Clang at the time was too out of date to build LLVM? It doesn't seem to be a problem anymore though.

r? t-infra
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 6, 2026
…shepmaster

Always use Xcode-provided Clang in macOS CI

Most of our macOS CI runners use the Xcode-provided Clang. `dist-apple-various` still downloads Clang from LLVM's prebuilt sources, which is a bit problematic, because we're still using the Xcode-provided _headers_.

As a concrete example, using Xcode's Clang is required by rust-lang#152013, as otherwise updating to Xcode 26 headers fails with an obscure `fatal error: 'net/route.h' file not found`, see [this build log](rust-lang#152013 (comment)). I suspect this is because building the new headers isn't officially supported with the older LLVM/Clang 15.

This PR removes that functionality, so that we instead always build with the Xcode-provided Clang. This is effectively the same as setting `USE_XCODE_CLANG=1` on `dist-apple-various` as well, but I thought I'd clean things up while I'm at it.

I didn't find the reason why we did this in first place, maybe because the Xcode Clang at the time was too out of date to build LLVM? It doesn't seem to be a problem anymore though.

r? t-infra
rust-bors bot pushed a commit that referenced this pull request Feb 6, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #151590 (cmse: don't use `BackendRepr` when checking return type)
 - #151945 (feat: Add `NonZero::<T>::from_str_radix`)
 - #152000 (Fix ICE in normalizing inherent associated consts with `#[type_const]`)
 - #152192 (Always use Xcode-provided Clang in macOS CI)
 - #152196 (bootstrap: Remove `ShouldRun::paths`)
 - #152222 (Re-add TaKO8Ki to triagebot review queue)
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 A-testsuite Area: The testsuite used to check the correctness of rustc O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) O-macos Operating system: macOS S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants