Change config paths to only check CARGO_HOME for cargo-script by 0xPoe · Pull Request #14749 · rust-lang/cargo (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@0xPoe

What does this PR try to resolve?

ref #12207 (comment)
After this change, we will only check the configs from the CARGO_HOME.

How should we test and review this PR?

The test has been updated.

Additional information

r? @epage

@0xPoe

@epage Even I found the code and changed it. But I am a little confused about your comments.

When we talked about this as a Cargo team, we decided this need to reload to cargo home, like cargo install does, to avoid downloading a script and being subject to spurious files in your ~/Downloads, at the cost of losing the config from your repo.

What do you mean by downloading a script? And what kind of spurious files might end up being created? I thought it only read the config files.

@epage

What do you mean by downloading a script? And what kind of spurious files might end up being created? I thought it only read the config files.

If I download a script off the internet, my browser will put it in ~/Downloads. That is a grab bag directory with who knows what in it. A user might have extracted a project into that directory to look at that could have dropped a .cargo/config.toml into it. The concern is with that being used when it wasn't intended. That unfortunately means we'll not load any config for cargo scripts.

@0xPoe 0xPoe marked this pull request as ready for review

October 31, 2024 14:32

0xPoe

Choose a reason for hiding this comment

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

🔢 Self-check (PR reviewed by myself and ready for feedback.)

epage

@epage epage mentioned this pull request

Oct 31, 2024

39 tasks

0xPoe

This comment was marked as outdated.

@0xPoe

Signed-off-by: Rustin170506 29879298+Rustin170506@users.noreply.github.com

0xPoe

Choose a reason for hiding this comment

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

🔢 Self-check (PR reviewed by myself and ready for feedback.)

@epage

@bors

📌 Commit bd47da1 has been approved by epage

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

Nov 4, 2024

@bors

@bors

@0xPoe

Thanks for your review! 💚 💙 💜 💛 ❤️

bors added a commit to rust-lang-ci/rust that referenced this pull request

Nov 10, 2024

@bors

mati865 pushed a commit to mati865/rust that referenced this pull request

Nov 12, 2024

@bors @mati865

@epage epage mentioned this pull request

Nov 15, 2024

11 tasks

Labels

A-cli

Area: Command-line interface, option parsing, etc.

Command-run S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.