Skip to content

Commit e306f83

Browse files
authored
Don't overwrite env for cargo-metadata call (#285)
In some cases(eg. if RUST_TOOLCHAIN is set and cargo is managed by rustup) cargo metadata will behave incorrectly if some environment variables are removed
1 parent c911900 commit e306f83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/workspace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class Workspace {
1515
const meta: Meta = JSON.parse(
1616
await getCmdOutput("cargo", ["metadata", "--all-features", "--format-version", "1", ...extraArgs], {
1717
cwd: this.root,
18-
env: { "CARGO_ENCODED_RUSTFLAGS": "" },
18+
env: { ...process.env, "CARGO_ENCODED_RUSTFLAGS": "" },
1919
}),
2020
);
2121
core.debug(`workspace "${this.root}" has ${meta.packages.length} packages`);

0 commit comments

Comments
 (0)