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

Update Rust version and dependencies #649

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

atanzu
Copy link

@atanzu atanzu commented Jan 14, 2025

Issue #, if available:

Description of changes:
The purpose of this PR is to unblock developers by satisfying the requirements coming from automated security and license checks. Without these changes, automated scanners will block new pull requests.

  • Updated minimum supported Rust version (MSRV) to 1.71.1
  • Replaced several deprecated or vulnerable dependencies:
    • Replaced yaml-rust with yaml-rust2 (security advisory RUSTSEC-2024-0320)
    • Replaced serde_cbor with ciborium (security advisory RUSTSEC-2021-0127)
    • Updated idna to 1.0.3 (security advisory RUSTSEC-2024-0421)
    • Updated Clap from 3.2 to 4.4 to remove dependency on unmaintained atty
      • Modified code to be compatible with Clap 4.4 API changes
  • Updated Cargo.lock file to reflect all dependency changes
  • Updated license attribution documentation
    • Added Unicode-3.0 to allowed licenses
    • Fixed Unicode license parsing issues
      • Updated cargo-about tool from 0.5.0 to 0.6.6
      • Added stable toolchain specifically for running cargo-about from the Docker container using make update-third-party-licenses-rust-crates-html

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This commit updates MSRV to 1.71 and bumps dependencies in the lock
file.

Signed-off-by: Mark Kirichenko <[email protected]>
This commit bumps `idna` to 1.0.3 in order to mitigate https://rustsec.org/advisories/RUSTSEC-2024-0421

Signed-off-by: Mark Kirichenko <[email protected]>
This commit replaces `yaml-rust` with `yaml-rust2` in order to mitigate https://rustsec.org/advisories/RUSTSEC-2024-0320

Signed-off-by: Mark Kirichenko <[email protected]>
This commit replaces `serde_cbor` with `ciborium` because the original
crate has been deprecated: https://rustsec.org/advisories/RUSTSEC-2021-0127

Signed-off-by: Mark Kirichenko <[email protected]>
This commit updates Clap from 3.2 to 4.4. This change is needed because
old Clap has a dependency on crate `atty` which is unmaintained: https://rustsec.org/advisories/RUSTSEC-2024-0375
This commit updates the dependency version and the code.

Signed-off-by: Mark Kirichenko <[email protected]>
This commit updates Cargo.lock after applying previous commits which
bump dependencies.

Signed-off-by: Mark Kirichenko <[email protected]>
This commit bumps version for `cargo-about` tool from 0.5.0 to 0.6.6.
This fixes the problem with parsing Unicode licenses.

In order to maintain MSRV 1.71.1 this commit adds stable toolchain which
is used to run up-to-date `cargo-about` tool.

Signed-off-by: Mark Kirichenko <[email protected]>
This commit adds Unicode-3.0 to the list of allowed licenses, and
updates the license attribution document.

Signed-off-by: Mark Kirichenko <[email protected]>
@atanzu atanzu force-pushed the update-rust-version-and-deps branch from f17e792 to a5f7c4f Compare January 15, 2025 09:15
@atanzu atanzu marked this pull request as ready for review January 15, 2025 09:31
args.get_many::<String>("cpu-ids")
.map(|values| {
values
.map(|id| {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks much rustier now 😀

Copy link
Contributor

Choose a reason for hiding this comment

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

however, ideally that refactoring should be in a separate commit as it's not much related to Clap upgrade

rustup target add --toolchain ${RUST_VERSION} ${ARCH}-unknown-linux-musl && \
# Install stable toolchain (needed to run fresh cargo-about)
rustup toolchain install stable-${ARCH}-unknown-linux-gnu && \
cargo +stable install cargo-about --version 0.6.6 --locked && \
Copy link
Contributor

@eugkoira eugkoira Jan 15, 2025

Choose a reason for hiding this comment

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

nit: indentation

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.

2 participants