Skip to content

Commit

Permalink
Disable parallel gcc builds in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyparrish committed Mar 11, 2024
1 parent 125a2e6 commit 83adc06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/sgdk-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
file: deps/gcc.Dockerfile
context: deps/
platforms: linux/amd64,linux/arm64
# Disable parallel builds, which are hanging in GitHub Actions.
build-args: |
PARALLEL_BUILD=0
tags: ghcr.io/${{ github.actor }}/sgdk-m68k-gcc:latest
push: ${{ github.event_name == 'push' }}

Expand Down
11 changes: 10 additions & 1 deletion deps/gcc.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ARG _mpfrver=4.1.0
ARG _mpcver=1.2.1
ARG _gmpver=6.2.1
ARG _newlib_ver=4.1.0
ARG PARALLEL_BUILD=1

ENV TARGET=m68k-elf
ENV TARGET_CPU=m68000
Expand All @@ -26,6 +27,7 @@ ENV SRCDIR="$BASEDIR/src"
ENV BUILDDIR="$BASEDIR/build"
ENV INSTALLDIR="$BASEDIR/install"
ENV STAGINGDIR="$BASEDIR/staging"
ENV PARALLEL_BUILD="$PARALLEL_BUILD"

RUN mkdir -p "$SRCDIR"
RUN mkdir -p "$BUILDDIR"
Expand All @@ -42,6 +44,13 @@ RUN wget ftp://sourceware.org/pub/newlib/${NEWLIB}.tar.gz -O - | tar -xz

RUN apk add --no-cache bash build-base zlib-dev

# Choose parallel build or not. Parallel builds are hanging under qemu on
# GitHub, so we serialize building there. If parallel builds are disabled,
# replace nproc so it always says "1".
RUN echo "nproc = $(nproc)"
RUN echo "PARALLEL_BUILD = $PARALLEL_BUILD"
RUN if [[ "$PARALLEL_BUILD" == 0 ]]; then echo -e "#!/bin/sh\necho 1" > $(which nproc); fi

#################################################################################
########################## Building binutils ##############################
#################################################################################
Expand Down Expand Up @@ -134,7 +143,7 @@ RUN rm "$INSTALLDIR/$GCC/usr/lib/libcc1.so.0.0.0"
RUN cp -ar "$INSTALLDIR/$GCC/usr/" "$STAGINGDIR"


# Second stage, just copy the built files
# Second stage, just copy the built files
FROM scratch
ARG BASEDIR
WORKDIR /m68k
Expand Down

0 comments on commit 83adc06

Please sign in to comment.