-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 update to 1.83 #4935
Rust update to 1.83 #4935
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4935 +/- ##
==========================================
- Coverage 84.07% 83.98% -0.10%
==========================================
Files 251 251
Lines 28059 27889 -170
==========================================
- Hits 23592 23422 -170
Misses 4467 4467
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
971a4f1
to
791e2c9
Compare
dc26fbe
to
bb0e700
Compare
66c8c8b
to
0f1da0d
Compare
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.
egor says i can approve
Update Rust to 1.83 version Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk> Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
From: Egor Lazarchuk <yegorlz@amazon.co.uk> With a new Rust version, new Clippy entered our repository. This commit aligns our codebase with guidance provided by new lints. Also remove a `deny(clippy::pedantic)`, because I'm not fixing those. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk> Co-authored-by: Patrick Roy <roypat@amazon.co.uk> Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
This is needed for CI to install previous version of the toolchain used on the main branch. This change will need to be reverted after this PR is merged. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk> Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
Add the rust-src component and the $(uname -m)-unknown-linux-musl targets for the nightly toolchain, and install python3-seccomp and rustfilt. Since the python bindings for libseccomp are not published to pip, we have to install it into the global python installation via apt-get, and then copy into our venv. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
Build static version of libseccomp with `musl-gcc`. This is needed for our musl builds as the version shipped in the ubuntu package is not compiled with `musl-gcc` and produces linker errors. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk> Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
From: Jonathan Woollett-Light <jcawl@amazon.co.uk> Adds `cargo-udeps` and the Rust `nightly` toolchain to support it, to dev container. Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk> Co-authored-by: Patrick Roy <roypat@amazon.co.uk> Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
These python dependencies are used for an upcoming PR about reusing SSH connection in our SSH tests. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
accumulate all the dockerfile changes into a new devctr version Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
This is needed to work around a bug in `VmFd::create_device`, where undefined behavior caused a miscompilation on newer rust toolchains. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
With the devctr's python dependencies update, we pulled in a new pylint version, which has a new `too-many-positional-arguments` lint. Fixing this would be a significant refactor, so just suppress it, as it seems low-value. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
With newer rust toolchains, rust will SIGABRT if an already closed file descriptor is closed in the the `Drop` implementation for `File`. This also applies to creating `File`s with invalid file descriptors. Thus fix tests that accidentally double-close fds, and remove those that explicitly construct `File`s with invalid file descriptors (they are redundant now anyway, because Rust would abort if this ever happened). Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
It seemingly finally got intelligent enough to realize we don't need all these backslashes on the brackets. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
The unittests here rely on the cfg(not(test)) antipattern for mocking, which new rust compiler interprets as the production version of the structs being dead-code when running unittests. Refactoring this to eliminate mocking is difficult, because fdt unit tests rely on the mocks removing all host-specific information from the cpu FDT nodes (particularly cache information, which in prod is read from the host sysfs, but in test mode is some dummy mock values). Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
with new mdformat we no longer need to wrap level 2 headings in escaped brackets, just normal brackets. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
Thanks to mdformat no longer escaping brackets everywhere, we can simplify a regex. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
@@ -98,8 +99,13 @@ RUN cd /tmp/poetry \ | |||
ENV VIRTUAL_ENV=$VENV | |||
ENV PATH=$VENV/bin:$PATH | |||
|
|||
# apt-get installs it globally, to manually copy it into the venv |
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.
"to manually copy" -> "manually copy it so we can use it in the venv"
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.
Ah, yeah, I meant "so manually copy", not "to"
# Install static version of libseccomp | ||
# |
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.
We should have a comment explaining why we need to compile it. The short answer I guess is a static library compiled with glibc is not usable by a musl toolchain, and needs to be compiled with musl.
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.
@ShadowCurse context on this one?
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.
Correct. I'll add a comment about this in the #4910
# Running as root would have created some root-owned files under the build | ||
# dir. Let's fix that. | ||
cmd_fix_perms | ||
|
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.
Out of scope but maybe we should run this always as part of run_devctr?
@@ -110,6 +116,10 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-too | |||
&& cargo install --locked cargo-audit cargo-deny@0.16.1 grcov cargo-sort cargo-afl \ | |||
&& cargo install --locked kani-verifier && cargo kani setup \ | |||
\ | |||
&& NIGHTLY_TOOLCHAIN=$(rustup toolchain list | grep nightly | tr -d '\n') \ |
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.
nit: I think you don't need the tr -d
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 do, otherwise the interpolation of $NIGHTLY_TOOLCHAIN into the cargo +(bla) install
fails because of a newline in the middle
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.
now that I'm thinking about it, maybe that was in python...
@@ -110,6 +116,10 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-too | |||
&& cargo install --locked cargo-audit cargo-deny@0.16.1 grcov cargo-sort cargo-afl \ | |||
&& cargo install --locked kani-verifier && cargo kani setup \ | |||
\ | |||
&& NIGHTLY_TOOLCHAIN=$(rustup toolchain list | grep nightly | tr -d '\n') \ | |||
&& rustup component add rust-src --toolchain "$NIGHTLY_TOOLCHAIN" \ |
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.
why is it needed? any rough estimate how much space it takes?
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.
the static analysis thingy uses -Zbuild_std, to compile the standard library as non-PIE, and for that we need to have the source of the standard library around. Its 28.8MB
@@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |||
and this project adheres to | |||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). | |||
|
|||
## \[Unreleased\] | |||
## [Unreleased] |
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.
\o/
Also includes devctr updates for the following PRs:
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md
.PR Checklist
tools/devtool checkstyle
to verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md
.Runbook for Firecracker API changes.
integration tests.
TODO
.rust-vmm
.