Skip to content

Commit

Permalink
refactor: Improve cargo prove build reproducibility (#151)
Browse files Browse the repository at this point in the history
- Added a '-Ztrim-paths' argument to the 'cargo_args' vector.
- Added a provisional solution to enable 'trim-paths', linking the associated Rust issue for context.

Fixes argumentcomputer/zk-light-clients#40
  • Loading branch information
huitseeker authored Aug 16, 2024
1 parent 767f9b3 commit ba8a1c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ pub(crate) fn build_program(args: &BuildArgs) -> Result<Utf8PathBuf> {
if args.ignore_rust_version {
cargo_args.push("--ignore-rust-version");
}
cargo_args.push("-Ztrim-paths");

let result = Command::new("cargo")
.env("RUSTUP_TOOLCHAIN", "succinct")
.env("CARGO_ENCODED_RUSTFLAGS", rust_flags.join("\x1f"))
// TODO: remove once trim-paths is supported - https://github.com/rust-lang/rust/issues/111540
.env("RUSTC_BOOTSTRAP", "1") // allows trim-paths.
.args(&cargo_args)
.status()
.context("Failed to run cargo command.")?;
Expand Down

0 comments on commit ba8a1c0

Please sign in to comment.