Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions .github/builder/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

set -e

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

Expand Down Expand Up @@ -112,8 +112,8 @@ download_and_verify_make() {

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

if [ -z "${BUILDER_DIR}" ]; then
echo "BUILDER_DIR not set. Exiting..."
Expand Down
29 changes: 24 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ env:
PUBLIC_SIMICS_ISPM_VERSION: "1.8.3"
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"
MINGW_VERSION: "13.2.0-16.0.6-11.0.0-ucrt-r1"
RUST_NIGHTLY_VERSION: "2025-02-28"

permissions:
contents: read
Expand Down Expand Up @@ -472,9 +471,6 @@ jobs:
chmod -R 0755 tests/rsrc/

- uses: dtolnay/rust-toolchain@83bdede770b06329615974cf8c786f845d824dfb # nightly
with:
toolchain: nightly-${{ env.RUST_NIGHTLY_VERSION }}
components: rustfmt,clippy,miri

- name: Cache SIMICS Dependencies
id: cache-simics-packages
Expand Down Expand Up @@ -579,7 +575,7 @@ jobs:
echo "Downloading Rustup"
Invoke-WebRequest -URI https://win.rustup.rs/x86_64 -OutFile C:\rustup-init.exe
echo "Installing Rust"
C:\rustup-init.exe --default-toolchain nightly-${{ env.RUST_NIGHTLY_VERSION }} --default-host x86_64-pc-windows-gnu -y
C:\rustup-init.exe --default-host x86_64-pc-windows-gnu --default-toolchain none -y

- name: Cache SIMICS
id: cache-simics-packages-windows
Expand Down Expand Up @@ -653,10 +649,33 @@ jobs:
path: .github/builder/rsrc
key: "cache-builder-dependencies-${{ hashFiles('.github/builder/common.sh') }}"

# tomllib is available in Python 3.11 and later
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Extract Rust channel from rust-toolchain.toml
id: rust-channel
shell: python3 {0}
run: |
import tomllib
import os

with open('rust-toolchain.toml', 'rb') as f:
data = tomllib.load(f)
channel = data['toolchain']['channel']
date = channel.split("nightly-")[1]

with open(os.environ['GITHUB_OUTPUT'], 'a') as out:
out.write(f'nightly_date={date}\n')

# NOTE: This script only downloads the builder dependencies if they do not already exist,
# but it always verifies them.
- name: Build Distribution Package
run: |
RUST_NIGHTLY_DATE="${{ steps.rust-channel.outputs.nightly_date }}"
export RUST_NIGHTLY_DATE
./scripts/build.sh

- name: Upload Distribution Package
Expand Down
97 changes: 47 additions & 50 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,50 +23,50 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# - Rust (will be on the PATH due to the ENV command above)
RUN dnf -y update && \
dnf -y install \
alsa-lib \
atk \
bash \
clang \
clang-libs \
clang-resource-filesystem \
clang-tools-extra \
cmake \
cups \
curl \
dosfstools \
g++ \
gcc \
git \
git-lfs \
glibc-devel \
glibc-devel.i686 \
glibc-static \
glibc-static.i686 \
gtk3 \
lld \
lld-devel \
lld-libs \
llvm \
llvm-libs \
llvm-static \
make \
mesa-libgbm \
mtools \
ninja-build \
openssl \
openssl-devel \
openssl-libs \
python3 \
python3-pip \
vim \
yamllint && \
alsa-lib \
atk \
bash \
clang \
clang-libs \
clang-resource-filesystem \
clang-tools-extra \
cmake \
cups \
curl \
dosfstools \
g++ \
gcc \
git \
git-lfs \
glibc-devel \
glibc-devel.i686 \
glibc-static \
glibc-static.i686 \
gtk3 \
lld \
lld-devel \
lld-libs \
llvm \
llvm-libs \
llvm-static \
make \
mesa-libgbm \
mtools \
ninja-build \
openssl \
openssl-devel \
openssl-libs \
python3 \
python3-pip \
vim \
yamllint && \
python3 -m pip install --no-cache-dir \
black==23.10.1 \
flake8==6.1.0 \
isort==5.12.0 \
mypy==1.6.1 \
pylint==3.0.2 && \
curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain nightly
black==23.10.1 \
flake8==6.1.0 \
isort==5.12.0 \
mypy==1.6.1 \
pylint==3.0.2 && \
curl https://sh.rustup.rs -sSf | bash -s -- --default-toolchain none -y


WORKDIR /workspace
Expand All @@ -78,10 +78,10 @@ RUN mkdir -p /workspace/simics/ispm/ && \
curl --noproxy '*.intel.com' -L -o /workspace/simics/ispm.tar.gz "${PUBLIC_SIMICS_ISPM_URL}" && \
curl --noproxy '*.intel.com' -L -o /workspace/simics/simics.ispm "${PUBLIC_SIMICS_PKGS_URL}" && \
tar -C /workspace/simics/ispm --strip-components=1 \
-xf /workspace/simics/ispm.tar.gz && \
-xf /workspace/simics/ispm.tar.gz && \
ispm settings install-dir /workspace/simics && \
ispm packages --install-bundle /workspace/simics/simics.ispm --non-interactive \
--trust-insecure-packages && \
--trust-insecure-packages && \
rm /workspace/simics/ispm.tar.gz /workspace/simics/simics.ispm && \
rm -rf /workspace/simics-6-packages/

Expand All @@ -96,8 +96,8 @@ WORKDIR /workspace/tsffs/
RUN cargo install cargo-simics-build && \
cargo simics-build -r && \
ispm packages \
-i target/release/*-linux64.ispm \
--non-interactive --trust-insecure-packages
-i target/release/*-linux64.ispm \
--non-interactive --trust-insecure-packages

WORKDIR /workspace/projects/example/

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

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



2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly-2025-02-28"
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ docker build \
docker create --name "${CONTAINER_NAME}" "${IMAGE_NAME}" bash
mkdir -p "${ROOT_DIR}/packages"
docker cp "${CONTAINER_NAME}:/packages" "${ROOT_DIR}/"
docker rm -f "${CONTAINER_NAME}"
docker rm -f "${CONTAINER_NAME}"