Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up`OUT_DIR` variable not set #3368
Comments
This comment has been minimized.
This comment has been minimized.
|
I can reproduce this with "cargo install ripgrep" using a cargo built from latest cargo git. Debugging... |
joshtriplett
referenced this issue
Dec 5, 2016
Merged
cargo fails if it can't find optional dependencies, even if corresponding feature not enabled #3369
This comment has been minimized.
This comment has been minimized.
|
Looks like commit 41579ba caused this issue. |
This comment has been minimized.
This comment has been minimized.
|
This breaks building servo/rust-bindgen as well. |
This comment has been minimized.
This comment has been minimized.
|
cargo even has failing test for me with the same symptoms: http://paste.fedoraproject.org/500936/48110771/ Can't build ripgrep too. |
This comment has been minimized.
This comment has been minimized.
|
I’ve managed to build bindgen by replacing |
This comment has been minimized.
This comment has been minimized.
|
Still, it looks like this is a breaking change. So Cargo should probably revert to providing these variables when compiling a build script. At least for a while, with a warning that this will change. |
This comment has been minimized.
This comment has been minimized.
|
It looks like commit 95193ca clarified the documentation to state that Cargo doesn't set these environment variables when building the build script, only when running it, even though Cargo did actually set them when building the build script as well. A later commit in Cargo then made the behavior match the documentation. This does indeed represent a breaking change from the existing behavior, and existing build.rs scripts relied on the existing behavior. |
knight42
added a commit
to uutils/coreutils
that referenced
this issue
Dec 8, 2016
knight42
added a commit
to uutils/coreutils
that referenced
this issue
Dec 8, 2016
This comment has been minimized.
This comment has been minimized.
|
Ah this is definitely an accidental regression! Yes I'm kinda surprised that |
This comment has been minimized.
This comment has been minimized.
|
Well... so this was a "regression" but also a bug fix at the same time. The To those hitting this issue, could you confirm that the crate hasn't been used for cross compiles? And perhaps if it has have weird issues arisen? We could add a fix for this but I'm tempted to avoid doing so if we can (as it's "incorrect" to rely on the old behavior). If it's possible to fixup the packages in question quickly that'd be best, but if there's ongoing pain then I can change Cargo back to the previous behavior. |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton I've seen various crates get fixed for this change (which, at a minimum, needs documentation in release notes). It'd be good to be able to build existing packages with new Cargo. For the most part, Cargo has maintained backward compatibility across many versions. On the other hand, I do agree that crates shouldn't rely on the old behavior, and it would indeed have broken cross-compiles. I don't see an obvious way to work-but-warn in this case, without awful hacks (such as somehow substituting in a version of |
This comment has been minimized.
This comment has been minimized.
|
Yes my only worry is if crates can't be updated. Crates can use |
This comment has been minimized.
This comment has been minimized.
|
Can crater be used to find out what on crates.io is broken by this change? |
This comment has been minimized.
This comment has been minimized.
|
@SimonSapin I believe so, yes, we should see it in the next crater run (as soon as it's working) |
brson
referenced this issue
Dec 15, 2016
Closed
rust 1.15 regression in cargo CARGO_OUT handling #38391
brendanzab
referenced this issue
Dec 18, 2016
Closed
Never assume that the kind of a type variable is ‘type’ #227
brendanzab
added a commit
to brendanzab/gluon
that referenced
this issue
Dec 18, 2016
brendanzab
referenced this issue
Dec 18, 2016
Merged
Fix build failure due to missing environment var #228
alexcrichton
added a commit
to alexcrichton/rust-pinyin
that referenced
this issue
Dec 28, 2016
alexcrichton
referenced this issue
Dec 28, 2016
Merged
Use env::var_os intead of env! in build script #5
alexcrichton
added a commit
to alexcrichton/rust-pinyin
that referenced
this issue
Dec 28, 2016
alexcrichton
added a commit
to alexcrichton/zip_codes
that referenced
this issue
Dec 28, 2016
alexcrichton
referenced this issue
Dec 28, 2016
Merged
Use env::var_os intead of env! in build script #2
This comment has been minimized.
This comment has been minimized.
|
gazetta-bin-0.1.6 hits this. |
alexcrichton
added a commit
to alexcrichton/gazetta-bin
that referenced
this issue
Dec 29, 2016
alexcrichton
referenced this issue
Dec 29, 2016
Merged
Use env::var intead of env! in build script #1
This comment has been minimized.
This comment has been minimized.
|
PR sent as Stebalien/gazetta-bin#1 |
This comment has been minimized.
This comment has been minimized.
|
pinyin-0.0.5 hits this. (Edit: oh you've fixed pinyin) |
brson
referenced this issue
Dec 30, 2016
Closed
Regression in wait-timeout-0.1.13 test suite in Rust 1.15 #38721
This comment has been minimized.
This comment has been minimized.
|
zip_codes-0.0.1 is affected cc @SkylerLipthay |
brson
referenced this issue
Dec 30, 2016
Closed
Regression in cargo-check 0.2.2 test suite in Rust 1.15 #38722
This comment has been minimized.
This comment has been minimized.
SkylerLipthay
commented
Dec 31, 2016
|
Alex fixed this with SkylerLipthay/zip_codes#2, which has been merged! |
This comment has been minimized.
This comment has been minimized.
|
Affects rasen-0.1.0 https://tools.taskcluster.net/task-inspector/#_6XeY7pIRjKvuBDVVuFMFQ/0 |
This comment has been minimized.
This comment has been minimized.
|
Great @SkylerLipthay! Sorry for the inconvenience. |
This comment has been minimized.
This comment has been minimized.
|
@brson I think pinyin and rasen were both addressed here -- rust-lang/rust#38391 (comment) |
This comment has been minimized.
This comment has been minimized.
|
lmdb-rs 0.7.3's test suite is affected. cc @vhbit |
vhbit
added a commit
to vhbit/lmdb-rs
that referenced
this issue
Jan 5, 2017
This comment has been minimized.
This comment has been minimized.
|
@brson looks like that was fixed by vhbit/lmdb-rs@25c1fdc |
mbrubeck
referenced this issue
Jan 12, 2017
Closed
Regression in vk_generator 0.2.1, Rust 1.15 #38974
This comment has been minimized.
This comment has been minimized.
|
Ok we've decided to close this as working as intended, but if any projects need help migrating please just let me know! |
alexcrichton
closed this
Jan 12, 2017
pka
referenced this issue
Mar 11, 2018
Closed
Build fails with environment variable `OUT_DIR` not defined #33
This comment has been minimized.
This comment has been minimized.
abonander
commented
Mar 12, 2018
•
|
@alexcrichton The story isn't over, however: abonander/mime_guess#33 This invocation is at the build time of the crate: https://github.com/abonander/mime_guess/blob/master/src/lib.rs#L16 When |
This comment has been minimized.
This comment has been minimized.
|
@abonander maybe the version of Cargo there is too old to recognize the implicit build script via |
This comment has been minimized.
This comment has been minimized.
abonander
commented
Mar 12, 2018
|
@alexcrichton Good call! The issue reporter was running a Docker container with a super-outdated Cargo. |
Razican commentedDec 4, 2016
Some Travis jobs are not compiling due to
OUT_DIRnot being present on nightly on my build.rs script. Is this an expected behaviour? how could it be fixed?Example failure: https://travis-ci.org/SUPERAndroidAnalyzer/super/jobs/181113222#L146