diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..33342ff82 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,12 @@ +# Guest-only build flags: the key is scoped to the guest target, so host builds +# read this file and take nothing from it. Cargo joins `rustflags` across +# ancestor configs, so each guest crate keeps its own flags and gains this one. +[target.riscv64im-lambda-vm-elf] +# `compiler_builtins` turns `mem-unaligned` on for x86, aarch64 and bpf only, so +# on RISC-V `memcpy`/`memmove` reassemble every misaligned word by hand; this VM +# does unaligned scalar accesses natively (#864). The cfg reaches every crate in +# the guest graph, but only `compiler-builtins` reads that name, and it declares +# the value in its own check-cfg. It lives in that crate's `build.rs` with no +# stability guarantee: bumping the `nightly-2026-02-01` pin in the Makefile can +# turn this into a silent no-op. +rustflags = ["--cfg", "feature=\"mem-unaligned\""] diff --git a/.github/workflows/hyperfine.yaml b/.github/workflows/hyperfine.yaml index b52241fc2..70f99e1d2 100644 --- a/.github/workflows/hyperfine.yaml +++ b/.github/workflows/hyperfine.yaml @@ -40,7 +40,7 @@ jobs: id: cache with: path: ${{ matrix.branch }}_programs/*.elf - key: benchmarks-${{ matrix.branch }}-${{ hashFiles( 'executor/programs/bench/**', 'syscalls/**' ) }} + key: benchmarks-${{ matrix.branch }}-${{ hashFiles( 'executor/programs/bench/**', 'syscalls/**', '.cargo/config.toml' ) }} restore-keys: benchmarks-${{ matrix.branch }}- - name: Setup Rust Environment @@ -56,7 +56,7 @@ jobs: - name: Export benchmark hashes id: export-hashes - run: echo "benchmark-hashes-${{ matrix.branch }}=${{ hashFiles( 'executor/programs/bench/**', 'syscalls/**' ) }}" >> "$GITHUB_OUTPUT" + run: echo "benchmark-hashes-${{ matrix.branch }}=${{ hashFiles( 'executor/programs/bench/**', 'syscalls/**', '.cargo/config.toml' ) }}" >> "$GITHUB_OUTPUT" build-binaries: strategy: diff --git a/.github/workflows/pr_main.yaml b/.github/workflows/pr_main.yaml index 89bff2b03..7fa77ba22 100644 --- a/.github/workflows/pr_main.yaml +++ b/.github/workflows/pr_main.yaml @@ -103,7 +103,7 @@ jobs: path: | executor/program_artifacts/rust executor/shared_target - key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }} + key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile', '.cargo/config.toml') }} restore-keys: | rust-elf-artifacts- @@ -275,7 +275,7 @@ jobs: path: | executor/program_artifacts/rust executor/shared_target - key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }} + key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile', '.cargo/config.toml') }} restore-keys: | rust-elf-artifacts- @@ -391,7 +391,7 @@ jobs: path: | executor/program_artifacts/rust executor/shared_target - key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }} + key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile', '.cargo/config.toml') }} restore-keys: | rust-elf-artifacts- @@ -409,7 +409,7 @@ jobs: uses: actions/cache@v4 with: path: executor/program_artifacts/recursion - key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile') }} + key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile', '.cargo/config.toml') }} restore-keys: | recursion-elf-artifacts- @@ -480,7 +480,7 @@ jobs: path: | executor/program_artifacts/rust executor/shared_target - key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }} + key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile', '.cargo/config.toml') }} restore-keys: | rust-elf-artifacts- @@ -508,7 +508,7 @@ jobs: uses: actions/cache@v4 with: path: executor/program_artifacts/recursion - key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile') }} + key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile', '.cargo/config.toml') }} restore-keys: | recursion-elf-artifacts- @@ -564,7 +564,7 @@ jobs: path: | executor/program_artifacts/rust executor/shared_target - key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }} + key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile', '.cargo/config.toml') }} restore-keys: | rust-elf-artifacts- @@ -581,7 +581,7 @@ jobs: uses: actions/cache@v4 with: path: executor/program_artifacts/recursion - key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile') }} + key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile', '.cargo/config.toml') }} restore-keys: | recursion-elf-artifacts-