Skip to content

Build TPDE with local Clang when available - #165275

Open
TechnoPorg wants to merge 2 commits into
rust-lang:mainfrom
TechnoPorg:push-wrpxssqqoxqw
Open

TechnoPorg wants to merge 2 commits into
rust-lang:mainfrom
TechnoPorg:push-wrpxssqqoxqw

Conversation

@TechnoPorg

Copy link
Copy Markdown
Contributor

As noted in #164108 (review), TPDE requires a clang with a major version <= the LLVM major version, and performance tends to be better when built with clang. This PR makes TPDE compilation and encodegen use the locally built clang if it's available.

I haven't added any sort of warning if llvm.clang is not set as TPDE will throw its own error if the major version is too high. Maybe it's worth doing so, though?

This also includes the TPDE compilation fix commit from #164108. We will see which ones makes it in first.

r? @ZuseZ4

@rustbot

rustbot commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 1, 2026
@ZuseZ4

ZuseZ4 commented Nov 3, 2026

Copy link
Copy Markdown
Member

I don't think we need to add a warning this time. Clang isn't free to build, and there are legitimate setups where people have a suitable clang available externally and set the paths correctly. If someone's already using a new bootstrap feature like tpde, they'll hopefully read the docs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants