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

Rust update to 1.83 #4935

Merged
merged 16 commits into from
Dec 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tools/devctr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ RUN apt-get update \
tzdata \
tini \
squashfs-tools zstd \
python3-seccomp \
# for aws-lc-rs
cmake \
# for Qemu vhost-user-blk backend
Expand All @@ -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
Copy link
Contributor

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"

Copy link
Contributor

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"

RUN cp /usr/lib/python3/dist-packages/seccomp.cpython-312-"$ARCH"-linux-gnu.so "$VENV"/lib/python3.12/site-packages/
ShadowCurse marked this conversation as resolved.
Show resolved Hide resolved

# Running the three as a single dockerfile command to avoid inflation of the image:
# - Install the Rust toolchain. Kani only work on x86, so only try to install it there
# - Install the Rust toolchain.
# - Kani always installs _some_ nightly toolchain, we reuse it for the seccomp filter analysis test. Dynamically
# determine the exact toolchain name, and install more components into it.
# - Build and install crosvm (used as vhost-user-blk backend)
# - Clean up cargo compilation directories
# - Always install both x86_64 and aarch64 musl targets, as our rust-toolchain.toml would force on-the-fly installation of both anyway
Expand All @@ -110,6 +116,10 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-too
&& cargo install --locked cargo-audit [email protected] grcov cargo-sort cargo-afl \
&& cargo install --locked kani-verifier && cargo kani setup \
\
&& NIGHTLY_TOOLCHAIN=$(rustup toolchain list | grep nightly | tr -d '\n') \
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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...

&& rustup component add rust-src --toolchain "$NIGHTLY_TOOLCHAIN" \
Copy link
Contributor

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?

Copy link
Contributor

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

&& rustup target add "$ARCH"-unknown-linux-musl --toolchain "$NIGHTLY_TOOLCHAIN" \
\
&& apt-get update \
&& apt-get -y install --no-install-recommends \
libcap-dev \
Expand Down