-
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
DEP_*
environment variable documentation not clear
#7846
Comments
The build script chapter has been largely reworked, which I think should go live tomorrow with the new release. https://doc.rust-lang.org/beta/cargo/reference/build-scripts.html Perhaps you can take a look and see if it makes it clearer that it is As for passing more information, I think that is covered by #3544? |
The new docs say #3544 does appear to track the feature I want! |
Would be happy to have a PR that clarifies whichever parts are not clear. |
On https://doc.rust-lang.org/cargo/reference/build-scripts.html
On https://doc.rust-lang.org/cargo/reference/environment-variables.html
For me, the current docs seem clear. We'd welcome input on further improvement but I'm going to go ahead and close this as resolved as its easy to always be moving the fence posts on improvements. |
Problem
https://doc.rust-lang.org/cargo/reference/build-scripts.html says:
This implies to me that
DEP_*
variables will always be set if they are emitted by a dependent crate.But if you read the linked https://doc.rust-lang.org/cargo/reference/build-scripts.html#the-links-manifest-key it starts to mention association with the
links
manifest key. It doesn't say so explicitly, but experimentation reveals thelinks
key is required in order forDEP_*
variables to be set on the dependent crate.Possible Solution(s)
Clarify documentation that
links
is necessary to makeDEP_*
appear.Even better would be to always set the
DEP_*
environment variables. Cargo seems to lack a generic way to pass metadata between crate build scripts outside of library/linkage info. I frequently find myself wanting this feature for indygreg/PyOxidizer, which is doing some wonky things in build scripts. It would be immensely useful if state could be passed between dependencies via environment variables. I'm sure there is already a feature request for that somewhere though...Notes
Output of
cargo version
:1.40.0
The text was updated successfully, but these errors were encountered: