Skip to content

rust-script exports CARGO_TARGET_DIR to script process #27

@soenkehahn

Description

@soenkehahn

I have a rust-script that calls cargo install --path . as a child process. I expected that process to create a target directory, but that didn't happen. IIUC, this is because rust-script sets CARGO_TARGET_DIR to ~/.cache/rust-script/binaries. It also seems to set a bunch of other cargo related environment variables.

I think this is a bug, since cargo commands from within a rust-script should work the same way as they would if executed from outside of a rust-script. I would expect rust-script to not modify the environment of the script process in any way. (Except maybe for some variables prefixed with RUST_SCRIPT_ for some reason.) Or is this somehow necessary to make rust-script work?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions