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

DEBUG env var in build.rs is incorrect if profile debug=0 #5370

Closed
ehuss opened this issue Apr 16, 2018 · 1 comment · Fixed by #5448
Closed

DEBUG env var in build.rs is incorrect if profile debug=0 #5370

ehuss opened this issue Apr 16, 2018 · 1 comment · Fixed by #5448

Comments

@ehuss
Copy link
Contributor

ehuss commented Apr 16, 2018

The DEBUG environment variable set for a build script currently gets set to true if you have a profile with debug=0. AFAIK, rustc treats debug=0 the same as no debug, so I think it should be false.

Repro:

cargo new --lib a
cd a
cat >> Cargo.toml <<EOL
[profile.dev]
debug = 0
EOL
cat > build.rs <<EOL
fn main() { println!("DEBUG={}", std::env::var("DEBUG").unwrap()); }
EOL
cargo build -vv

I can fix this if you'd like.

@alexcrichton
Copy link
Member

Ah yes thanks this'd be good to fix!

ehuss added a commit to ehuss/cargo that referenced this issue Apr 30, 2018
bors added a commit that referenced this issue May 1, 2018
Fix "DEBUG" env var in build.rs for debug=0

Fixes #5370
@bors bors closed this as completed in #5448 May 1, 2018
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

Successfully merging a pull request may close this issue.

2 participants