Skip to content

Commit

Permalink
chore: fix the guest compiler's rust toolchain version (#936)
Browse files Browse the repository at this point in the history
* chore: fix the guest compiler's rust toolchain version

We must use nightly for -Z but we fix a nightly version for stability.

* chore: fix CI
  • Loading branch information
jonathanpwang authored Dec 4, 2024
1 parent ec4adb6 commit 138157b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmark-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ jobs:
arch=$(uname -m)
case $arch in
arm64|aarch64)
rustup component add rust-src --toolchain nightly-aarch64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-10-30-aarch64-unknown-linux-gnu
S5CMD_BIN="s5cmd_2.2.2_linux_arm64.deb"
;;
x86_64|amd64)
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-10-30-x86_64-unknown-linux-gnu
S5CMD_BIN="s5cmd_2.2.2_linux_amd64.deb"
;;
*)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ecc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ jobs:
- name: Run ecc-circuits crate tests
working-directory: extensions/ecc/circuit
run: |
cargo nextest run --cargo-profile=fast
cargo nextest run --cargo-profile=fast
- name: Run pairing-circuits crate tests
working-directory: extensions/pairing/circuit
run: |
RUST_MIN_STACK=8388608 cargo nextest run --cargo-profile=fast
RUST_MIN_STACK=8388608 cargo nextest run --cargo-profile=fast
- name: Install cargo-axiom
working-directory: crates/cargo-axiom
run: |
rustup component add rust-src --toolchain nightly-aarch64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-10-30-aarch64-unknown-linux-gnu
cargo install --force --locked --path .
- name: Build axvm-ecc-guest crate for axvm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/riscv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ jobs:
- name: Run RISC-V test vector tests
working-directory: crates/toolchain/tests
run: |
rustup component add rust-src --toolchain nightly-aarch64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-10-30-aarch64-unknown-linux-gnu
cargo nextest run --cargo-profile=fast --run-ignored only -- test_rv32im_riscv_vector_runtime
4 changes: 2 additions & 2 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:
- name: Run transpiler tests
working-directory: crates/toolchain/transpiler
run: |
rustup component add rust-src --toolchain nightly-aarch64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-10-30-aarch64-unknown-linux-gnu
cargo nextest run --cargo-profile=fast
- name: Run toolchain tests
working-directory: crates/toolchain/tests
run: |
rustup component add rust-src --toolchain nightly-aarch64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-10-30-aarch64-unknown-linux-gnu
cargo nextest run --cargo-profile=fast
2 changes: 1 addition & 1 deletion crates/cargo-axiom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::process::{Command, Stdio};

use eyre::{Context, Result};

pub const RUSTUP_TOOLCHAIN_NAME: &str = "nightly";
pub const RUSTUP_TOOLCHAIN_NAME: &str = "nightly-2024-10-30";

pub const AXVM_VERSION_MESSAGE: &str = concat!(
"axvm",
Expand Down
11 changes: 8 additions & 3 deletions crates/toolchain/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub use self::config::{DockerOptions, GuestOptions};
mod config;

#[allow(dead_code)]
const RUSTUP_TOOLCHAIN_NAME: &str = "axiom";
const RUSTUP_TOOLCHAIN_NAME: &str = "nightly-2024-10-30";

/// Returns the given cargo Package from the metadata in the Cargo.toml manifest
/// within the provided `manifest_dir`.
Expand Down Expand Up @@ -136,7 +136,7 @@ fn sanitized_cmd(tool: &str) -> Command {
/// command in an environment suitable for targeting the zkvm guest.
pub fn cargo_command(subcmd: &str, rust_flags: &[&str]) -> Command {
let rustc = sanitized_cmd("rustup")
.args(["+nightly", "which", "rustc"]) // TODO: switch +nightly to +axiom
.args(["+nightly-2024-10-30", "which", "rustc"]) // TODO: switch +nightly to +axiom
.output()
.expect("rustup failed to find nightly toolchain")
.stdout;
Expand All @@ -147,7 +147,12 @@ pub fn cargo_command(subcmd: &str, rust_flags: &[&str]) -> Command {

let mut cmd = sanitized_cmd("cargo");
// TODO[jpw]: remove +nightly
let mut args = vec!["+nightly", subcmd, "--target", "riscv32im-risc0-zkvm-elf"];
let mut args = vec![
"+nightly-2024-10-30",
subcmd,
"--target",
"riscv32im-risc0-zkvm-elf",
];

if std::env::var("AXIOM_BUILD_LOCKED").is_ok() {
args.push("--locked");
Expand Down

0 comments on commit 138157b

Please sign in to comment.