Skip to content

Commit e016c03

Browse files
committed
Make Cargo actually load the config file; it doesn't load the associated config when just passing Cargo.toml path
1 parent 38228c3 commit e016c03

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

  • cargo-auditable/tests

cargo-auditable/tests/it.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,15 +592,22 @@ fn test_bare_linker() {
592592
test_bare_linker_inner(true);
593593
}
594594
fn test_bare_linker_inner(sbom: bool) {
595-
// Path to workspace fixture Cargo.toml. See that file for overview of workspace members and their dependencies.
596-
let workspace_cargo_toml =
595+
// Path to workspace fixture Cargo.toml
596+
let cargo_toml =
597597
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/bare_linker/Cargo.toml");
598-
599598
// The motivating example is https://github.com/EFForg/rayhunter/blob/main/.cargo/config.toml
599+
// and the config file fixture is based on that.
600600
// There doesn't seem to be a way to build with a bare linker for GNU targets, only Apple and Musl,
601601
// so this tests really only does anything on those.
602+
let config_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
603+
.join("tests/fixtures/bare_linker/.cargo/config.toml");
602604

603-
let bins = run_cargo_auditable(workspace_cargo_toml, &[], &[], sbom);
605+
let bins = run_cargo_auditable(
606+
cargo_toml,
607+
&["--config", config_path.to_str().unwrap()],
608+
&[],
609+
sbom,
610+
);
604611
eprintln!("Test fixture binary map: {bins:?}");
605612

606613
// bare_linker should only depend on itself

0 commit comments

Comments
 (0)