Skip to content

Commit f3eb6ca

Browse files
authored
Pin Rust nightly 2025-02-28 (#164)
1 parent d2bf8a2 commit f3eb6ca

File tree

5 files changed

+78
-60
lines changed

5 files changed

+78
-60
lines changed

.github/builder/common.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
set -e
77

8-
if [ -z "${RUST_NIGHTLY_VERSION}" ]; then
9-
echo "RUST_NIGHTLY_VERSION not set. It should be defined by ci.yml workflow."
8+
if [ -z "${RUST_NIGHTLY_DATE}" ]; then
9+
echo "RUST_NIGHTLY_DATE not set. It should be defined by ci.yml workflow."
1010
exit 1
1111
fi
1212

@@ -112,8 +112,8 @@ download_and_verify_make() {
112112

113113
download_and_verify_rust() {
114114
RUST_GPG_KEY_URL="https://static.rust-lang.org/rust-key.gpg.ascii"
115-
RUST_URL="https://static.rust-lang.org/dist/${RUST_NIGHTLY_VERSION}/rust-nightly-x86_64-unknown-linux-gnu.tar.xz"
116-
RUST_SIG_URL="https://static.rust-lang.org/dist/${RUST_NIGHTLY_VERSION}/rust-nightly-x86_64-unknown-linux-gnu.tar.xz.asc"
115+
RUST_URL="https://static.rust-lang.org/dist/${RUST_NIGHTLY_DATE}/rust-nightly-x86_64-unknown-linux-gnu.tar.xz"
116+
RUST_SIG_URL="https://static.rust-lang.org/dist/${RUST_NIGHTLY_DATE}/rust-nightly-x86_64-unknown-linux-gnu.tar.xz.asc"
117117

118118
if [ -z "${BUILDER_DIR}" ]; then
119119
echo "BUILDER_DIR not set. Exiting..."

.github/workflows/ci.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ env:
1919
PUBLIC_SIMICS_ISPM_VERSION: "1.8.3"
2020
MINGW_URL: "https://github.com/brechtsanders/winlibs_mingw/releases/download/13.2.0-16.0.6-11.0.0-ucrt-r1/winlibs-x86_64-posix-seh-gcc-13.2.0-llvm-16.0.6-mingw-w64ucrt-11.0.0-r1.7z"
2121
MINGW_VERSION: "13.2.0-16.0.6-11.0.0-ucrt-r1"
22-
RUST_NIGHTLY_VERSION: "2025-02-28"
2322

2423
permissions:
2524
contents: read
@@ -472,9 +471,6 @@ jobs:
472471
chmod -R 0755 tests/rsrc/
473472
474473
- uses: dtolnay/rust-toolchain@83bdede770b06329615974cf8c786f845d824dfb # nightly
475-
with:
476-
toolchain: nightly-${{ env.RUST_NIGHTLY_VERSION }}
477-
components: rustfmt,clippy,miri
478474

479475
- name: Cache SIMICS Dependencies
480476
id: cache-simics-packages
@@ -579,7 +575,7 @@ jobs:
579575
echo "Downloading Rustup"
580576
Invoke-WebRequest -URI https://win.rustup.rs/x86_64 -OutFile C:\rustup-init.exe
581577
echo "Installing Rust"
582-
C:\rustup-init.exe --default-toolchain nightly-${{ env.RUST_NIGHTLY_VERSION }} --default-host x86_64-pc-windows-gnu -y
578+
C:\rustup-init.exe --default-host x86_64-pc-windows-gnu --default-toolchain none -y
583579
584580
- name: Cache SIMICS
585581
id: cache-simics-packages-windows
@@ -653,10 +649,33 @@ jobs:
653649
path: .github/builder/rsrc
654650
key: "cache-builder-dependencies-${{ hashFiles('.github/builder/common.sh') }}"
655651

652+
# tomllib is available in Python 3.11 and later
653+
- name: Set up Python 3.11
654+
uses: actions/setup-python@v5
655+
with:
656+
python-version: '3.11'
657+
658+
- name: Extract Rust channel from rust-toolchain.toml
659+
id: rust-channel
660+
shell: python3 {0}
661+
run: |
662+
import tomllib
663+
import os
664+
665+
with open('rust-toolchain.toml', 'rb') as f:
666+
data = tomllib.load(f)
667+
channel = data['toolchain']['channel']
668+
date = channel.split("nightly-")[1]
669+
670+
with open(os.environ['GITHUB_OUTPUT'], 'a') as out:
671+
out.write(f'nightly_date={date}\n')
672+
656673
# NOTE: This script only downloads the builder dependencies if they do not already exist,
657674
# but it always verifies them.
658675
- name: Build Distribution Package
659676
run: |
677+
RUST_NIGHTLY_DATE="${{ steps.rust-channel.outputs.nightly_date }}"
678+
export RUST_NIGHTLY_DATE
660679
./scripts/build.sh
661680
662681
- name: Upload Distribution Package

Dockerfile

Lines changed: 47 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,50 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2323
# - Rust (will be on the PATH due to the ENV command above)
2424
RUN dnf -y update && \
2525
dnf -y install \
26-
alsa-lib \
27-
atk \
28-
bash \
29-
clang \
30-
clang-libs \
31-
clang-resource-filesystem \
32-
clang-tools-extra \
33-
cmake \
34-
cups \
35-
curl \
36-
dosfstools \
37-
g++ \
38-
gcc \
39-
git \
40-
git-lfs \
41-
glibc-devel \
42-
glibc-devel.i686 \
43-
glibc-static \
44-
glibc-static.i686 \
45-
gtk3 \
46-
lld \
47-
lld-devel \
48-
lld-libs \
49-
llvm \
50-
llvm-libs \
51-
llvm-static \
52-
make \
53-
mesa-libgbm \
54-
mtools \
55-
ninja-build \
56-
openssl \
57-
openssl-devel \
58-
openssl-libs \
59-
python3 \
60-
python3-pip \
61-
vim \
62-
yamllint && \
26+
alsa-lib \
27+
atk \
28+
bash \
29+
clang \
30+
clang-libs \
31+
clang-resource-filesystem \
32+
clang-tools-extra \
33+
cmake \
34+
cups \
35+
curl \
36+
dosfstools \
37+
g++ \
38+
gcc \
39+
git \
40+
git-lfs \
41+
glibc-devel \
42+
glibc-devel.i686 \
43+
glibc-static \
44+
glibc-static.i686 \
45+
gtk3 \
46+
lld \
47+
lld-devel \
48+
lld-libs \
49+
llvm \
50+
llvm-libs \
51+
llvm-static \
52+
make \
53+
mesa-libgbm \
54+
mtools \
55+
ninja-build \
56+
openssl \
57+
openssl-devel \
58+
openssl-libs \
59+
python3 \
60+
python3-pip \
61+
vim \
62+
yamllint && \
6363
python3 -m pip install --no-cache-dir \
64-
black==23.10.1 \
65-
flake8==6.1.0 \
66-
isort==5.12.0 \
67-
mypy==1.6.1 \
68-
pylint==3.0.2 && \
69-
curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain nightly
64+
black==23.10.1 \
65+
flake8==6.1.0 \
66+
isort==5.12.0 \
67+
mypy==1.6.1 \
68+
pylint==3.0.2 && \
69+
curl https://sh.rustup.rs -sSf | bash -s -- --default-toolchain none -y
7070

7171

7272
WORKDIR /workspace
@@ -78,10 +78,10 @@ RUN mkdir -p /workspace/simics/ispm/ && \
7878
curl --noproxy '*.intel.com' -L -o /workspace/simics/ispm.tar.gz "${PUBLIC_SIMICS_ISPM_URL}" && \
7979
curl --noproxy '*.intel.com' -L -o /workspace/simics/simics.ispm "${PUBLIC_SIMICS_PKGS_URL}" && \
8080
tar -C /workspace/simics/ispm --strip-components=1 \
81-
-xf /workspace/simics/ispm.tar.gz && \
81+
-xf /workspace/simics/ispm.tar.gz && \
8282
ispm settings install-dir /workspace/simics && \
8383
ispm packages --install-bundle /workspace/simics/simics.ispm --non-interactive \
84-
--trust-insecure-packages && \
84+
--trust-insecure-packages && \
8585
rm /workspace/simics/ispm.tar.gz /workspace/simics/simics.ispm && \
8686
rm -rf /workspace/simics-6-packages/
8787

@@ -96,8 +96,8 @@ WORKDIR /workspace/tsffs/
9696
RUN cargo install cargo-simics-build && \
9797
cargo simics-build -r && \
9898
ispm packages \
99-
-i target/release/*-linux64.ispm \
100-
--non-interactive --trust-insecure-packages
99+
-i target/release/*-linux64.ispm \
100+
--non-interactive --trust-insecure-packages
101101

102102
WORKDIR /workspace/projects/example/
103103

@@ -123,6 +123,3 @@ RUN ispm projects /workspace/projects/example/ --create \
123123
ninja
124124

125125
RUN echo 'echo "To run the demo, run ./simics -no-gui --no-win fuzz.simics"' >> /root/.bashrc
126-
127-
128-

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "nightly-2025-02-28"

scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ docker build \
2525
docker create --name "${CONTAINER_NAME}" "${IMAGE_NAME}" bash
2626
mkdir -p "${ROOT_DIR}/packages"
2727
docker cp "${CONTAINER_NAME}:/packages" "${ROOT_DIR}/"
28-
docker rm -f "${CONTAINER_NAME}"
28+
docker rm -f "${CONTAINER_NAME}"

0 commit comments

Comments
 (0)