Skip to content

Commit

Permalink
cli: Add cargo args handling to verifiable builds (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-schaaf authored Nov 18, 2021
1 parent 7a7db5b commit 11764a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ docs/yarn.lock
ts/docs/
cli/npm-package/anchor
cli/npm-package/*.tgz
docker-target
6 changes: 5 additions & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ fn build_cwd(
};
match verifiable {
false => _build_cwd(cfg, idl_out, idl_ts_out, cargo_args),
true => build_cwd_verifiable(cfg, cargo_toml, solana_version, stdout, stderr),
true => build_cwd_verifiable(cfg, cargo_toml, solana_version, stdout, stderr, cargo_args),
}
}

Expand All @@ -689,6 +689,7 @@ fn build_cwd_verifiable(
solana_version: Option<String>,
stdout: Option<File>,
stderr: Option<File>,
cargo_args: Vec<String>,
) -> Result<()> {
// Create output dirs.
let workspace_dir = cfg.path().parent().unwrap().canonicalize()?;
Expand All @@ -709,6 +710,7 @@ fn build_cwd_verifiable(
solana_version,
stdout,
stderr,
cargo_args,
);

// Wipe the generated docker-target dir.
Expand Down Expand Up @@ -778,6 +780,7 @@ fn docker_build(
solana_version: Option<String>,
stdout: Option<File>,
stderr: Option<File>,
cargo_args: Vec<String>,
) -> Result<()> {
let binary_name = Manifest::from_path(&cargo_toml)?.lib_name()?;

Expand Down Expand Up @@ -881,6 +884,7 @@ fn docker_build(
"--manifest-path",
&manifest_path.display().to_string(),
])
.args(cargo_args)
.stdout(match stdout {
None => Stdio::inherit(),
Some(f) => f.into(),
Expand Down

0 comments on commit 11764a1

Please sign in to comment.