Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow unsetting environment variables #1263

Closed
nickbabcock opened this issue Jul 8, 2022 · 2 comments
Closed

Allow unsetting environment variables #1263

nickbabcock opened this issue Jul 8, 2022 · 2 comments

Comments

@nickbabcock
Copy link

Just has support for setting environment variables:

export RUST_BACKTRACE := "1"

test:
    cargo test

But does not support unsetting environment variables

unset RUST_BACKTRACE

test:
    cargo test

In the ideal scenario, the environment variable has an equivalent value to being unset (0 in the case for RUST_BACKTRACE)

Unfortunately, some programs, crates, and/or libraries treat an unset environment variable different than even an empty string, so it would be helpful to be able to unset these at the global level instead of remembering to sprinkle in the manual method everywhere:

test:
    #!/bin/bash -x
    unset RUST_BACKTRACE
    cargo test
@nickbabcock nickbabcock changed the title Allow unset environment variables Allow unsetting environment variables Jul 8, 2022
@casey
Copy link
Owner

casey commented Jul 9, 2022

This definitely seems useful, and the unset FOO seems reasonable. The best way to implement this is probably with a new Item variant, Item::Unset(String), which causes exported variables to be unset.

@neunenak
Copy link
Contributor

Should be closeable now with #2098

@casey casey closed this as completed Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants