3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-11-24 16:21:31 +00:00

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
This commit is contained in:
MaeIsBad 2025-11-18 21:02:38 +01:00 committed by GitHub
parent c9119007a1
commit e306f83d21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,7 +15,7 @@ export class Workspace {
const meta: Meta = JSON.parse(
await getCmdOutput("cargo", ["metadata", "--all-features", "--format-version", "1", ...extraArgs], {
cwd: this.root,
env: { "CARGO_ENCODED_RUSTFLAGS": "" },
env: { ...process.env, "CARGO_ENCODED_RUSTFLAGS": "" },
}),
);
core.debug(`workspace "${this.root}" has ${meta.packages.length} packages`);