-
Notifications
You must be signed in to change notification settings - Fork 792
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
[rust] dependency upgrades to fix cargo audit warnings #19203
Conversation
Blocked until #19208 goes in. |
Hi Gary, thanks for working on this! Out of curiosity, how have you been running cargo audit? |
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.
LGTM!
index 65c42bb..ee50f55 100644 | ||
index bec8f86...0000000 100644 |
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.
FYI @lschuermann, now I remember you mentioned that this patch didn't apply cleanly. Thanks @nbdd0121 for updating it!
I just cd into |
831c871
to
0140c37
Compare
The output file is slightly different, likely due to the Bazel version upgrade. Signed-off-by: Gary Guo <gary.guo@lowrisc.org>
The current nix version has security advisory RUSTSEC-2021-0119. Signed-off-by: Gary Guo <gary.guo@lowrisc.org>
The current version is yanked. Updating the version makes the patch not applicable, so the patch is updated and rebased. Signed-off-by: Gary Guo <gary.guo@lowrisc.org>
661a1ae
to
baa7099
Compare
The previous CI failure is caused by serde-derive starting to use precompiled binary but the file is not considered as data file in Rust rules so Bazel excludes them from sandbox. As a short-term solution I pinned Bazel to 1.0.171 which is the last version without precompiled binary, |
third_party/rust/Cargo.toml
Outdated
# serde-derive 1.0.172 uses precompiled binary which does not work well with Bazel. | ||
serde = { version="=1.0.171", features = ["derive"] } |
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.
Can you create an issue in lowRISC/opentitan for this and leave a TODO comment here:
# TODO(opentitan#xxxxx): serde-derive 1.0.172 uses ...
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.
Created #19362
Blocked on lowRISC#19203
`atty` is unmaintained. Switch to `is-terminal` crate, which is already one of our transitive dependency, and has the same API as the Rust std 1.70 `IsTerminal` trait. There are a few places that we are using `nix` to do `isatty`, and these are migrated as well. Signed-off-by: Gary Guo <gary.guo@lowrisc.org>
serde 1.0.172+ tries to use precompiled binary for proc macro but Bazel's Rust rules do not include them as data files so build breaks. This also removes the explicit serde_derive dependency which is not needed because we don't access serde_derive crate directly. Signed-off-by: Gary Guo <gary.guo@lowrisc.org>
The update addresses the following cargo-audit warnings: * `hermit-abi`, which is a transitive dependency of a few crates, is updated to an unyanked version. * `h2`, which is a transitive dependency of mdbook, is updated to an unyanked version. Signed-off-by: Gary Guo <gary.guo@lowrisc.org>
This adds `.cargo/audit.toml` which suppresses two crates that are flagged by `cargo audit` but does not affect us: * `time`, dependency of `chrono`, affected API is not used * `mach`, dependency of `serialport`, only affects MacOS Signed-off-by: Gary Guo <gary.guo@lowrisc.org>
Blocked on lowRISC#19203
Fix (almostly) #18970
nix
to 0.26serialport
to 4.2.1atty
tois-terminal
cargo update
rest of dependenciesThis addresses half of our cargo-audit warnings. The rest are:
time
, the affected version is still a dependency of chrono which mdbook uses, but the affected API is not used.mach
, dependency ofserialport
but is only used on MacOSansi_term
, dependency of serde-annotateSince
time
andmach
does not affect us, I suppressed their warnings by adding relevant security advisory toaudit.toml
ignore section.This lefts us with just
ansi_term
.