Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing going through my head is the question: "what principle governs us exposing the manifest as environment variables?".
For myself, exposing
CARGO_PKG_RUST_VERSION
feels very arbitrary from a cargo-design perspective. Why this field and not many of the others?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many of the other fields are already exposed. Like the
version
field is even exposed through 4 or 5 env vars. Most package metadata is exposed. I think this makes it more consistent.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also see #8758 where CARGO_PRIMARY_PACKAGE was added "primarily for Clippy".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for CARGO_PRIMARY_PACKAGE , those all look targeted at the code being built, either so a crate can access its own metadata or build.rs / test purposes.
Thanks for pointing out precedence on this. I am still interested in seeing if there is an answer to my question or if there is interest in creating an answer to my question. Until that time, I am not comfortable merging this though maybe others of the cargo team would be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with waiting on other team members. Just wanted to bring this up through a PR again, because my question some time ago on Zulip didn't get any replies 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(People regularly want Rust compiler version information, so I want to make sure people don't think this is the thing they're looking for for that.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this in the cargo team meeting and we have no guiding principle on what env variables should exist and are intending to be responsive to what different teams needs are. I'm fine merging this after the documentation gets improved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised we don't link any of these fields to their manifest field's documentation. That would also be a natural way to clarify what this is intending to contain