Skip to content

Commit 14b3e54

Browse files
committed
Build sail csim instead of downloading prebuilt binary
1 parent dcd343e commit 14b3e54

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/.devcontainer/Dockerfile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
FROM debian:bookworm-slim AS build-sail
2+
3+
ARG SAIL_RELEASE=https://github.com/rems-project/sail/releases/download/0.19.1-linux-binary/sail.tar.gz
4+
5+
# presumably not all of these are required, but the sail readme doesn't say what the dependencies are
6+
RUN apt-get update \
7+
&& apt-get install -y --no-install-recommends pkg-config jq autoconf automake autotools-dev curl python3 python3-pip python3-tomli libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev libslirp-dev \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
RUN mkdir -p /usr/local \
11+
&& curl --location "${SAIL_RELEASE}" | tar xvz --directory=/usr/local --strip-components=1 \
12+
&& git clone https://github.com/riscv/sail-riscv.git \
13+
&& cd sail-riscv \
14+
&& cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDOWNLOAD_GMP=FALSE -GNinja \
15+
&& cmake --build build \
16+
&& mkdir -p /opt/sail-riscv \
17+
&& mv build/c_emulator/* /opt/sail-riscv
18+
119
FROM mcr.microsoft.com/devcontainers/rust:bookworm
220

321
COPY --from=ghcr.io/astral-sh/uv:0.7.6 /uv /uvx /bin/
@@ -6,7 +24,7 @@ ENV PATH=$PATH:/opt/riscv/bin:/opt/sail-riscv
624

725
COPY --from=ghcr.io/object-object/mlogv32-riscv-gnu-toolchain:rv32ima-ilp32 /opt/riscv /opt/riscv
826

9-
COPY --from=registry.gitlab.com/incoresemi/docker-images/compliance /usr/bin/riscv_sim_RV32 /opt/sail-riscv/
27+
COPY --from=build-sail /opt/sail-riscv /opt/sail-riscv
1028

1129
# https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history
1230
ARG USERNAME=vscode

0 commit comments

Comments
 (0)