-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
OUT_DIR
variable not set
#3368
Comments
I can reproduce this with "cargo install ripgrep" using a cargo built from latest cargo git. Debugging... |
Looks like commit 41579ba caused this issue. |
This breaks building servo/rust-bindgen as well. |
cargo even has failing test for me with the same symptoms: http://paste.fedoraproject.org/500936/48110771/ Can't build ripgrep too. |
I’ve managed to build bindgen by replacing |
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. |
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. |
The errors were caused by the missing env $OUT_DIR which should be set by cargo, see [here](rust-lang/cargo#3368).
The errors were caused by the missing env $OUT_DIR which should be set by cargo. [Related issue](rust-lang/cargo#3368).
Ah this is definitely an accidental regression! Yes I'm kinda surprised that |
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. |
@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 |
Yes my only worry is if crates can't be updated. Crates can use |
Can crater be used to find out what on crates.io is broken by this change? |
@SimonSapin I believe so, yes, we should see it in the next crater run (as soon as it's working) |
Caused by rust-lang/cargo#3368. See rust-lang/cargo#3368 (comment) for more information.
The env! method pulls the variable at *compile time* as opposed to runtime. This can cause breakage in scenarios with cross compilation, for example. Currently there's also a pending change to Cargo on the beta release of Rust which breaks the usage of env! (rust-lang/cargo#3368). We may roll that change back, but I figured it'd be good to head off future breakage anyway!
The env! method pulls the variable at *compile time* as opposed to runtime. This can cause breakage in scenarios with cross compilation, for example. Currently there's also a pending change to Cargo on the beta release of Rust which breaks the usage of env! (rust-lang/cargo#3368). We may roll that change back, but I figured it'd be good to head off future breakage anyway!
The env! method pulls the variable at *compile time* as opposed to runtime. This can cause breakage in scenarios with cross compilation, for example. Currently there's also a pending change to Cargo on the beta release of Rust which breaks the usage of env! (rust-lang/cargo#3368). We may roll that change back, but I figured it'd be good to head off future breakage anyway!
gazetta-bin-0.1.6 hits this. |
The env! method pulls the variable at *compile time* as opposed to runtime. This can cause breakage in scenarios with cross compilation, for example. Currently there's also a pending change to Cargo on the beta release of Rust which breaks the usage of env! (rust-lang/cargo#3368). We may roll that change back, but I figured it'd be good to head off future breakage anyway!
PR sent as Stebalien/gazetta-bin#1 |
pinyin-0.0.5 hits this. (Edit: oh you've fixed pinyin) |
zip_codes-0.0.1 is affected cc @SkylerLipthay |
Alex fixed this with SkylerLipthay/zip_codes#2, which has been merged! |
Affects rasen-0.1.0 https://tools.taskcluster.net/task-inspector/#_6XeY7pIRjKvuBDVVuFMFQ/0 |
Great @SkylerLipthay! Sorry for the inconvenience. |
@brson I think pinyin and rasen were both addressed here -- rust-lang/rust#38391 (comment) |
lmdb-rs 0.7.3's test suite is affected. cc @vhbit |
Caused by rust-lang/cargo#3368. Now the method for determining path for DB tests is exact copy from `cargo`.
@brson looks like that was fixed by vhbit/lmdb-rs@25c1fdc |
Ok we've decided to close this as working as intended, but if any projects need help migrating please just let me know! |
@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 |
@abonander maybe the version of Cargo there is too old to recognize the implicit build script via |
@alexcrichton Good call! The issue reporter was running a Docker container with a super-outdated Cargo. |
Some Travis jobs are not compiling due to
OUT_DIR
not 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
The text was updated successfully, but these errors were encountered: