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

docs(env): minor improvements in environment variables doc #14676

Merged
merged 2 commits into from
Oct 12, 2024

Conversation

weihanglo
Copy link
Member

What does this PR try to resolve?

Minor improvements in environment variables doc.

Fixes #10956
Fixes #13294

How should we test and review this PR?

Additional information

@rustbot
Copy link
Collaborator

rustbot commented Oct 11, 2024

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2024
@weihanglo weihanglo changed the title docs(env): clarify unavailable cfg values for build scripts docs(env): minor improvements in environment variables doc Oct 11, 2024
@weihanglo weihanglo added the A-environment-variables Area: environment variables label Oct 11, 2024
compiling the package (not when running binaries or tests).
on the current directory and the default workspace members.
This variable will not be set when building dependencies,
unless a dependency is also a workspace member.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned that this statement isn't entirely true. In many (most?) cases, it won't be set for workspace member dependencies. For example in cargo's own workspace, it won't be set for any of its dependencies when doing cargo run.

I think to make this more accurate, perhaps change it to something like this?

Suggested change
unless a dependency is also a workspace member.
unless a dependency is also a workspace member that was also selected on the command-line.

However, as noted in the issue, what is "selected on the command-line" is sometimes not intuitive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to highlight that there is a bug in how cargo cache's this behavior, which is described in #14678. I don't think that needs to change anything here, but indicates that the answer to when it is set is "buggy".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. That is more accurate. Updated!

I think one of the problems here is that the paragraph wasn't well arranged. There is no paragraph or newline there. We may really need to give each variable a heading.

@ehuss
Copy link
Contributor

ehuss commented Oct 12, 2024

Thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 12, 2024

📌 Commit ffca7be has been approved by ehuss

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 12, 2024
@bors
Copy link
Collaborator

bors commented Oct 12, 2024

⌛ Testing commit ffca7be with merge 2c4cf1d...

@bors
Copy link
Collaborator

bors commented Oct 12, 2024

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 2c4cf1d to master...

@bors bors merged commit 2c4cf1d into rust-lang:master Oct 12, 2024
22 checks passed
@weihanglo weihanglo deleted the env-doc branch October 12, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation A-environment-variables Area: environment variables S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
4 participants