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

CI: Update riscv64gc-linux job to Ubuntu 22.04, rename to riscv64gc-gnu #125669

Merged
merged 5 commits into from
Jun 12, 2024
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
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
# based on armhf-gnu/Dockerfile
FROM ubuntu:20.04
FROM ubuntu:22.04

RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get install -y --no-install-recommends \
bc \
bison \
ca-certificates \
cmake \
cpio \
curl \
debian-ports-archive-keyring \
debootstrap \
flex \
gcc \
gcc-riscv64-linux-gnu \
git \
g++-riscv64-linux-gnu \
g++ \
libc6-dev \
libc6-dev-riscv64-cross \
libssl-dev \
make \
ninja-build \
patch \
python3 \
qemu-system-misc \
xz-utils
bc \
bzip2 \
ca-certificates \
cmake \
cpio \
curl \
file \
flex \
bison \
g++ \
g++-riscv64-linux-gnu \
git \
libc6-dev \
libc6-dev-riscv64-cross \
libssl-dev \
make \
ninja-build \
python3 \
qemu-system-riscv64 \
xz-utils

ENV ARCH=riscv
ENV CROSS_COMPILE=riscv64-linux-gnu-
ENV ARCH=riscv \
CROSS_COMPILE=riscv64-linux-gnu-

WORKDIR /build

# From https://github.com/michaeljclark/busybear-linux/blob/master/conf/linux.config
COPY host-x86_64/riscv64gc-linux/linux.config /build
COPY host-x86_64/riscv64gc-gnu/linux.config /build

# Compile the kernel that we're going to be emulating with. This is
# basically just done to be compatible with the QEMU target that we're going
Expand All @@ -49,29 +46,22 @@ RUN curl https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.16.tar.xz | tar
# Compile an instance of busybox as this provides a lightweight system and init
# binary which we will boot into. Only trick here is configuring busybox to
# build static binaries.
RUN curl https://busybox.net/downloads/busybox-1.31.1.tar.bz2 | tar xjf -
COPY host-x86_64/riscv64gc-linux/0001-Remove-stime-function-calls.patch /build/busybox-1.31.1/
RUN cd /build/busybox-1.31.1 && \
patch -p1 -i 0001-Remove-stime-function-calls.patch && \
make defconfig && \
sed -i 's/.*CONFIG_STATIC.*/CONFIG_STATIC=y/' .config && \
make -j$(nproc) && \
make install && \
mv _install /tmp/rootfs && \
cd /build && \
rm -rf busybox-1.31.1
RUN curl https://www.busybox.net/downloads/busybox-1.32.1.tar.bz2 | tar xjf - && \
cd busybox-1.32.1 && \
make defconfig && \
sed -i 's/.*CONFIG_STATIC.*/CONFIG_STATIC=y/' .config && \
make -j$(nproc) && \
make install && \
mv _install /tmp/rootfs && \
cd /build && \
rm -rf busybox-1.32.1

# Download the ubuntu rootfs, which we'll use as a chroot for all our tests
# This is only needed to provide /lib/* and /usr/lib/*
# Download the ubuntu rootfs, which we'll use as a chroot for all our tests.
WORKDIR /tmp
RUN debootstrap --variant=minbase --arch=riscv64 --foreign focal /tmp/rootfs/ubuntu
RUN cd rootfs && mkdir proc sys dev etc etc/init.d
# rootfs/ubuntu/proc is in a weird state (access fails with ELOOP) until
# rootfs/ubuntu/debootstrap/debootstrap --second-stage is run (under emulation),
# but this takes ages. Instead hack it into a good enough state.
# /proc is used by std::env::current_exe() (which is roughly
# `readlink /proc/self/exe`)
RUN cd rootfs/ubuntu && rm -rf proc && mkdir proc
RUN mkdir rootfs/ubuntu
RUN curl https://cdimage.ubuntu.com/ubuntu-base/releases/22.04/release/ubuntu-base-22.04.2-base-riscv64.tar.gz | \
tar xzf - -C rootfs/ubuntu && \
cd rootfs && mkdir proc sys dev etc etc/init.d

# Copy over our init script, which starts up our test server and also a few other
# misc tasks
Expand All @@ -95,12 +85,12 @@ RUN mkdir build && cd build && \
WORKDIR /tmp
RUN rm -rf /tmp/riscv-pk

COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# Avoid "fatal: detected dubious ownership in repository at '/checkout'" error
RUN git config --global --add safe.directory /checkout

ENV RUST_CONFIGURE_ARGS --qemu-riscv64-rootfs=/tmp/rootfs
ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target riscv64gc-unknown-linux-gnu

Expand Down

This file was deleted.

Loading