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

feat: add CARGO_MANIFEST_PATH env variable #14404

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

Ifropc
Copy link
Contributor

@Ifropc Ifropc commented Aug 15, 2024

Adds CARGO_MANIFEST_PATH variable as part of #12207
Context: CARGO_MANIFEST_DIR is not very useful, because there is no Cargo.toml file when running a cargo script. In cases when multiple scripts are stored in the same folder, we can't tell which script exactly is being run using CARGO_MANIFEST_DIR

@rustbot
Copy link
Collaborator

rustbot commented Aug 15, 2024

r? @epage

rustbot has assigned @epage.
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-build-execution Area: anything dealing with executing the compiler A-build-scripts Area: build.rs scripts A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 15, 2024
@epage epage added the T-cargo Team: Cargo label Aug 15, 2024
@epage
Copy link
Contributor

epage commented Aug 15, 2024

@rfcbot merge

This PR insta-stabilizes CARGO_MANIFEST_PATH, a companion to CARGO_MANIFEST_DIR for when you actually want the manifest because CARGO_MANIFEST_DIR.join("Cargo.toml") will no longer be sufficient due to cargo-script.

@rfcbot
Copy link
Collaborator

rfcbot commented Aug 15, 2024

Team member @epage has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period An FCP proposal has started, but not yet signed off. disposition-merge FCP with intent to merge labels Aug 15, 2024
@Ifropc Ifropc force-pushed the cargo_manifest_path branch 3 times, most recently from 8083492 to 58a807f Compare August 15, 2024 19:31
@rfcbot rfcbot added final-comment-period FCP — a period for last comments before action is taken and removed proposed-final-comment-period An FCP proposal has started, but not yet signed off. labels Sep 24, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Sep 24, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

tests/testsuite/script.rs Outdated Show resolved Hide resolved
- Uses same checks as for already existing CARGO_MANIFEST_DIR
@weihanglo
Copy link
Member

Thanks for working with us! Glad to have you along!

I am going to merge this. This feature is not controversial at all, so no need to wait for the full 10-days FCP. Please speak up if you have any concern.

@bors r+

@bors
Copy link
Contributor

bors commented Sep 26, 2024

📌 Commit d4ac929 has been approved by weihanglo

It is now in the queue for this repository.

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

bors commented Sep 26, 2024

⌛ Testing commit d4ac929 with merge 7cbdcf0...

@bors
Copy link
Contributor

bors commented Sep 26, 2024

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing 7cbdcf0 to master...

@bors bors merged commit 7cbdcf0 into rust-lang:master Sep 26, 2024
22 checks passed
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 28, 2024
Update cargo

19 commits in eaee77dc1584be45949b75e4c4c9a841605e3a4b..80d82ca22abbee5fb7b51fa1abeb1ae34e99e88a
2024-09-19 21:10:23 +0000 to 2024-09-27 17:56:01 +0000
- Update cc to 1.1.22 (rust-lang/cargo#14607)
- feat: lockfile path implies --locked on cargo install (rust-lang/cargo#14556)
- feat(toml): Add `autolib` (rust-lang/cargo#14591)
- fix: correct error count for `cargo check --message-format json` (rust-lang/cargo#14598)
- test: relax panic output assertion (rust-lang/cargo#14602)
- feat(timings): support dark color scheme in HTML output (rust-lang/cargo#14588)
- feat: add CARGO_MANIFEST_PATH env variable (rust-lang/cargo#14404)
- fix(config): Don't double-warn about `$CARGO_HOME/config` (rust-lang/cargo#14579)
- fix(cargo-rustc): give trailing flags higher precedence on nightly (rust-lang/cargo#14587)
- feat: make lockfile v4 the default (rust-lang/cargo#14595)
- perf: Improve quality of completion performance traces (rust-lang/cargo#14592)
- test: Remove completion tests (rust-lang/cargo#14590)
- feat: Add support for completing `cargo update <TAB>` (rust-lang/cargo#14552)
- test: Migrate remaining with_stdout/with_stderr calls (rust-lang/cargo#14577)
- fix(resolve): Improve multi-MSRV workspaces (rust-lang/cargo#14569)
- chore: Bump MSRV to 1.81 (rust-lang/cargo#14585)
- Add a `--dry-run` flag to the `install` command (rust-lang/cargo#14280)
- fix(resolve): Don't list transitive, incompatible dependencies as available (rust-lang/cargo#14568)
- feat(complete): Upgrade clap_complete (rust-lang/cargo#14573)
@rustbot rustbot added this to the 1.83.0 milestone Sep 28, 2024
@rfcbot rfcbot added finished-final-comment-period FCP complete to-announce and removed final-comment-period FCP — a period for last comments before action is taken labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-execution Area: anything dealing with executing the compiler A-build-scripts Area: build.rs scripts A-documenting-cargo-itself Area: Cargo's documentation disposition-merge FCP with intent to merge finished-final-comment-period FCP complete S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-cargo Team: Cargo to-announce
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants