Build rustc from source offline

⚓ Rust    📅 2025-08-19    👤 surdeus    👁️ 5      

surdeus

Hi guys,

I have to build rustc from source with a custom llvm. I am using the ./x dist command for that. All is fine on an internet connected machine. When I try to do this offline I am running into trouble.
I updated the bootstrap.toml file to support vendor = true (I ran ./x vendor on the sources beforehand) but it fails with building bootstrap: error: failed to load source for dependency rust_team_data

I did create a .cargo/config.toml with the following contents:

[source.crates-io]
replace-with = "vendored-sources"

[source."https://github.com/rust-lang/team"]
git = "https://github.com/rust-lang/team"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"

but this does not seem to help with building bootstrap (it looks for a vendor directory one level up from the rust sources and not the vendor dir inside the rust sources. Not sure what the problem is. I am doing this on rust 1.89.0. Thanks a lot!

Cheers,
Cosmin

1 post - 1 participant

Read full topic

🏷️ Rust_feed