-
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
fix: Move off atty to resolve soundness issue #11420
Conversation
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
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.
Thanks for the quick patch!
Cargo.toml
Outdated
@@ -16,7 +16,7 @@ name = "cargo" | |||
path = "src/cargo/lib.rs" | |||
|
|||
[dependencies] | |||
atty = "0.2" | |||
is-terminal = "0.4.0" |
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.
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 a little concerned about switching to rustix, and I echo the concerns at #10309 (comment). Do we know how well this will handle the myriad of platforms cargo is used on? I suppose one option is to push it out and see if anyone complains, but I think we should be prepared to revert this if needed.
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.
Alternatively, we can continue using atty
for Unix. Only on Windows do we use rustix, which effectively uses libc. Does this sound reasonable?
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 don't have a particular opinion about what to use. Just pointing out to beware of the risks of this change. Maybe @joshtriplett may have some thoughts, or maybe a better sense of when IsTerminal
could be stabilized, in which case we could just wait or switch to that soon.
There is a soundness issue with atty when building on Windows with a custom allocator. This PR switches direct dependencies on atty to is-terminal. New semver compatible versions of clap and snapbox remove atty. rust-lang#11417 upgrades env_logger to remove it from there. Fixes rust-lang#11415
@bors r+ |
☀️ Test successful - checks-actions |
5 commits in ba607b23db8398723d659249d9abf5536bc322e5..e027c4b5d25af2119b1956fac42863b9b3242744 2022-11-22 20:52:39 +0000 to 2022-11-25 19:44:46 +0000 - fix: Move off atty to resolve soundness issue (rust-lang/cargo#11420) - add newline char to `cargo install .` error message for easier reading. (rust-lang/cargo#11401) - chore: Upgrade to env_logger (rust-lang/cargo#11417) - Change rustdoc-scrape-examples to be a target-level configuration (rust-lang/cargo#10343) - temporarily disable test `lto::test_profile` (rust-lang/cargo#11419)
Update cargo 5 commits in ba607b23db8398723d659249d9abf5536bc322e5..e027c4b5d25af2119b1956fac42863b9b3242744 2022-11-22 20:52:39 +0000 to 2022-11-25 19:44:46 +0000 - fix: Move off atty to resolve soundness issue (rust-lang/cargo#11420) - add newline char to `cargo install .` error message for easier reading. (rust-lang/cargo#11401) - chore: Upgrade to env_logger (rust-lang/cargo#11417) - Change rustdoc-scrape-examples to be a target-level configuration (rust-lang/cargo#10343) - temporarily disable test `lto::test_profile` (rust-lang/cargo#11419) r+ `@ghost`
5 commits in ba607b23db8398723d659249d9abf5536bc322e5..e027c4b5d25af2119b1956fac42863b9b3242744 2022-11-22 20:52:39 +0000 to 2022-11-25 19:44:46 +0000 - fix: Move off atty to resolve soundness issue (rust-lang/cargo#11420) - add newline char to `cargo install .` error message for easier reading. (rust-lang/cargo#11401) - chore: Upgrade to env_logger (rust-lang/cargo#11417) - Change rustdoc-scrape-examples to be a target-level configuration (rust-lang/cargo#10343) - temporarily disable test `lto::test_profile` (rust-lang/cargo#11419)
Update cargo 5 commits in ba607b23db8398723d659249d9abf5536bc322e5..e027c4b5d25af2119b1956fac42863b9b3242744 2022-11-22 20:52:39 +0000 to 2022-11-25 19:44:46 +0000 - fix: Move off atty to resolve soundness issue (rust-lang/cargo#11420) - add newline char to `cargo install .` error message for easier reading. (rust-lang/cargo#11401) - chore: Upgrade to env_logger (rust-lang/cargo#11417) - Change rustdoc-scrape-examples to be a target-level configuration (rust-lang/cargo#10343) - temporarily disable test `lto::test_profile` (rust-lang/cargo#11419) r+ `@ghost`
Update cargo 5 commits in ba607b23db8398723d659249d9abf5536bc322e5..e027c4b5d25af2119b1956fac42863b9b3242744 2022-11-22 20:52:39 +0000 to 2022-11-25 19:44:46 +0000 - fix: Move off atty to resolve soundness issue (rust-lang/cargo#11420) - add newline char to `cargo install .` error message for easier reading. (rust-lang/cargo#11401) - chore: Upgrade to env_logger (rust-lang/cargo#11417) - Change rustdoc-scrape-examples to be a target-level configuration (rust-lang/cargo#10343) - temporarily disable test `lto::test_profile` (rust-lang/cargo#11419) r+ `@ghost`
There is a soundness issue with atty when building on Windows with a custom allocator.
This PR switches direct dependencies on atty to is-terminal. New semver compatible versions of clap and snapbox remove atty. #11417 upgrades env_logger to remove it from there.
Fixes #11416