Skip to content

Commit

Permalink
Try to fix building of .net 9 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
KubaZ2 authored Nov 30, 2024
1 parent 0edcbde commit 0524327
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -79,13 +76,7 @@ jobs:
- 'Backend/Sandbox/CheckedJit/**'
- '.github/workflows/**'
- name: Set MINUS_PREFIXED_PLATFORM_IF_NOT_AMD64
if: steps.checked-jit.outputs.checked-jit == 'true'
run: |
MINUS_PREFIXED_PLATFORM_IF_NOT_AMD64=${{ runner.arch != 'X64' && format('-{0}', runner.arch) || '' }}
echo "MINUS_PREFIXED_PLATFORM_IF_NOT_AMD64=${MINUS_PREFIXED_PLATFORM_IF_NOT_AMD64,,}" >>${GITHUB_ENV}
- name: Build and push runtime with checked jit
- name: Build and push checked jit
if: steps.checked-jit.outputs.checked-jit == 'true'
uses: docker/bake-action@v5
with:
Expand All @@ -96,7 +87,6 @@ jobs:
*.platform=linux/amd64,linux/arm64
*.cache-from=type=gha
*.cache-to=type=gha,mode=min
checked-jit.args.MINUS_PREFIXED_PLATFORM_IF_NOT_AMD64=${{ env.MINUS_PREFIXED_PLATFORM_IF_NOT_AMD64 }}
- name: Build and push backend
uses: docker/bake-action@v5
Expand Down
10 changes: 6 additions & 4 deletions Backend/Sandbox/CheckedJit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ ARG DOTNET_RUNTIME_VERSION=9.0.0
ARG OS=ubuntu
ARG OS_VERSION=24.04
ARG OS_CODENAME=noble
ARG MINUS_PREFIXED_PLATFORM_IF_NOT_AMD64

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet-buildtools/prereqs:$OS-$OS_VERSION$MINUS_PREFIXED_PLATFORM_IF_NOT_AMD64 AS build-env
FROM --platform=$BUILDPLATFORM $OS:$OS_CODENAME AS build-env
WORKDIR /runtime
ARG DOTNET_RUNTIME_VERSION
ARG OS_CODENAME
ARG TARGETARCH
ARG BUILDARCH

RUN apt update -y && apt install -y git

RUN git clone --depth 1 --branch v$DOTNET_RUNTIME_VERSION https://github.com/dotnet/runtime.git .

# Asserts fail when running in pwn.red/jail, so we need to remove them
Expand All @@ -27,9 +28,10 @@ RUN if [ $TARGETARCH = $BUILDARCH ]; then \
x86) BINUTILS_ARCH=i686 DOTNET_ARCH=x86 ;; \
*) echo "Unsupported target architecture: $TARGETARCH" && exit 1 ;; \
esac && \
sudo apt update -y && sudo apt install -y qemu-user-static binfmt-support debootstrap binutils-$BINUTILS_ARCH-linux-gnu && \
ln -s /usr/bin/llvm-objcopy-14 /usr/bin/llvm-objcopy && \
sudo ./eng/common/cross/build-rootfs.sh $DOTNET_ARCH $OS_CODENAME && \
apt install -y debootstrap lld && \
./eng/install-native-dependencies.sh && \
./eng/common/cross/build-rootfs.sh $DOTNET_ARCH $OS_CODENAME && \
ROOTFS_DIR=/runtime/.tools/rootfs/$DOTNET_ARCH ./build.sh clr -c Checked -a $DOTNET_ARCH --cross; \
fi

Expand Down

0 comments on commit 0524327

Please sign in to comment.