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

fix: rust 1.81 toolchain build issue #1534

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/cli/src/commands/build_toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,24 @@ impl BuildToolchainCmd {
std::fs::write(&config_file, config_toml)
.with_context(|| format!("while writing configuration to {:?}", config_file))?;

// Work around target sanity check added in rust-lang/rust@09c076810cb7649e5817f316215010d49e78e8d7.
let temp_dir = std::env::temp_dir().join("rustc-targets");
if !temp_dir.exists() {
std::fs::create_dir_all(&temp_dir)?;
}
std::fs::File::create(temp_dir.join("riscv32im-succinct-zkvm-elf.json"))?;

// Build the toolchain (stage 1).
Command::new("python3")
.env("RUST_TARGET_PATH", &temp_dir)
.env("CARGO_TARGET_RISCV32IM_SUCCINCT_ZKVM_ELF_RUSTFLAGS", "-Cpasses=loweratomic")
.args(["x.py", "build"])
.current_dir(&rust_dir)
.run()?;

// Build the toolchain (stage 2).
Command::new("python3")
.env("RUST_TARGET_PATH", &temp_dir)
.env("CARGO_TARGET_RISCV32IM_SUCCINCT_ZKVM_ELF_RUSTFLAGS", "-Cpasses=loweratomic")
.args(["x.py", "build", "--stage", "2"])
.current_dir(&rust_dir)
Expand Down
Loading