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

Replace atty dependency with std::io::IsTerminal. #4790

Merged
merged 1 commit into from
Jan 12, 2024
Merged

Conversation

kpreid
Copy link
Collaborator

@kpreid kpreid commented Jan 11, 2024

What

The atty library has a GitHub security advisory noting that it is unmaintained and can be unsound under some conditions. Its functionality can be replaced with std::io::IsTerminal; this PR does that.

I also added a helper function which replaces the two identical uses; this gives a single place to change the policy if desired, rather than perhaps accidentally editing only one site.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

`IsTerminal` was added in Rust 1.70, which is below the project MSRV.
@teh-cmc teh-cmc self-requested a review January 12, 2024 07:33
Copy link
Member

@teh-cmc teh-cmc left a comment

Choose a reason for hiding this comment

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

Thanks

Checks:

  • cargo r -p rerun-loader-rust-file -- run_wasm/src/main.rs does nothing
  • cargo r -p rerun-loader-rust-file -- run_wasm/src/main.rs | bat prints a binary blob

@teh-cmc teh-cmc merged commit c027450 into rerun-io:main Jan 12, 2024
2 of 4 checks passed
@emilk emilk added this to the 0.12.1 milestone Jan 17, 2024
emilk pushed a commit that referenced this pull request Jan 17, 2024
The `atty` library has [a GitHub security
advisory](GHSA-g98v-hv3f-hcfr) noting that
it is unmaintained and can be unsound under some conditions. Its
functionality can be replaced with `std::io::IsTerminal`; this PR does
that.

I also added a helper function which replaces the two identical uses;
this gives a single place to change the policy if desired, rather than
perhaps accidentally editing only one site.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants