From 3ec3d603b6ede929070c6e83b78cbed14b996e59 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Wed, 2 Sep 2020 21:02:58 -0400 Subject: [PATCH 01/74] Explicitly set locations of tool locations We now expose the following environment variables to ensure that tools are specified explicitly: * CABAL * GHC * OPT * LLC * HAPPY * ALEX * HSCOLOUR `configure` will pick these up. --- aarch64-linux-deb10/Dockerfile | 20 +++++++++++++------- armv7-linux-deb10/Dockerfile | 20 +++++++++++++------- i386-linux-deb9/Dockerfile | 14 ++++++++++---- linters/Dockerfile | 19 ++++++++++++------- x86_64-linux-alpine/Dockerfile | 18 +++++++++++++----- x86_64-linux-centos7/Dockerfile | 15 ++++++++++----- x86_64-linux-deb10/Dockerfile | 15 ++++++++++----- x86_64-linux-deb8/Dockerfile | 15 ++++++++++----- x86_64-linux-deb9/Dockerfile | 15 ++++++++++----- x86_64-linux-fedora27/Dockerfile | 16 +++++++++++----- x86_64-linux-ubuntu2004/Dockerfile | 14 ++++++++++---- 11 files changed, 122 insertions(+), 59 deletions(-) diff --git a/aarch64-linux-deb10/Dockerfile b/aarch64-linux-deb10/Dockerfile index 24cdce5..eab770a 100644 --- a/aarch64-linux-deb10/Dockerfile +++ b/aarch64-linux-deb10/Dockerfile @@ -35,12 +35,14 @@ RUN ./configure --prefix=/usr/local LLC=$BOOT_LLVM_DIR/bin/llc OPT=$BOOT_LLVM_DI make install WORKDIR / RUN rm -Rf ghc-* -RUN ghc --version +ENV GHC /usr/local/bin/ghc +RUN $ghc --version # LLVM ENV LLVM_DIR /opt/llvm ENV LLVM_VERSION 10.0.0 -ENV PATH $LLVM_DIR/bin:$PATH +ENV LLC $LLVM_DIR/bin/llc +ENV OPT $LLVM_DIR/bin/opt RUN curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-aarch64-linux-gnu.tar.xz \ | tar -xJC . && \ mkdir $LLVM_DIR && \ @@ -52,8 +54,7 @@ RUN curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0. ENV CABAL_VERSION 3.2.0.0 RUN curl -L http://home.smart-cactus.org/~ben/ghc/cabal-install-$CABAL_VERSION-aarch64-debian9-linux.tar.xz | tar -Jx && \ mv cabal /usr/local/bin/cabal - -ENV PATH /home/ghc/.local/bin:/opt/ghc/$GHC_VERSION/bin:$PATH +ENV CABAL /usr/local/bin/cabal # Create a normal user. RUN adduser ghc --gecos "GHC builds" --disabled-password @@ -62,9 +63,14 @@ USER ghc WORKDIR /home/ghc/ # Build Haskell tools -RUN cabal v2-update && \ - cabal install hscolour happy alex --constraint 'happy ^>= 1.20.0' -ENV PATH /home/ghc/.cabal/bin:$PATH +RUN $CABAL v2-update && \ + $CABAL install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour CMD ["bash"] diff --git a/armv7-linux-deb10/Dockerfile b/armv7-linux-deb10/Dockerfile index 5bfb578..f056865 100644 --- a/armv7-linux-deb10/Dockerfile +++ b/armv7-linux-deb10/Dockerfile @@ -37,12 +37,14 @@ RUN ./configure --prefix=/usr/local LLC=$BOOT_LLVM_DIR/bin/llc OPT=$BOOT_LLVM_DI make install WORKDIR / RUN rm -Rf ghc-* -RUN ghc --version +ENV GHC /usr/local/bin/ghc +RUN $GHC --version # LLVM ENV LLVM_DIR /opt/llvm ENV LLVM_VERSION 10.0.0 -ENV PATH $LLVM_DIR/bin:$PATH +ENV LLC $LLVM_DIR/bin/llc +ENV OPT $LLVM_DIR/bin/opt RUN curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-armv7a-linux-gnueabihf.tar.xz \ | tar -xJC . && \ mkdir $LLVM_DIR && \ @@ -54,8 +56,7 @@ RUN curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0. ENV CABAL_VERSION 3.2.0.0 RUN cabal update && cabal install "cabal-install==$CABAL_VERSION" && \ mv "$HOME/.cabal/bin/cabal" /usr/local/bin/cabal - -ENV PATH /home/ghc/.local/bin:/opt/ghc/$GHC_VERSION/bin:$PATH +ENV CABAL /usr/local/bin/cabal # Create a normal user. RUN adduser ghc --gecos "GHC builds" --disabled-password @@ -64,9 +65,14 @@ USER ghc WORKDIR /home/ghc/ # Build Haskell tools -RUN cabal v2-update && \ - cabal install hscolour happy alex --constraint 'happy ^>= 1.20.0' -ENV PATH /home/ghc/.cabal/bin:$PATH +RUN $CABAL v2-update && \ + $CABAL install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour CMD ["bash"] diff --git a/i386-linux-deb9/Dockerfile b/i386-linux-deb9/Dockerfile index 9004d87..23a3b04 100644 --- a/i386-linux-deb9/Dockerfile +++ b/i386-linux-deb9/Dockerfile @@ -27,13 +27,14 @@ WORKDIR /tmp/ghc-$GHC_VERSION RUN setarch i386 ./configure --prefix=/opt/ghc-i386/$GHC_VERSION CFLAGS=-m32 --target=i386-unknown-linux --build=i386-unknown-linux --host=i386-unknown-linux; \ make install; \ rm -rf /tmp/ghc-$GHC_VERSION -ENV PATH /opt/ghc-i386/$GHC_VERSION/bin:$PATH +ENV GHC /opt/ghc-i386/$GHC_VERSION/bin/ghc WORKDIR /tmp # Get Cabal ENV CABAL_VERSION 3.2.0.0 RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-i386-unknown-linux.tar.xz | tar -Jx && \ mv cabal /usr/local/bin/cabal +ENV CABAL /usr/local/bin/cabal # Create a normal user. RUN adduser ghc --gecos "GHC builds" --disabled-password @@ -42,8 +43,13 @@ USER ghc WORKDIR /home/ghc/ # Build Haskell tools -RUN cabal v2-update && \ - cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.20.0' -ENV PATH /home/ghc/.cabal/bin:$PATH +RUN $CABAL v2-update && \ + $CABAL v2-install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour CMD ["bash"] diff --git a/linters/Dockerfile b/linters/Dockerfile index e2ba40d..3e3160b 100644 --- a/linters/Dockerfile +++ b/linters/Dockerfile @@ -38,15 +38,15 @@ RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86 WORKDIR /tmp/ghc-$GHC_VERSION RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ make install; - +ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc WORKDIR /tmp RUN rm -rf /tmp/ghc-$GHC_VERSION -ENV PATH /opt/ghc/$GHC_VERSION/bin:$PATH # Get Cabal ENV CABAL_VERSION 3.2.0.0 RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ mv cabal /usr/local/bin/cabal +ENV CABAL /usr/local/bin/cabal # Create a normal user. RUN adduser ghc --gecos "GHC builds" --disabled-password @@ -55,9 +55,14 @@ USER ghc WORKDIR /home/ghc/ # Build Haskell tools -RUN cabal v2-update && \ - cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.20.0' -ENV PATH /home/ghc/.cabal/bin:$PATH +RUN $CABAL v2-update && \ + $CABAL v2-install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour # Build Linting tools USER root @@ -67,11 +72,11 @@ RUN apt-get update -qq; apt-get install --no-install-recommends -qy python3-pip RUN pip3 install mypy==0.701 USER ghc -RUN cabal v2-update +RUN $CABAL v2-update ENV LINTER_COMMIT b5650c094c98daec9416ceac92ca2cf3c099640f RUN git clone https://gitlab.haskell.org/ghc/git-haskell-org-hooks && \ git -C git-haskell-org-hooks checkout $LINTER_COMMIT WORKDIR /home/ghc/git-haskell-org-hooks -RUN cabal install +RUN $CABAL install CMD ["bash"] diff --git a/x86_64-linux-alpine/Dockerfile b/x86_64-linux-alpine/Dockerfile index ee991eb..e2c730c 100644 --- a/x86_64-linux-alpine/Dockerfile +++ b/x86_64-linux-alpine/Dockerfile @@ -46,7 +46,7 @@ RUN ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfow.so.6 WORKDIR /tmp/ghc-$GHC_VERSION RUN ./configure --disable-ld-override --prefix=/opt/ghc/$GHC_VERSION; \ make install; -ENV BOOT_GHC /usr/bin/ghc +ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc WORKDIR /tmp RUN rm -rf /tmp/ghc-$GHC_VERSION @@ -59,15 +59,23 @@ USER ghc WORKDIR /home/ghc/ # Install cabal -# N.B. We currently cabal-install from the Alpine repository #RUN cabal v2-update && \ # cabal v2-install cabal-install --constraint 'cabal-install ^>= 3.0' -w $BOOT_GHC #ENV PATH /home/ghc/.cabal/bin:$PATH +# N.B. We currently cabal-install from the Alpine repository +ENV CABAL /usr/bin/cabal + # Build Haskell tools -RUN cabal user-config update && \ - cabal v2-update && \ - cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.20.0' +RUN $CABAL user-config update && \ + $CABAL v2-update && \ + $CABAL v2-install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour ENV SPHINXBUILD /usr/bin/sphinx-build-3 CMD ["bash"] diff --git a/x86_64-linux-centos7/Dockerfile b/x86_64-linux-centos7/Dockerfile index 3f65e63..5425bf1 100644 --- a/x86_64-linux-centos7/Dockerfile +++ b/x86_64-linux-centos7/Dockerfile @@ -36,16 +36,16 @@ ENV GHC_VERSION 8.8.3 RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-centos7-linux.tar.xz | tar -Jx WORKDIR /tmp/ghc-$GHC_VERSION RUN ./configure --prefix=/opt/ghc/$GHC_VERSION && make install - +ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc WORKDIR /tmp RUN rm -rf /tmp/ghc-$GHC_VERSION -ENV PATH /opt/ghc/$GHC_VERSION/bin:$PATH WORKDIR /tmp # Get Cabal ENV CABAL_VERSION 3.2.0.0 RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ mv cabal /usr/local/bin/cabal +ENV CABAL /usr/local/bin/cabal # Create a normal user. RUN adduser ghc --comment "GHC builds" @@ -54,8 +54,13 @@ USER ghc WORKDIR /home/ghc/ # Build Haskell tools -RUN cabal v2-update && \ - cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.20.0' -ENV PATH /home/ghc/.cabal/bin:$PATH +RUN $CABAL v2-update && \ + $CABAL v2-install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour CMD ["bash"] diff --git a/x86_64-linux-deb10/Dockerfile b/x86_64-linux-deb10/Dockerfile index d46b37b..181b3a1 100644 --- a/x86_64-linux-deb10/Dockerfile +++ b/x86_64-linux-deb10/Dockerfile @@ -42,15 +42,15 @@ RUN curl -L http://home.smart-cactus.org/~ben/ghc/release-prep/$GHC_VERSION/ghc- WORKDIR /tmp/ghc-$GHC_VERSION RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ make install; - +ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc WORKDIR /tmp RUN rm -rf /tmp/ghc-$GHC_VERSION -ENV PATH /opt/ghc/$GHC_VERSION/bin:$PATH # Get Cabal ENV CABAL_VERSION 3.2.0.0 RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ mv cabal /usr/local/bin/cabal +ENV CABAL /usr/local/bin/cabal # LLVM ENV LLVM_DIR /opt/llvm @@ -70,8 +70,13 @@ USER ghc WORKDIR /home/ghc/ # Build Haskell tools -RUN cabal v2-update && \ - cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.20.0' -ENV PATH /home/ghc/.cabal/bin:$PATH +RUN $CABAL v2-update && \ + $CABAL v2-install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour CMD ["bash"] diff --git a/x86_64-linux-deb8/Dockerfile b/x86_64-linux-deb8/Dockerfile index 26bec11..33834d7 100644 --- a/x86_64-linux-deb8/Dockerfile +++ b/x86_64-linux-deb8/Dockerfile @@ -23,15 +23,15 @@ RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86 WORKDIR /tmp/ghc-$GHC_VERSION RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ make install; - +ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc WORKDIR /tmp RUN rm -rf /tmp/ghc-$GHC_VERSION -ENV PATH /opt/ghc/$GHC_VERSION/bin:$PATH # Get Cabal ENV CABAL_VERSION 3.2.0.0 RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ mv cabal /usr/local/bin/cabal +ENV CABAL /usr/local/bin/cabal # Create a normal user. RUN adduser ghc --gecos "GHC builds" --disabled-password @@ -40,8 +40,13 @@ USER ghc WORKDIR /home/ghc/ # Build Haskell tools -RUN cabal v2-update && \ - cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.20.0' -ENV PATH /home/ghc/.cabal/bin:$PATH +RUN $CABAL v2-update && \ + $CABAL v2-install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour CMD ["bash"] diff --git a/x86_64-linux-deb9/Dockerfile b/x86_64-linux-deb9/Dockerfile index 04bfcba..89707fa 100644 --- a/x86_64-linux-deb9/Dockerfile +++ b/x86_64-linux-deb9/Dockerfile @@ -38,15 +38,15 @@ RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86 WORKDIR /tmp/ghc-$GHC_VERSION RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ make install; - +ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc WORKDIR /tmp RUN rm -rf /tmp/ghc-$GHC_VERSION -ENV PATH /opt/ghc/$GHC_VERSION/bin:$PATH # Get Cabal ENV CABAL_VERSION 3.2.0.0 RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ mv cabal /usr/local/bin/cabal +ENV CABAL /usr/local/bin/cabal # Create a normal user. RUN adduser ghc --gecos "GHC builds" --disabled-password @@ -55,8 +55,13 @@ USER ghc WORKDIR /home/ghc/ # Build Haskell tools -RUN cabal v2-update && \ - cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.20.0' -ENV PATH /home/ghc/.cabal/bin:$PATH +RUN $CABAL v2-update && \ + $CABAL v2-install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour CMD ["bash"] diff --git a/x86_64-linux-fedora27/Dockerfile b/x86_64-linux-fedora27/Dockerfile index 03c1287..9289440 100644 --- a/x86_64-linux-fedora27/Dockerfile +++ b/x86_64-linux-fedora27/Dockerfile @@ -33,13 +33,14 @@ WORKDIR /tmp/ghc-$GHC_VERSION RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ make install; \ rm -rf /tmp/ghc-$GHC_VERSION -ENV PATH /opt/ghc/$GHC_VERSION/bin:$PATH - +ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc WORKDIR /tmp + # Get Cabal ENV CABAL_VERSION 3.2.0.0 RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ mv cabal /usr/local/bin/cabal +ENV CABAL /usr/local/bin/cabal # Create a normal user. RUN adduser ghc --comment "GHC builds" @@ -48,8 +49,13 @@ USER ghc WORKDIR /home/ghc/ # Build Haskell tools -RUN cabal v2-update && \ - cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.20.0' -ENV PATH /home/ghc/.cabal/bin:$PATH +RUN $CABAL v2-update && \ + $CABAL v2-install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour CMD ["bash"] diff --git a/x86_64-linux-ubuntu2004/Dockerfile b/x86_64-linux-ubuntu2004/Dockerfile index 5a48615..3f03157 100644 --- a/x86_64-linux-ubuntu2004/Dockerfile +++ b/x86_64-linux-ubuntu2004/Dockerfile @@ -42,12 +42,13 @@ RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ WORKDIR /tmp RUN rm -rf /tmp/ghc-$GHC_VERSION -ENV PATH /opt/ghc/$GHC_VERSION/bin:$PATH +ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc # Get Cabal ENV CABAL_VERSION 3.2.0.0 RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ mv cabal /usr/local/bin/cabal +ENV CABAL /usr/local/bin/cabal # Create a normal user. RUN adduser ghc --gecos "GHC builds" --disabled-password @@ -56,8 +57,13 @@ USER ghc WORKDIR /home/ghc/ # Build Haskell tools -RUN cabal v2-update && \ - cabal v2-install hscolour happy alex --constraint 'happy ^>= 1.20.0' -ENV PATH /home/ghc/.cabal/bin:$PATH +RUN $CABAL v2-update && \ + $CABAL v2-install hscolour happy alex \ + --constraint 'happy ^>= 1.20.0' \ + --enable-static --install-method=copy \ + --installdir=/usr/local/bin +ENV HAPPY /usr/local/bin/happy +ENV ALEX /usr/local/bin/alex +ENV HSCOLOUR /usr/local/bin/hscolour CMD ["bash"] -- GitLab From 15c28b50609b5c2234711bad137bd760dab34d9f Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Wed, 2 Sep 2020 22:32:08 -0400 Subject: [PATCH 02/74] dhall: Initial commit --- Containerfile.dhall | 2 + Prelude.dhall | 2 + alpine.dhall | 103 ++++++++++++++++++++++++++++++++++++++++++++ containers.dhall | 20 +++++++++ 4 files changed, 127 insertions(+) create mode 100644 Containerfile.dhall create mode 100644 Prelude.dhall create mode 100644 alpine.dhall create mode 100644 containers.dhall diff --git a/Containerfile.dhall b/Containerfile.dhall new file mode 100644 index 0000000..79bd23d --- /dev/null +++ b/Containerfile.dhall @@ -0,0 +1,2 @@ +--https://raw.githubusercontent.com/softwarefactory-project/dhall-containerfile/e3ea2f2e02bd979b4255dfbc5d7086dbbfcbc6c2/package.dhall +./dhall-containerfile/package.dhall diff --git a/Prelude.dhall b/Prelude.dhall new file mode 100644 index 0000000..b2f63a7 --- /dev/null +++ b/Prelude.dhall @@ -0,0 +1,2 @@ +https://prelude.dhall-lang.org/package.dhall + diff --git a/alpine.dhall b/alpine.dhall new file mode 100644 index 0000000..c0251fc --- /dev/null +++ b/alpine.dhall @@ -0,0 +1,103 @@ +let + CF = ./Containerfile.dhall +let + Prelude = ./Prelude.dhall +in + +let + build-depends: List Text = + [ "autoconf" + , "automake" + , "binutils-gold" + , "build-base" + , "coreutils" + , "cpio" + , "linux-headers" + , "libffi-dev" + , "musl-dev" + , "ncurses-dev" + , "ncurses-static" + , "python3" + , "py3-sphinx" + , "zlib-dev" + , "xz" + , "bash" + , "git" + , "wget" + , "sudo" + , "grep" + , "curl" + , "gmp-dev" + , "cabal" + , "ghc" + , "texlive" + , "texlive-xetex" + , "texmf-dist-latexextra" + , "ttf-dejavu" + ] +in + +-- GHC installation +-- NB: This is not an official bindist, but rather an alternative bindist taken +-- from https://github.com/redneb/ghc-alt-libc. +let + ghcVersion = "8.8.3" +let + ghcUrl = "https://github.com/redneb/ghc-alt-libc/releases/download/ghc-$GHC_VERSION-musl/ghc-$GHC_VERSION-x86_64-unknown-linux-musl.tar.xz" +let + fetchGhcStep: CF.Type = + CF.workdir "/tmp" + # CF.run "fetch GHC" [ "curl -L ${ghcUrl} | tar -Jx" ] + -- The ghc-alt-libc bindist requires libtinfow.so.6, so symlink what Alpine + -- provides. This hack can likely be removed when we start using GHC's native + -- Alpine bindists in the future. + # CF.run "fix ncurses" ["ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfow.so.6"] + # CF.workdir "/tmp/ghc-${ghcVersion}" + # CF.run "configure bindist" + [ "./configure --disable-ld-override --prefix=/opt/ghc/${ghcVersion}" + , "make install" + ] + # CF.env (toMap { GHC = "/opt/ghc/${ghcVersion}/bin/ghc" }) + # CF.workdir "/tmp" + # CF.run "remove temporary directory" [ "rm -Rf /tmp/ghc-${ghcVersion}" ] +in + +-- Create a normal user +let + createUserStep: CF.Type = + CF.run "create user" + [ "adduser ghc --gecos 'GHC builds' --disabled-password" + , "echo 'ghc ALL = NOPASSWD : ALL' > /etc/sudoers.d/ghc" + ] + # [CF.Statement.User "ghc"] + # CF.workdir "/home/ghc/" +in + +-- Build Haskell tools +let + buildHaskellToolsStep: CF.Type = + CF.run "build haskell tools" + [ "$CABAL user-config update" + , "$CABAL v2-update" + , "$CABAL v2-install hscolour happy alex --constraint='happy ^>= 1.20' --enable-static --install-method=copy --installdir=$HOME/toolchain" + ] + # CF.env (toMap + { HAPPY = "/home/ghc/toolchain/happy" + , ALEX = "/home/ghc/toolchain/alex" + , HSCOLOUR = "/home/ghc/toolchain/hscolour" + }) + +in { + alpine3-12 = + CF.from "alpine:3.12.0" + # CF.emptyLine + # [ CF.Statement.Shell ["/bin/ash", "-eo", "pipefail", "-c"] ] + # CF.run "Installing GHC build dependencies" + [ "apk add --no-cache ${Prelude.Text.concatSep " " build-depends}" + ] + # fetchGhcStep + # createUserStep + # CF.env (toMap { CABAL = "/usr/bin/cabal" }) + # buildHaskellToolsStep + # [ CF.Statement.Cmd ["bash"] ] +} diff --git a/containers.dhall b/containers.dhall new file mode 100644 index 0000000..a221fbb --- /dev/null +++ b/containers.dhall @@ -0,0 +1,20 @@ +let + CF = ./Containerfile.dhall +let + Prelude = ./Prelude.dhall +in + +let + alpine = ./alpine.dhall +let + containers: Prelude.Map.Type Text CF.Type = toMap + { alpine3-12 = alpine.alpine3-12 + } + +let + DockerfileDir: Type = { Dockerfile : Text } +let + toDockerfile: CF.Type -> DockerfileDir = + \(cf: CF.Type) -> { Dockerfile = CF.render cf } + +in Prelude.Map.map Text CF.Type DockerfileDir toDockerfile containers -- GitLab From fa00a83585e799761c3291fac0914e51c25d62cc Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 00:09:10 -0400 Subject: [PATCH 03/74] More work --- GhcBindist.dhall | 38 +++++++++ LlvmBindist.dhall | 42 ++++++++++ alpine.dhall | 40 ++++----- containers.dhall | 7 +- debian.dhall | 201 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 303 insertions(+), 25 deletions(-) create mode 100644 GhcBindist.dhall create mode 100644 LlvmBindist.dhall create mode 100644 debian.dhall diff --git a/GhcBindist.dhall b/GhcBindist.dhall new file mode 100644 index 0000000..7f27561 --- /dev/null +++ b/GhcBindist.dhall @@ -0,0 +1,38 @@ +let + Prelude = ./Prelude.dhall +let + CF = ./Containerfile.dhall + +let + Options = + { Type = + { version : Text + , triple : Text + , destDir : Text + , configureOpts : List Text + } + , default = + { configureOpts = [] : List Text + } + } + +let + install: Options.Type -> CF.Type = + \(opts: Options.Type) -> + let + bindistUrl: Text = "https://downloads.haskell.org/~ghc/${opts.version}/ghc-${opts.version}-${opts.triple}.tar.xz" + in + CF.run "fetch GHC" [ "curl -L ${bindistUrl} | tar -Jx -C /tmp" ] + # CF.workdir "/tmp/ghc-${opts.version}" + # CF.run "configure bindist" + [ "./configure ${Prelude.Text.concatSep " " opts.configureOpts} --prefix=${opts.destDir}" + , "make install" + ] + # CF.workdir "/tmp" + # CF.run "remove temporary directory" [ "rm -Rf /tmp/ghc-${opts.version}" ] + # CF.run "test GHC" [ "${opts.destDir}/bin/ghc --version" ] + +in +{ Options = Options +, install = install +} \ No newline at end of file diff --git a/LlvmBindist.dhall b/LlvmBindist.dhall new file mode 100644 index 0000000..826124b --- /dev/null +++ b/LlvmBindist.dhall @@ -0,0 +1,42 @@ +let + Prelude = ./Prelude.dhall +let + CF = ./Containerfile.dhall + +let + Options = + { Type = + { version : Text + , triple : Text + , destDir : Text + } + , default = {} + } + +let + install: Options.Type -> CF.Type = + \(opts: Options.Type) -> + let + url: Text = "https://releases.llvm.org/${opts.version}/clang+llvm-${opts.version}-${opts.triple}.tar.xz" + in + CF.run "install LLVM for bootstrap GHC" + [ "curl -L ${url} | tar -xJC ." + , "mkdir ${opts.destDir}" + , "cp -R clang+llvm*/* ${opts.destDir}" + , "rm -R clang+llvm*" + , "${opts.destDir}/bin/llc --version" + ] + +let + setEnv: Text -> CF.Type = + \(destDir: Text) -> + CF.env (toMap + { LLC = "${destDir}/bin/llc" + , OPT = "${destDir}/bin/opt" + }) + +in +{ Options = Options +, install = install +, setEnv = setEnv +} diff --git a/alpine.dhall b/alpine.dhall index c0251fc..5664879 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -2,10 +2,9 @@ let CF = ./Containerfile.dhall let Prelude = ./Prelude.dhall -in let - build-depends: List Text = + buildDepends: List Text = [ "autoconf" , "automake" , "binutils-gold" @@ -35,23 +34,28 @@ let , "texmf-dist-latexextra" , "ttf-dejavu" ] -in +let installDepsStep: CF.Type = + CF.run "Installing GHC build dependencies" + [ "apk add --no-cache ${Prelude.Text.concatSep " " buildDepends}" ] + +let + ncursesWorkaroundStep: CF.Type = + -- The ghc-alt-libc bindist requires libtinfow.so.6, so symlink what Alpine + -- provides. This hack can likely be removed when we start using GHC's native + -- Alpine bindists in the future. + CF.run "fix ncurses" ["ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfow.so.6"] -- GHC installation -- NB: This is not an official bindist, but rather an alternative bindist taken -- from https://github.com/redneb/ghc-alt-libc. -let - ghcVersion = "8.8.3" -let - ghcUrl = "https://github.com/redneb/ghc-alt-libc/releases/download/ghc-$GHC_VERSION-musl/ghc-$GHC_VERSION-x86_64-unknown-linux-musl.tar.xz" let fetchGhcStep: CF.Type = - CF.workdir "/tmp" - # CF.run "fetch GHC" [ "curl -L ${ghcUrl} | tar -Jx" ] - -- The ghc-alt-libc bindist requires libtinfow.so.6, so symlink what Alpine - -- provides. This hack can likely be removed when we start using GHC's native - -- Alpine bindists in the future. - # CF.run "fix ncurses" ["ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfow.so.6"] + let + ghcVersion = "8.8.3" + let + ghcUrl = "https://github.com/redneb/ghc-alt-libc/releases/download/ghc-$GHC_VERSION-musl/ghc-$GHC_VERSION-x86_64-unknown-linux-musl.tar.xz" + in + CF.run "fetch GHC" [ "curl -L ${ghcUrl} | tar -Jx -C /tmp" ] # CF.workdir "/tmp/ghc-${ghcVersion}" # CF.run "configure bindist" [ "./configure --disable-ld-override --prefix=/opt/ghc/${ghcVersion}" @@ -60,7 +64,6 @@ let # CF.env (toMap { GHC = "/opt/ghc/${ghcVersion}/bin/ghc" }) # CF.workdir "/tmp" # CF.run "remove temporary directory" [ "rm -Rf /tmp/ghc-${ghcVersion}" ] -in -- Create a normal user let @@ -71,7 +74,6 @@ let ] # [CF.Statement.User "ghc"] # CF.workdir "/home/ghc/" -in -- Build Haskell tools let @@ -88,13 +90,11 @@ let }) in { - alpine3-12 = + x86_64-linux-alpine3_12 = CF.from "alpine:3.12.0" - # CF.emptyLine # [ CF.Statement.Shell ["/bin/ash", "-eo", "pipefail", "-c"] ] - # CF.run "Installing GHC build dependencies" - [ "apk add --no-cache ${Prelude.Text.concatSep " " build-depends}" - ] + # installDepsStep + # ncursesWorkaroundStep # fetchGhcStep # createUserStep # CF.env (toMap { CABAL = "/usr/bin/cabal" }) diff --git a/containers.dhall b/containers.dhall index a221fbb..60f786a 100644 --- a/containers.dhall +++ b/containers.dhall @@ -5,11 +5,8 @@ let in let - alpine = ./alpine.dhall -let - containers: Prelude.Map.Type Text CF.Type = toMap - { alpine3-12 = alpine.alpine3-12 - } + containers: Prelude.Map.Type Text CF.Type = + toMap (./alpine.dhall /\ ./debian.dhall) let DockerfileDir: Type = { Dockerfile : Text } diff --git a/debian.dhall b/debian.dhall new file mode 100644 index 0000000..0479a27 --- /dev/null +++ b/debian.dhall @@ -0,0 +1,201 @@ +let + CF = ./Containerfile.dhall +let + Prelude = ./Prelude.dhall +let + LlvmBindist = ./LlvmBindist.dhall +let + GhcBindist = ./GhcBindist.dhall + +let + buildDepends: List Text = + [ "zlib1g-dev" + , "libtinfo-dev" + , "libsqlite3-0" + , "libsqlite3-dev" + , "ca-certificates" + , "g++" + , "git" + , "make" + , "automake" + , "autoconf" + , "gcc" + , "perl" + , "python3" + , "texinfo" + , "xz-utils" + , "lbzip2" + , "bzip2" + , "patch" + , "openssh-client" + , "sudo" + , "time" + , "jq" + , "wget" + , "curl" + , "locales" + , "libnuma-dev" + -- For LLVM + , "libtinfo5" + -- Documentation tools + , "python3-sphinx" + , "texlive-xetex" + , "texlive-latex-extra" + , "texlive-binaries" + , "texlive-fonts-recommended" + , "lmodern" + , "texlive-generic-extra" + ] +let + installDepsStep: CF.Type = + CF.run "install build dependencies" + [ "apt-get update" + , "apt-get install --no-install-recommends -qy ${Prelude.Text.concatSep " " buildDepends}" + , "apt-get clean" + , "rm -rf /var/lib/apt/lists/*" + ] + + +-- Install cabal-install +let + installCabalStep: Text -> CF.Type = + \(bindistUrl: Text) -> + CF.run "install cabal" + [ "curl -L ${bindistUrl} | tar -Jx" + , "mv cabal /usr/local/bin/cabal" + , "/usr/local/bin/cabal --version" + ] + # CF.env (toMap { CABAL = "/usr/local/bin/cabal" }) + +-- Create a normal user +let + createUserStep: CF.Type = + CF.run "create user" + [ "adduser ghc --gecos 'GHC builds' --disabled-password" + , "echo 'ghc ALL = NOPASSWD : ALL' > /etc/sudoers.d/ghc" + ] + # [CF.Statement.User "ghc"] + # CF.workdir "/home/ghc/" + +-- Build Haskell tools +let + buildHaskellToolsStep: CF.Type = + CF.run "build haskell tools" + [ "$CABAL user-config update" + , "$CABAL v2-update" + , "$CABAL v2-install hscolour happy alex --constraint='happy ^>= 1.20' --enable-static --install-method=copy --installdir=$HOME/toolchain" + ] + # CF.env (toMap + { HAPPY = "/home/ghc/toolchain/happy" + , ALEX = "/home/ghc/toolchain/alex" + , HSCOLOUR = "/home/ghc/toolchain/hscolour" + }) + +let + DebianImage = + let + TripleVersion: Type = + { triple : Text, version: Text } + let + type: Type = + { fromImage : Text + , bootstrapLlvm : Optional TripleVersion + , bootstrapGhc : TripleVersion + , llvm : TripleVersion + , ghcVersion : Text + } + let + toDocker: type -> CF.Type = \(opts : type) -> + let + ghcDir: Text = "/opt/ghc/${opts.ghcVersion}" + let + bootLlvmDir: Text = "/opt/llvm-bootstrap" + let + llvmDir: Text = "/opt/llvm" + let + installBootstrapLlvm = + merge { Some = \(llvmOpts: TripleVersion) -> + LlvmBindist.install (llvmOpts /\ { destDir = bootLlvmDir }) + , None = [] : CF.Type + } opts.bootstrapLlvm + let + bootstrapLlvmConfigureOptions = + merge { Some = \(_: TripleVersion) -> [ "LLC=${bootLlvmDir}/bin/llc", "OPT=${bootLlvmDir}/bin/opt" ] + , None = [] : List Text + } opts.bootstrapLlvm + + in + CF.from opts.fromImage + # CF.env (toMap { LANG = "C.UTF-8" }) + # [ CF.Statement.Shell ["/bin/bash", "-o", "pipefail", "-c"] ] + # installDepsStep + + -- install LLVM for bootstrap GHC + # installBootstrapLlvm + + -- install GHC + # GhcBindist.install + { version = opts.bootstrapGhc.version + , triple = opts.bootstrapGhc.triple + , destDir = "/opt/ghc/${ghcDir}" + , configureOpts = [ "LLC=${bootLlvmDir}/bin/llc", "OPT=${bootLlvmDir}/bin/opt" ] + } + # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) + + -- install LLVM to be used by built compiler + # LlvmBindist.install (opts.llvm /\ { destDir = llvmDir }) + # LlvmBindist.setEnv llvmDir + + -- install cabal-install + # installCabalStep "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" + # CF.env (toMap { CABAL = "/usr/bin/cabal" }) + + -- install hscolour, alex, and happy + # buildHaskellToolsStep + + # createUserStep + # [ CF.Statement.Cmd ["bash"] ] + in + { Type = type + , TripleVersion = TripleVersion + , toDocker = toDocker + } + +in +{ aarch64-linux-deb10 = + DebianImage.toDocker + { fromImage = "arm64v8/debian:buster" + , bootstrapLlvm = Some { version = "7.0.0" , triple = "aarch64-linux-gnu" } + , bootstrapGhc = { version = "8.8.3", triple = "aarch64-deb9-linux" } + , llvm = { version = "10.0.0" , triple = "aarch64-linux-gnu" } + , ghcVersion = "8.8.3" + } + +, armv7l-linux-deb10 = + DebianImage.toDocker + { fromImage = "amd64/debian:buster" + , bootstrapLlvm = Some { version = "7.0.0", triple = "armv7a-linux-gnueabihf" } + , bootstrapGhc = { version = "8.8.3", triple = "armv7l-deb9-linux" } + , llvm = { version = "10.0.0" , triple = "armv7a-linux-gnueabihf" } + , ghcVersion = "8.8.3" + } + +, i386-linux-deb10 = + DebianImage.toDocker + { fromImage = "amd64/debian:buster" + , bootstrapLlvm = None DebianImage.TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "i386-linux-gnu-linux" } + , llvm = { version = "10.0.0" , triple = "i386-linux-gnu" } + , ghcVersion = "8.8.3" + } + +, x86_64-linux-deb10 = + DebianImage.toDocker + { fromImage = "amd64/debian:buster" + , bootstrapLlvm = None DebianImage.TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "aarch64-linux-gnu-linux" } + , llvm = { version = "10.0.0" , triple = "aarch64-linux-gnu" } + , ghcVersion = "8.8.3" + } +} + -- GitLab From a5a7148ddbfdce91386f48f4e9e776a8feab1500 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 00:17:51 -0400 Subject: [PATCH 04/74] Revamp CI --- .gitlab-ci.yml | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fda893e..30a33fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,24 @@ -image: docker:19.03 - stages: + - prepare - lint - build -services: - - docker:19.03-dind - -variables: - CONTAINER_IMAGE_BASE: registry.gitlab.haskell.org/$CI_PROJECT_PATH - DOCKER_DRIVER: overlay2 - DOCKER_TLS_CERTDIR: "/certs" +generate: + stage: prepare + image: debian:buster + variables: + DHALL_URL: https://github.com/dhall-lang/dhall-haskell/releases/download/1.34.0/dhall-1.34.0-x86_64-linux.tar.bz2 + tags: + - x86_64-linux + script: + - mkdir -p dockerfiles + - apt-get update + - apt-get install -y curl tar bzip2 + - curl -L $DHALL_URL | tar -jx + - ./bin/dhall to-directory-tree --file=containers.dhall --output=dockerfiles + artifacts: + paths: + - dockerfiles lint: stage: lint @@ -18,13 +26,25 @@ lint: tags: - x86_64-linux script: + - cd dockerfiles - find . -name "Dockerfile" -print0 | xargs -0 -n1 hadolint .build: stage: build before_script: - docker info + + image: docker:19.03 + services: + - docker:19.03-dind + + variables: + CONTAINER_IMAGE_BASE: registry.gitlab.haskell.org/$CI_PROJECT_PATH + DOCKER_DRIVER: overlay2 + DOCKER_TLS_CERTDIR: "/certs" + script: + - cd dockerfiles - | CONTAINER_IMAGE="$CONTAINER_IMAGE_BASE/$IMAGE" docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY -- GitLab From f3d2755bd0d8f34b8b5a14825ddf866146c5847a Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 00:44:20 -0400 Subject: [PATCH 05/74] Use my dhall-containerfile fork --- Containerfile.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Containerfile.dhall b/Containerfile.dhall index 79bd23d..6bf57ed 100644 --- a/Containerfile.dhall +++ b/Containerfile.dhall @@ -1,2 +1,2 @@ --https://raw.githubusercontent.com/softwarefactory-project/dhall-containerfile/e3ea2f2e02bd979b4255dfbc5d7086dbbfcbc6c2/package.dhall -./dhall-containerfile/package.dhall +https://raw.githubusercontent.com/bgamari/dhall-containerfile/2b690b52bfc0177f14e0500567ea31af56ef2726/package.dhall -- GitLab From 6b095adc7f08900736a9069d3514240f084d35e6 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 00:46:53 -0400 Subject: [PATCH 06/74] Disable linting for now --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 30a33fc..37c6ed1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ generate: paths: - dockerfiles -lint: +.lint: stage: lint image: hadolint/hadolint:latest-debian tags: -- GitLab From 94f90fbe8a653353a779529a174d526de8f606ab Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 01:15:54 -0400 Subject: [PATCH 07/74] Add centos --- HaskellTools.dhall | 20 ++++++ alpine.dhall | 55 +++++----------- centos.dhall | 160 +++++++++++++++++++++++++++++++++++++++++++++ containers.dhall | 2 +- debian.dhall | 24 ++----- 5 files changed, 203 insertions(+), 58 deletions(-) create mode 100644 HaskellTools.dhall create mode 100644 centos.dhall diff --git a/HaskellTools.dhall b/HaskellTools.dhall new file mode 100644 index 0000000..a3210fd --- /dev/null +++ b/HaskellTools.dhall @@ -0,0 +1,20 @@ +let + CF = ./Containerfile.dhall + +let + build: CF.Type = + CF.run "build haskell tools" + [ "$CABAL user-config update" + , "$CABAL v2-update" + , "$CABAL v2-install hscolour happy alex --constraint='happy ^>= 1.20' --enable-static --install-method=copy --installdir=$HOME/toolchain" + ] + # CF.env (toMap + { HAPPY = "/home/ghc/toolchain/happy" + , ALEX = "/home/ghc/toolchain/alex" + , HSCOLOUR = "/home/ghc/toolchain/hscolour" + }) + +in +{ + build = build +} \ No newline at end of file diff --git a/alpine.dhall b/alpine.dhall index 5664879..66552a8 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -1,7 +1,9 @@ +let + Prelude = ./Prelude.dhall let CF = ./Containerfile.dhall let - Prelude = ./Prelude.dhall + HaskellTools = ./HaskellTools.dhall let buildDepends: List Text = @@ -39,31 +41,21 @@ let installDepsStep: CF.Type = [ "apk add --no-cache ${Prelude.Text.concatSep " " buildDepends}" ] let - ncursesWorkaroundStep: CF.Type = - -- The ghc-alt-libc bindist requires libtinfow.so.6, so symlink what Alpine - -- provides. This hack can likely be removed when we start using GHC's native - -- Alpine bindists in the future. - CF.run "fix ncurses" ["ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfow.so.6"] + LlvmBindist = ./LlvmBindist.dhall +let + GhcBindist = ./GhcBindist.dhall + +let + ghcVersion: Text = "8.8.4" --- GHC installation --- NB: This is not an official bindist, but rather an alternative bindist taken --- from https://github.com/redneb/ghc-alt-libc. let fetchGhcStep: CF.Type = - let - ghcVersion = "8.8.3" - let - ghcUrl = "https://github.com/redneb/ghc-alt-libc/releases/download/ghc-$GHC_VERSION-musl/ghc-$GHC_VERSION-x86_64-unknown-linux-musl.tar.xz" - in - CF.run "fetch GHC" [ "curl -L ${ghcUrl} | tar -Jx -C /tmp" ] - # CF.workdir "/tmp/ghc-${ghcVersion}" - # CF.run "configure bindist" - [ "./configure --disable-ld-override --prefix=/opt/ghc/${ghcVersion}" - , "make install" - ] - # CF.env (toMap { GHC = "/opt/ghc/${ghcVersion}/bin/ghc" }) - # CF.workdir "/tmp" - # CF.run "remove temporary directory" [ "rm -Rf /tmp/ghc-${ghcVersion}" ] + GhcBindist.install + { version = ghcVersion + , triple = "x86_64-alpine-3.10-linux-integer-simple" + , destDir = "/opt/ghc/${ghcVersion}" + , configureOpts = [] : List Text + } -- Create a normal user let @@ -75,29 +67,14 @@ let # [CF.Statement.User "ghc"] # CF.workdir "/home/ghc/" --- Build Haskell tools -let - buildHaskellToolsStep: CF.Type = - CF.run "build haskell tools" - [ "$CABAL user-config update" - , "$CABAL v2-update" - , "$CABAL v2-install hscolour happy alex --constraint='happy ^>= 1.20' --enable-static --install-method=copy --installdir=$HOME/toolchain" - ] - # CF.env (toMap - { HAPPY = "/home/ghc/toolchain/happy" - , ALEX = "/home/ghc/toolchain/alex" - , HSCOLOUR = "/home/ghc/toolchain/hscolour" - }) - in { x86_64-linux-alpine3_12 = CF.from "alpine:3.12.0" # [ CF.Statement.Shell ["/bin/ash", "-eo", "pipefail", "-c"] ] # installDepsStep - # ncursesWorkaroundStep # fetchGhcStep # createUserStep # CF.env (toMap { CABAL = "/usr/bin/cabal" }) - # buildHaskellToolsStep + # HaskellTools.build # [ CF.Statement.Cmd ["bash"] ] } diff --git a/centos.dhall b/centos.dhall new file mode 100644 index 0000000..e328b47 --- /dev/null +++ b/centos.dhall @@ -0,0 +1,160 @@ +let + Prelude = ./Prelude.dhall +let + CF = ./Containerfile.dhall +let + LlvmBindist = ./LlvmBindist.dhall +let + GhcBindist = ./GhcBindist.dhall +let + HaskellTools = ./HaskellTools.dhall + +let + coreBuildDepends: List Text = + [ "coreutils" + , "binutils" + , "which" + , "git" + , "make" + , "automake" + , "autoconf" + , "gcc" + , "perl" + , "python3" + , "texinfo" + , "xz" + , "pxz" + , "lbzip2" + , "bzip2" + , "patch" + , "openssh-clients" + , "sudo" + , "zlib-devel" + , "sqlite" + , "ncurses-compat-libs" + , "gmp-devel" + , "ncurses-devel" + , "gcc-c++" + , "findutils" + , "curl" + , "wget" + , "jq" + ] + +let + docBuildDepends: List Text = + [ "python-sphinx" + , "texlive" + , "texlive-latex" + , "texlive-xetex" + , "texlive-collection-latex" + , "texlive-collection-latexrecommended" + , "texlive-xetex-def" + , "texlive-collection-xetex" + , "python-sphinx-latex" + , "dejavu-sans-fonts" + , "dejavu-serif-fonts" + , "dejavu-sans-mono-fonts" + ] + +let + buildDepends: List Text = coreBuildDepends # docBuildDepends + +-- systemd isn't running so remove it from nsswitch.conf +-- Failing to do this will result in testsuite failures due to +-- non-functional user lookup (#15230). +let + nsswitchWorkaroundStep: CF.Type = + CF.run "apply nsswitch workaround" + [ "sed -i -e 's/systemd//g' /etc/nsswitch.conf" ] + +let + installDepsStep: CF.Type = + CF.run "install build dependencies" + [ "yum -y install ${Prelude.Text.concatSep " " buildDepends}" ] + +-- Install cabal-install +let + installCabalStep: Text -> CF.Type = + \(bindistUrl: Text) -> + CF.run "install cabal" + [ "curl -L ${bindistUrl} | tar -Jx" + , "mv cabal /usr/local/bin/cabal" + , "/usr/local/bin/cabal --version" + ] + # CF.env (toMap { CABAL = "/usr/local/bin/cabal" }) + +-- Create a normal user +let + createUserStep: CF.Type = + CF.run "create user" + [ "adduser ghc --gecos 'GHC builds' --disabled-password" + , "echo 'ghc ALL = NOPASSWD : ALL' > /etc/sudoers.d/ghc" + ] + # [CF.Statement.User "ghc"] + # CF.workdir "/home/ghc/" + +let + CentosImage = + let + TripleVersion: Type = + { triple : Text, version: Text } + let + type: Type = + { fromImage : Text + , bootstrapGhc : TripleVersion + , llvm : TripleVersion + , ghcVersion : Text + } + let + toDocker: type -> CF.Type = \(opts : type) -> + let + ghcDir: Text = "/opt/ghc/${opts.ghcVersion}" + let + llvmDir: Text = "/opt/llvm" + + in + CF.from opts.fromImage + # CF.env (toMap { LANG = "C.UTF-8" }) + # [ CF.Statement.Shell ["/bin/bash", "-o", "pipefail", "-c"] ] + # installDepsStep + + # nsswitchWorkaroundStep + + -- install GHC + # GhcBindist.install + { version = opts.bootstrapGhc.version + , triple = opts.bootstrapGhc.triple + , destDir = ghcDir + , configureOpts = [] : List Text + } + # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) + + -- install LLVM to be used by built compiler + # LlvmBindist.install (opts.llvm /\ { destDir = llvmDir }) + # LlvmBindist.setEnv llvmDir + + -- install cabal-install + # installCabalStep "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" + # CF.env (toMap { CABAL = "/usr/bin/cabal" }) + + -- install hscolour, alex, and happy + # HaskellTools.build + + # createUserStep + # [ CF.Statement.Cmd ["bash"] ] + in + { Type = type + , TripleVersion = TripleVersion + , toDocker = toDocker + } + +in +{ x86_64-linux-centos7 = + CentosImage.toDocker + { fromImage = "centos:7" + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-linux-centos7" } + , llvm = { version = "10.0.0" , triple = "aarch64-linux-gnu" } + , ghcVersion = "8.8.3" + } +} \ No newline at end of file diff --git a/containers.dhall b/containers.dhall index 60f786a..0da1b1d 100644 --- a/containers.dhall +++ b/containers.dhall @@ -6,7 +6,7 @@ in let containers: Prelude.Map.Type Text CF.Type = - toMap (./alpine.dhall /\ ./debian.dhall) + toMap (./alpine.dhall /\ ./debian.dhall /\ ./centos.dhall) let DockerfileDir: Type = { Dockerfile : Text } diff --git a/debian.dhall b/debian.dhall index 0479a27..a03a6f6 100644 --- a/debian.dhall +++ b/debian.dhall @@ -1,11 +1,13 @@ -let - CF = ./Containerfile.dhall let Prelude = ./Prelude.dhall +let + CF = ./Containerfile.dhall let LlvmBindist = ./LlvmBindist.dhall let GhcBindist = ./GhcBindist.dhall +let + HaskellTools = ./HaskellTools.dhall let buildDepends: List Text = @@ -77,20 +79,6 @@ let # [CF.Statement.User "ghc"] # CF.workdir "/home/ghc/" --- Build Haskell tools -let - buildHaskellToolsStep: CF.Type = - CF.run "build haskell tools" - [ "$CABAL user-config update" - , "$CABAL v2-update" - , "$CABAL v2-install hscolour happy alex --constraint='happy ^>= 1.20' --enable-static --install-method=copy --installdir=$HOME/toolchain" - ] - # CF.env (toMap - { HAPPY = "/home/ghc/toolchain/happy" - , ALEX = "/home/ghc/toolchain/alex" - , HSCOLOUR = "/home/ghc/toolchain/hscolour" - }) - let DebianImage = let @@ -137,7 +125,7 @@ let # GhcBindist.install { version = opts.bootstrapGhc.version , triple = opts.bootstrapGhc.triple - , destDir = "/opt/ghc/${ghcDir}" + , destDir = ghcDir , configureOpts = [ "LLC=${bootLlvmDir}/bin/llc", "OPT=${bootLlvmDir}/bin/opt" ] } # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) @@ -151,7 +139,7 @@ let # CF.env (toMap { CABAL = "/usr/bin/cabal" }) -- install hscolour, alex, and happy - # buildHaskellToolsStep + # HaskellTools.build # createUserStep # [ CF.Statement.Cmd ["bash"] ] -- GitLab From cc506087ea52075666d0e7e11afc68b433fc116f Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 01:17:57 -0400 Subject: [PATCH 08/74] hi --- debian.dhall | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/debian.dhall b/debian.dhall index a03a6f6..c549f7f 100644 --- a/debian.dhall +++ b/debian.dhall @@ -161,7 +161,7 @@ in , armv7l-linux-deb10 = DebianImage.toDocker - { fromImage = "amd64/debian:buster" + { fromImage = "arm32v7/debian:buster" , bootstrapLlvm = Some { version = "7.0.0", triple = "armv7a-linux-gnueabihf" } , bootstrapGhc = { version = "8.8.3", triple = "armv7l-deb9-linux" } , llvm = { version = "10.0.0" , triple = "armv7a-linux-gnueabihf" } @@ -170,9 +170,9 @@ in , i386-linux-deb10 = DebianImage.toDocker - { fromImage = "amd64/debian:buster" + { fromImage = "i386/debian:buster" , bootstrapLlvm = None DebianImage.TripleVersion - , bootstrapGhc = { version = "8.8.3", triple = "i386-linux-gnu-linux" } + , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } , llvm = { version = "10.0.0" , triple = "i386-linux-gnu" } , ghcVersion = "8.8.3" } @@ -181,8 +181,8 @@ in DebianImage.toDocker { fromImage = "amd64/debian:buster" , bootstrapLlvm = None DebianImage.TripleVersion - , bootstrapGhc = { version = "8.8.3", triple = "aarch64-linux-gnu-linux" } - , llvm = { version = "10.0.0" , triple = "aarch64-linux-gnu" } + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } + , llvm = { version = "10.0.0" , triple = "x86_64-linux-gnu" } , ghcVersion = "8.8.3" } } -- GitLab From 51b6c7dbfe2babc83b75d7ee42b02fe517c235fa Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 01:42:56 -0400 Subject: [PATCH 09/74] hi --- LlvmBindist.dhall | 9 +++++++++ debian.dhall | 21 +++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/LlvmBindist.dhall b/LlvmBindist.dhall index 826124b..2e76128 100644 --- a/LlvmBindist.dhall +++ b/LlvmBindist.dhall @@ -27,6 +27,14 @@ let , "${opts.destDir}/bin/llc --version" ] +let + maybeInstallTo: Text -> Optional { triple: Text, version: Text } -> CF.Type = + \(destDir: Text) -> \(opts: Optional {triple: Text, version: Text}) -> + merge + { Some = \(tv: {triple: Text, version: Text}) -> install (tv /\ { destDir = destDir }) + , None = [] : CF.Type + } opts + let setEnv: Text -> CF.Type = \(destDir: Text) -> @@ -38,5 +46,6 @@ let in { Options = Options , install = install +, maybeInstallTo = maybeInstallTo , setEnv = setEnv } diff --git a/debian.dhall b/debian.dhall index c549f7f..7c1537a 100644 --- a/debian.dhall +++ b/debian.dhall @@ -9,6 +9,10 @@ let let HaskellTools = ./HaskellTools.dhall +let + TripleVersion: Type = + { triple : Text, version: Text } + let buildDepends: List Text = [ "zlib1g-dev" @@ -81,15 +85,12 @@ let let DebianImage = - let - TripleVersion: Type = - { triple : Text, version: Text } let type: Type = { fromImage : Text , bootstrapLlvm : Optional TripleVersion , bootstrapGhc : TripleVersion - , llvm : TripleVersion + , llvm : Optional TripleVersion , ghcVersion : Text } let @@ -119,7 +120,7 @@ let # installDepsStep -- install LLVM for bootstrap GHC - # installBootstrapLlvm + # LlvmBindist.maybeInstallTo bootLlvmDir opts.bootstrapLlvm -- install GHC # GhcBindist.install @@ -131,7 +132,7 @@ let # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) -- install LLVM to be used by built compiler - # LlvmBindist.install (opts.llvm /\ { destDir = llvmDir }) + # LlvmBindist.maybeInstallTo llvmDir opts.llvm # LlvmBindist.setEnv llvmDir -- install cabal-install @@ -155,7 +156,7 @@ in { fromImage = "arm64v8/debian:buster" , bootstrapLlvm = Some { version = "7.0.0" , triple = "aarch64-linux-gnu" } , bootstrapGhc = { version = "8.8.3", triple = "aarch64-deb9-linux" } - , llvm = { version = "10.0.0" , triple = "aarch64-linux-gnu" } + , llvm = Some { version = "10.0.0" , triple = "aarch64-linux-gnu" } , ghcVersion = "8.8.3" } @@ -164,7 +165,7 @@ in { fromImage = "arm32v7/debian:buster" , bootstrapLlvm = Some { version = "7.0.0", triple = "armv7a-linux-gnueabihf" } , bootstrapGhc = { version = "8.8.3", triple = "armv7l-deb9-linux" } - , llvm = { version = "10.0.0" , triple = "armv7a-linux-gnueabihf" } + , llvm = Some { version = "10.0.0" , triple = "armv7a-linux-gnueabihf" } , ghcVersion = "8.8.3" } @@ -173,7 +174,7 @@ in { fromImage = "i386/debian:buster" , bootstrapLlvm = None DebianImage.TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } - , llvm = { version = "10.0.0" , triple = "i386-linux-gnu" } + , llvm = None TripleVersion , ghcVersion = "8.8.3" } @@ -182,7 +183,7 @@ in { fromImage = "amd64/debian:buster" , bootstrapLlvm = None DebianImage.TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } - , llvm = { version = "10.0.0" , triple = "x86_64-linux-gnu" } + , llvm = Some { version = "10.0.0" , triple = "x86_64-linux-gnu" } , ghcVersion = "8.8.3" } } -- GitLab From 13f31f0abfb1f5d026cad5e9ead2f234f5b6a717 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 02:03:49 -0400 Subject: [PATCH 10/74] Try it again --- Cabal.dhall | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ alpine.dhall | 4 +++- centos.dhall | 16 +++------------ debian.dhall | 21 ++++++++------------ 4 files changed, 69 insertions(+), 27 deletions(-) create mode 100644 Cabal.dhall diff --git a/Cabal.dhall b/Cabal.dhall new file mode 100644 index 0000000..c43f4ee --- /dev/null +++ b/Cabal.dhall @@ -0,0 +1,55 @@ +let + CF = ./Containerfile.dhall + +let + setEnv: Text -> CF.Type = + \(path: Text) -> + CF.env (toMap { CABAL = path }) + +let + installFromBindist: Text -> CF.Type = + \(bindistUrl: Text) -> + let + path: Text = "/usr/local/bin/cabal" + in + CF.run "install cabal" + [ "curl -L ${bindistUrl} | tar -Jx" + , "mv cabal ${path}" + , "${path} --version" + ] + # setEnv path + +let + installFromSource: Text -> CF.Type = + \(version: Text) -> + let + path: Text = "/usr/local/bin/cabal" + in + CF.run "install cabal" + [ "cabal update" + , "cabal install cabal-install==${version}" + , "mv $HOME/.cabal/bin/cabal ${path}" + , "${path} --version" + ] + # setEnv path + +let + type: Type = + < FromBindist : Text + | FromSource : Text + | FromDistribution : Text + > + +let + install: type -> CF.Type = + \(src: type) -> + merge + { FromBindist = installFromBindist + , FromSource = installFromSource + , FromDistribution = setEnv + } src + +in +{ Type = type +, install = install +} \ No newline at end of file diff --git a/alpine.dhall b/alpine.dhall index 66552a8..10d3c45 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -4,6 +4,8 @@ let CF = ./Containerfile.dhall let HaskellTools = ./HaskellTools.dhall +let + Cabal = ./Cabal.dhall let buildDepends: List Text = @@ -74,7 +76,7 @@ in { # installDepsStep # fetchGhcStep # createUserStep - # CF.env (toMap { CABAL = "/usr/bin/cabal" }) + # Cabal.install (Cabal.Type.FromDistribution "/usr/bin/cabal") # HaskellTools.build # [ CF.Statement.Cmd ["bash"] ] } diff --git a/centos.dhall b/centos.dhall index e328b47..d86b83e 100644 --- a/centos.dhall +++ b/centos.dhall @@ -8,6 +8,8 @@ let GhcBindist = ./GhcBindist.dhall let HaskellTools = ./HaskellTools.dhall +let + Cabal = ./Cabal.dhall let coreBuildDepends: List Text = @@ -73,17 +75,6 @@ let CF.run "install build dependencies" [ "yum -y install ${Prelude.Text.concatSep " " buildDepends}" ] --- Install cabal-install -let - installCabalStep: Text -> CF.Type = - \(bindistUrl: Text) -> - CF.run "install cabal" - [ "curl -L ${bindistUrl} | tar -Jx" - , "mv cabal /usr/local/bin/cabal" - , "/usr/local/bin/cabal --version" - ] - # CF.env (toMap { CABAL = "/usr/local/bin/cabal" }) - -- Create a normal user let createUserStep: CF.Type = @@ -135,8 +126,7 @@ let # LlvmBindist.setEnv llvmDir -- install cabal-install - # installCabalStep "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" - # CF.env (toMap { CABAL = "/usr/bin/cabal" }) + # Cabal.install (Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz") -- install hscolour, alex, and happy # HaskellTools.build diff --git a/debian.dhall b/debian.dhall index 7c1537a..552bea1 100644 --- a/debian.dhall +++ b/debian.dhall @@ -8,6 +8,8 @@ let GhcBindist = ./GhcBindist.dhall let HaskellTools = ./HaskellTools.dhall +let + Cabal = ./Cabal.dhall let TripleVersion: Type = @@ -61,18 +63,6 @@ let , "rm -rf /var/lib/apt/lists/*" ] - --- Install cabal-install -let - installCabalStep: Text -> CF.Type = - \(bindistUrl: Text) -> - CF.run "install cabal" - [ "curl -L ${bindistUrl} | tar -Jx" - , "mv cabal /usr/local/bin/cabal" - , "/usr/local/bin/cabal --version" - ] - # CF.env (toMap { CABAL = "/usr/local/bin/cabal" }) - -- Create a normal user let createUserStep: CF.Type = @@ -92,6 +82,7 @@ let , bootstrapGhc : TripleVersion , llvm : Optional TripleVersion , ghcVersion : Text + , cabalSource : Cabal.Type } let toDocker: type -> CF.Type = \(opts : type) -> @@ -136,7 +127,7 @@ let # LlvmBindist.setEnv llvmDir -- install cabal-install - # installCabalStep "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" + # Cabal.install opts.cabalSource # CF.env (toMap { CABAL = "/usr/bin/cabal" }) -- install hscolour, alex, and happy @@ -158,6 +149,7 @@ in , bootstrapGhc = { version = "8.8.3", triple = "aarch64-deb9-linux" } , llvm = Some { version = "10.0.0" , triple = "aarch64-linux-gnu" } , ghcVersion = "8.8.3" + , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" } , armv7l-linux-deb10 = @@ -167,6 +159,7 @@ in , bootstrapGhc = { version = "8.8.3", triple = "armv7l-deb9-linux" } , llvm = Some { version = "10.0.0" , triple = "armv7a-linux-gnueabihf" } , ghcVersion = "8.8.3" + , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" } , i386-linux-deb10 = @@ -176,6 +169,7 @@ in , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } , llvm = None TripleVersion , ghcVersion = "8.8.3" + , cabalSource = Cabal.Type.FromDistribution "/usr/bin/cabal" } , x86_64-linux-deb10 = @@ -185,6 +179,7 @@ in , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } , llvm = Some { version = "10.0.0" , triple = "x86_64-linux-gnu" } , ghcVersion = "8.8.3" + , cabalSource = Cabal.Type.FromSource "3.2.0.0" } } -- GitLab From e6ae20815c8c884314dc22303c032b210c1baced Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 02:12:42 -0400 Subject: [PATCH 11/74] Keep going --- Cabal.dhall | 5 +++++ centos.dhall | 2 +- debian.dhall | 5 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Cabal.dhall b/Cabal.dhall index c43f4ee..b0f6ea7 100644 --- a/Cabal.dhall +++ b/Cabal.dhall @@ -40,6 +40,10 @@ let | FromDistribution : Text > +let fromUpstreamBindist = + \(opts: { triple: Text, version: Text }) -> + type.FromDistribution "https://downloads.haskell.org/cabal/cabal-install-${opts.version}/cabal-install-${opts.version}-${opts.triple}.tar.xz" + let install: type -> CF.Type = \(src: type) -> @@ -52,4 +56,5 @@ let in { Type = type , install = install +, fromUpstreamBindist = fromUpstreamBindist } \ No newline at end of file diff --git a/centos.dhall b/centos.dhall index d86b83e..c2acdb1 100644 --- a/centos.dhall +++ b/centos.dhall @@ -126,7 +126,7 @@ let # LlvmBindist.setEnv llvmDir -- install cabal-install - # Cabal.install (Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz") + # Cabal.install (Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" }) -- install hscolour, alex, and happy # HaskellTools.build diff --git a/debian.dhall b/debian.dhall index 552bea1..617f0db 100644 --- a/debian.dhall +++ b/debian.dhall @@ -169,7 +169,7 @@ in , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } , llvm = None TripleVersion , ghcVersion = "8.8.3" - , cabalSource = Cabal.Type.FromDistribution "/usr/bin/cabal" + , cabalSource = Cabal.Type.FromSource "3.2.0.0" } , x86_64-linux-deb10 = @@ -179,7 +179,8 @@ in , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } , llvm = Some { version = "10.0.0" , triple = "x86_64-linux-gnu" } , ghcVersion = "8.8.3" - , cabalSource = Cabal.Type.FromSource "3.2.0.0" + , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } + } } -- GitLab From a6a364e9644d66bab382485aa26f0bd9cf95395d Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 02:18:14 -0400 Subject: [PATCH 12/74] Fix it --- debian.dhall | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/debian.dhall b/debian.dhall index 617f0db..1511dde 100644 --- a/debian.dhall +++ b/debian.dhall @@ -83,7 +83,9 @@ let , llvm : Optional TripleVersion , ghcVersion : Text , cabalSource : Cabal.Type + , extraPackages: List Text } + let toDocker: type -> CF.Type = \(opts : type) -> let @@ -150,6 +152,7 @@ in , llvm = Some { version = "10.0.0" , triple = "aarch64-linux-gnu" } , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" + , extraPackages = [] : List Text } , armv7l-linux-deb10 = @@ -160,6 +163,7 @@ in , llvm = Some { version = "10.0.0" , triple = "armv7a-linux-gnueabihf" } , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" + , extraPackages = [] : List Text } , i386-linux-deb10 = @@ -170,6 +174,7 @@ in , llvm = None TripleVersion , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromSource "3.2.0.0" + , extraPackages = [ "cabal-install" ] : List Text } , x86_64-linux-deb10 = @@ -180,7 +185,7 @@ in , llvm = Some { version = "10.0.0" , triple = "x86_64-linux-gnu" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } - + , extraPackages = [] : List Text } } -- GitLab From 47b5360c4cf36158b06f525a9ba2b6519981c01a Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 02:19:40 -0400 Subject: [PATCH 13/74] hi --- debian.dhall | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/debian.dhall b/debian.dhall index 1511dde..e4289dc 100644 --- a/debian.dhall +++ b/debian.dhall @@ -55,10 +55,11 @@ let , "texlive-generic-extra" ] let - installDepsStep: CF.Type = + installPackages: List Text -> CF.Type = + \(pkgs: List Text) -> CF.run "install build dependencies" [ "apt-get update" - , "apt-get install --no-install-recommends -qy ${Prelude.Text.concatSep " " buildDepends}" + , "apt-get install --no-install-recommends -qy ${Prelude.Text.concatSep " " pkgs}" , "apt-get clean" , "rm -rf /var/lib/apt/lists/*" ] @@ -110,7 +111,7 @@ let CF.from opts.fromImage # CF.env (toMap { LANG = "C.UTF-8" }) # [ CF.Statement.Shell ["/bin/bash", "-o", "pipefail", "-c"] ] - # installDepsStep + # installPackages (buildDepends # opts.extraPackages) -- install LLVM for bootstrap GHC # LlvmBindist.maybeInstallTo bootLlvmDir opts.bootstrapLlvm -- GitLab From 58ccc0942b0bd5002e6a7254cb88cf77d3e6520c Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 02:38:07 -0400 Subject: [PATCH 14/74] hi --- LlvmBindist.dhall | 3 ++- centos.dhall | 2 +- debian.dhall | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/LlvmBindist.dhall b/LlvmBindist.dhall index 2e76128..34c03ed 100644 --- a/LlvmBindist.dhall +++ b/LlvmBindist.dhall @@ -17,7 +17,8 @@ let install: Options.Type -> CF.Type = \(opts: Options.Type) -> let - url: Text = "https://releases.llvm.org/${opts.version}/clang+llvm-${opts.version}-${opts.triple}.tar.xz" + url: Text = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${opts.version}/clang+llvm-${opts.version}-${opts.triple}.tar.xz" + in CF.run "install LLVM for bootstrap GHC" [ "curl -L ${url} | tar -xJC ." diff --git a/centos.dhall b/centos.dhall index c2acdb1..86c58d2 100644 --- a/centos.dhall +++ b/centos.dhall @@ -144,7 +144,7 @@ in CentosImage.toDocker { fromImage = "centos:7" , bootstrapGhc = { version = "8.8.3", triple = "x86_64-linux-centos7" } - , llvm = { version = "10.0.0" , triple = "aarch64-linux-gnu" } + , llvm = { version = "10.0.1" , triple = "aarch64-linux-gnu" } , ghcVersion = "8.8.3" } } \ No newline at end of file diff --git a/debian.dhall b/debian.dhall index e4289dc..48d93fc 100644 --- a/debian.dhall +++ b/debian.dhall @@ -150,7 +150,7 @@ in { fromImage = "arm64v8/debian:buster" , bootstrapLlvm = Some { version = "7.0.0" , triple = "aarch64-linux-gnu" } , bootstrapGhc = { version = "8.8.3", triple = "aarch64-deb9-linux" } - , llvm = Some { version = "10.0.0" , triple = "aarch64-linux-gnu" } + , llvm = Some { version = "10.0.1" , triple = "aarch64-linux-gnu" } , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" , extraPackages = [] : List Text @@ -161,7 +161,7 @@ in { fromImage = "arm32v7/debian:buster" , bootstrapLlvm = Some { version = "7.0.0", triple = "armv7a-linux-gnueabihf" } , bootstrapGhc = { version = "8.8.3", triple = "armv7l-deb9-linux" } - , llvm = Some { version = "10.0.0" , triple = "armv7a-linux-gnueabihf" } + , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" , extraPackages = [] : List Text @@ -183,7 +183,7 @@ in { fromImage = "amd64/debian:buster" , bootstrapLlvm = None DebianImage.TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } - , llvm = Some { version = "10.0.0" , triple = "x86_64-linux-gnu" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = [] : List Text -- GitLab From 5a7f9abbe4fdf8e020aaef6bf32e5aa0d6692fc2 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 02:39:55 -0400 Subject: [PATCH 15/74] hi --- debian.dhall | 1 - 1 file changed, 1 deletion(-) diff --git a/debian.dhall b/debian.dhall index 48d93fc..dd85023 100644 --- a/debian.dhall +++ b/debian.dhall @@ -131,7 +131,6 @@ let -- install cabal-install # Cabal.install opts.cabalSource - # CF.env (toMap { CABAL = "/usr/bin/cabal" }) -- install hscolour, alex, and happy # HaskellTools.build -- GitLab From 36ff983bce48f15452ca0820a4942b6680c8b170 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 02:47:40 -0400 Subject: [PATCH 16/74] hi --- debian.dhall | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/debian.dhall b/debian.dhall index dd85023..3f29232 100644 --- a/debian.dhall +++ b/debian.dhall @@ -166,6 +166,17 @@ in , extraPackages = [] : List Text } +, i386-linux-deb9 = + DebianImage.toDocker + { fromImage = "i386/debian:stretch" + , bootstrapLlvm = None DebianImage.TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } + , llvm = None TripleVersion + , ghcVersion = "8.8.3" + , cabalSource = Cabal.Type.FromSource "3.2.0.0" + , extraPackages = [ "cabal-install" ] : List Text + } + , i386-linux-deb10 = DebianImage.toDocker { fromImage = "i386/debian:buster" @@ -187,5 +198,16 @@ in , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = [] : List Text } + +, x86_64-linux-deb9 = + DebianImage.toDocker + { fromImage = "amd64/debian:stretch" + , bootstrapLlvm = None DebianImage.TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu" } + , ghcVersion = "8.8.3" + , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } + , extraPackages = [] : List Text + } } -- GitLab From 9d4d87efc4d5014d6aceee651f28ea28103a02be Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 02:49:32 -0400 Subject: [PATCH 17/74] hi --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37c6ed1..a6edf17 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -97,10 +97,10 @@ build-x86_64-linux-centos7: - docker - x86_64-linux -build-x86_64-linux-alpine: +build-x86_64-linux-alpine3_12: extends: .build variables: - IMAGE: x86_64-linux-alpine + IMAGE: x86_64-linux-alpine3_12 tags: - docker - x86_64-linux -- GitLab From 7874488ddf5e60f832ab458fd0353f70eb7125f7 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 02:52:26 -0400 Subject: [PATCH 18/74] hi --- debian.dhall | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian.dhall b/debian.dhall index 3f29232..aeffbc5 100644 --- a/debian.dhall +++ b/debian.dhall @@ -147,7 +147,7 @@ in { aarch64-linux-deb10 = DebianImage.toDocker { fromImage = "arm64v8/debian:buster" - , bootstrapLlvm = Some { version = "7.0.0" , triple = "aarch64-linux-gnu" } + , bootstrapLlvm = Some { version = "7.1.0" , triple = "aarch64-linux-gnu" } , bootstrapGhc = { version = "8.8.3", triple = "aarch64-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "aarch64-linux-gnu" } , ghcVersion = "8.8.3" @@ -155,10 +155,10 @@ in , extraPackages = [] : List Text } -, armv7l-linux-deb10 = +, armv7-linux-deb10 = DebianImage.toDocker { fromImage = "arm32v7/debian:buster" - , bootstrapLlvm = Some { version = "7.0.0", triple = "armv7a-linux-gnueabihf" } + , bootstrapLlvm = Some { version = "7.1.0", triple = "armv7a-linux-gnueabihf" } , bootstrapGhc = { version = "8.8.3", triple = "armv7l-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } , ghcVersion = "8.8.3" -- GitLab From 7141c0723b528d03aab55fbceba64c98d778a834 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 02:56:21 -0400 Subject: [PATCH 19/74] hi --- debian.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian.dhall b/debian.dhall index aeffbc5..6c2b426 100644 --- a/debian.dhall +++ b/debian.dhall @@ -193,7 +193,7 @@ in { fromImage = "amd64/debian:buster" , bootstrapLlvm = None DebianImage.TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } - , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = [] : List Text -- GitLab From 0b27c88fb5b522be9021ce4a20b558d77170fc63 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 03:14:57 -0400 Subject: [PATCH 20/74] hi --- alpine.dhall | 2 +- centos.dhall | 2 +- debian.dhall | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/alpine.dhall b/alpine.dhall index 10d3c45..073e77c 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -48,7 +48,7 @@ let GhcBindist = ./GhcBindist.dhall let - ghcVersion: Text = "8.8.4" + ghcVersion: Text = "8.10.2" let fetchGhcStep: CF.Type = diff --git a/centos.dhall b/centos.dhall index 86c58d2..d3a7b49 100644 --- a/centos.dhall +++ b/centos.dhall @@ -143,7 +143,7 @@ in { x86_64-linux-centos7 = CentosImage.toDocker { fromImage = "centos:7" - , bootstrapGhc = { version = "8.8.3", triple = "x86_64-linux-centos7" } + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-centos7-linux" } , llvm = { version = "10.0.1" , triple = "aarch64-linux-gnu" } , ghcVersion = "8.8.3" } diff --git a/debian.dhall b/debian.dhall index 6c2b426..cce38f5 100644 --- a/debian.dhall +++ b/debian.dhall @@ -159,7 +159,7 @@ in DebianImage.toDocker { fromImage = "arm32v7/debian:buster" , bootstrapLlvm = Some { version = "7.1.0", triple = "armv7a-linux-gnueabihf" } - , bootstrapGhc = { version = "8.8.3", triple = "armv7l-deb9-linux" } + , bootstrapGhc = { version = "8.8.3", triple = "armv7-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" @@ -173,7 +173,7 @@ in , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } , llvm = None TripleVersion , ghcVersion = "8.8.3" - , cabalSource = Cabal.Type.FromSource "3.2.0.0" + , cabalSource = Cabal.Type.FromBindist "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz" , extraPackages = [ "cabal-install" ] : List Text } -- GitLab From 70b9359f4eef57de1dba86609096cfbad90a502b Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 03:21:37 -0400 Subject: [PATCH 21/74] hi --- centos.dhall | 2 +- debian.dhall | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/centos.dhall b/centos.dhall index d3a7b49..e0d9b79 100644 --- a/centos.dhall +++ b/centos.dhall @@ -144,7 +144,7 @@ in CentosImage.toDocker { fromImage = "centos:7" , bootstrapGhc = { version = "8.8.3", triple = "x86_64-centos7-linux" } - , llvm = { version = "10.0.1" , triple = "aarch64-linux-gnu" } + , llvm = { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" } } \ No newline at end of file diff --git a/debian.dhall b/debian.dhall index cce38f5..b1ef654 100644 --- a/debian.dhall +++ b/debian.dhall @@ -16,7 +16,7 @@ let { triple : Text, version: Text } let - buildDepends: List Text = + coreBuildDepends: List Text = [ "zlib1g-dev" , "libtinfo-dev" , "libsqlite3-0" @@ -45,8 +45,11 @@ let , "libnuma-dev" -- For LLVM , "libtinfo5" - -- Documentation tools - , "python3-sphinx" + ] + +let + docsBuildDepends: List Text = + [ "python3-sphinx" , "texlive-xetex" , "texlive-latex-extra" , "texlive-binaries" @@ -54,6 +57,10 @@ let , "lmodern" , "texlive-generic-extra" ] + +let + buildDepends: List Text = coreBuildDepends # docsBuildDepends + let installPackages: List Text -> CF.Type = \(pkgs: List Text) -> -- GitLab From 643ab0fd85b53000d77131e4d4fa470656ae7146 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 03:25:19 -0400 Subject: [PATCH 22/74] hi --- centos.dhall | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/centos.dhall b/centos.dhall index e0d9b79..c289816 100644 --- a/centos.dhall +++ b/centos.dhall @@ -11,6 +11,10 @@ let let Cabal = ./Cabal.dhall +let + TripleVersion: Type = + { triple : Text, version: Text } + let coreBuildDepends: List Text = [ "coreutils" @@ -87,14 +91,11 @@ let let CentosImage = - let - TripleVersion: Type = - { triple : Text, version: Text } let type: Type = { fromImage : Text , bootstrapGhc : TripleVersion - , llvm : TripleVersion + , llvm : Optional TripleVersion , ghcVersion : Text } let @@ -122,8 +123,7 @@ let # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) -- install LLVM to be used by built compiler - # LlvmBindist.install (opts.llvm /\ { destDir = llvmDir }) - # LlvmBindist.setEnv llvmDir + # LlvmBindist.maybeInstallTo llvmDir opts.llvm -- install cabal-install # Cabal.install (Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" }) @@ -144,7 +144,7 @@ in CentosImage.toDocker { fromImage = "centos:7" , bootstrapGhc = { version = "8.8.3", triple = "x86_64-centos7-linux" } - , llvm = { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } + , llvm = None TripleVersion , ghcVersion = "8.8.3" } } \ No newline at end of file -- GitLab From 26dad0a7a050addcbb53643d6f785f6773dc01af Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 03:28:39 -0400 Subject: [PATCH 23/74] hi --- debian.dhall | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/debian.dhall b/debian.dhall index b1ef654..a073b8b 100644 --- a/debian.dhall +++ b/debian.dhall @@ -146,7 +146,6 @@ let # [ CF.Statement.Cmd ["bash"] ] in { Type = type - , TripleVersion = TripleVersion , toDocker = toDocker } @@ -176,7 +175,7 @@ in , i386-linux-deb9 = DebianImage.toDocker { fromImage = "i386/debian:stretch" - , bootstrapLlvm = None DebianImage.TripleVersion + , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } , llvm = None TripleVersion , ghcVersion = "8.8.3" @@ -187,7 +186,7 @@ in , i386-linux-deb10 = DebianImage.toDocker { fromImage = "i386/debian:buster" - , bootstrapLlvm = None DebianImage.TripleVersion + , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } , llvm = None TripleVersion , ghcVersion = "8.8.3" @@ -198,7 +197,7 @@ in , x86_64-linux-deb10 = DebianImage.toDocker { fromImage = "amd64/debian:buster" - , bootstrapLlvm = None DebianImage.TripleVersion + , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" @@ -209,12 +208,22 @@ in , x86_64-linux-deb9 = DebianImage.toDocker { fromImage = "amd64/debian:stretch" - , bootstrapLlvm = None DebianImage.TripleVersion + , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = [] : List Text } -} +, x86_64-linux-ubuntu20_04 = + DebianImage.toDocker + { fromImage = "amd64/ubuntu:20.04" + , bootstrapLlvm = None TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu" } + , ghcVersion = "8.8.3" + , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } + , extraPackages = [] : List Text + } +} \ No newline at end of file -- GitLab From 9a6b3ced0d68e3a692fbe03d1581736cf70e2e0a Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 03:29:37 -0400 Subject: [PATCH 24/74] hi --- debian.dhall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian.dhall b/debian.dhall index a073b8b..a552698 100644 --- a/debian.dhall +++ b/debian.dhall @@ -210,7 +210,7 @@ in { fromImage = "amd64/debian:stretch" , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } - , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = [] : List Text @@ -221,7 +221,7 @@ in { fromImage = "amd64/ubuntu:20.04" , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } - , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = [] : List Text -- GitLab From 25027e43cb6bcd79f9f1e1cb486305064bf8deef Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 03:34:22 -0400 Subject: [PATCH 25/74] hi --- Cabal.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cabal.dhall b/Cabal.dhall index b0f6ea7..590fc7f 100644 --- a/Cabal.dhall +++ b/Cabal.dhall @@ -42,7 +42,7 @@ let let fromUpstreamBindist = \(opts: { triple: Text, version: Text }) -> - type.FromDistribution "https://downloads.haskell.org/cabal/cabal-install-${opts.version}/cabal-install-${opts.version}-${opts.triple}.tar.xz" + type.FromBindist "https://downloads.haskell.org/cabal/cabal-install-${opts.version}/cabal-install-${opts.version}-${opts.triple}.tar.xz" let install: type -> CF.Type = -- GitLab From 85620f23a7edd958ef91d5ca88e1422693a525fb Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 03:36:35 -0400 Subject: [PATCH 26/74] hi --- HaskellTools.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HaskellTools.dhall b/HaskellTools.dhall index a3210fd..b37cd98 100644 --- a/HaskellTools.dhall +++ b/HaskellTools.dhall @@ -6,7 +6,7 @@ let CF.run "build haskell tools" [ "$CABAL user-config update" , "$CABAL v2-update" - , "$CABAL v2-install hscolour happy alex --constraint='happy ^>= 1.20' --enable-static --install-method=copy --installdir=$HOME/toolchain" + , "$CABAL v2-install hscolour happy alex --constraint='happy ^>= 1.20' --with-compiler=$GHC --enable-static --install-method=copy --installdir=$HOME/toolchain" ] # CF.env (toMap { HAPPY = "/home/ghc/toolchain/happy" -- GitLab From 119f169e49a0675ee9117e59a9a2255374ed66dc Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 03:41:49 -0400 Subject: [PATCH 27/74] hi --- debian.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian.dhall b/debian.dhall index a552698..60dc709 100644 --- a/debian.dhall +++ b/debian.dhall @@ -128,7 +128,7 @@ let { version = opts.bootstrapGhc.version , triple = opts.bootstrapGhc.triple , destDir = ghcDir - , configureOpts = [ "LLC=${bootLlvmDir}/bin/llc", "OPT=${bootLlvmDir}/bin/opt" ] + , configureOpts = bootstrapLlvmConfigureOptions } # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) -- GitLab From c25e6864b25dd6706e4b6da57022f5e7ab09a033 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 03:46:17 -0400 Subject: [PATCH 28/74] hi --- debian.dhall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian.dhall b/debian.dhall index 60dc709..40db480 100644 --- a/debian.dhall +++ b/debian.dhall @@ -180,7 +180,7 @@ in , llvm = None TripleVersion , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromBindist "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz" - , extraPackages = [ "cabal-install" ] : List Text + , extraPackages = [ "libgmp-dev", "cabal-install" ] : List Text } , i386-linux-deb10 = @@ -213,7 +213,7 @@ in , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } - , extraPackages = [] : List Text + , extraPackages = [ "libgmp-dev" ] : List Text } , x86_64-linux-ubuntu20_04 = -- GitLab From ab62a456501d37a06b1b6aceb7de8f81e0c09256 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 04:18:32 -0400 Subject: [PATCH 29/74] Refactor --- Image.dhall | 18 ++++ alpine.dhall | 33 ++++--- centos.dhall | 38 +++++--- containers.dhall | 17 ++-- debian.dhall | 241 ++++++++++++++++++++++++----------------------- 5 files changed, 200 insertions(+), 147 deletions(-) create mode 100644 Image.dhall diff --git a/Image.dhall b/Image.dhall new file mode 100644 index 0000000..4f3b1c1 --- /dev/null +++ b/Image.dhall @@ -0,0 +1,18 @@ +let + CF = ./Containerfile.dhall + +let + ImageName = Text + +let + type: Type = + { name: ImageName + , runnerTags: List Text + , dependencies: List ImageName + , image: CF.Type + } +in +{ Type = type +, default = { dependencies = [] : List ImageName } +, ImageName = ImageName +} \ No newline at end of file diff --git a/alpine.dhall b/alpine.dhall index 073e77c..887b205 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -6,6 +6,8 @@ let HaskellTools = ./HaskellTools.dhall let Cabal = ./Cabal.dhall +let + Image = ./Image.dhall let buildDepends: List Text = @@ -54,7 +56,7 @@ let fetchGhcStep: CF.Type = GhcBindist.install { version = ghcVersion - , triple = "x86_64-alpine-3.10-linux-integer-simple" + , triple = "x86_64-alpine3.10-linux-integer-simple" , destDir = "/opt/ghc/${ghcVersion}" , configureOpts = [] : List Text } @@ -69,14 +71,21 @@ let # [CF.Statement.User "ghc"] # CF.workdir "/home/ghc/" -in { - x86_64-linux-alpine3_12 = - CF.from "alpine:3.12.0" - # [ CF.Statement.Shell ["/bin/ash", "-eo", "pipefail", "-c"] ] - # installDepsStep - # fetchGhcStep - # createUserStep - # Cabal.install (Cabal.Type.FromDistribution "/usr/bin/cabal") - # HaskellTools.build - # [ CF.Statement.Cmd ["bash"] ] -} +let + images: List Image.Type = + [ Image:: + { name = "x86_64-linux-alpine3_12" + , runnerTags = [ "x86_64-linux" ] + , image = + CF.from "alpine:3.12.0" + # [ CF.Statement.Shell ["/bin/ash", "-eo", "pipefail", "-c"] ] + # installDepsStep + # fetchGhcStep + # createUserStep + # Cabal.install (Cabal.Type.FromDistribution "/usr/bin/cabal") + # HaskellTools.build + # [ CF.Statement.Cmd ["bash"] ] + } + ] + +in images \ No newline at end of file diff --git a/centos.dhall b/centos.dhall index c289816..2609372 100644 --- a/centos.dhall +++ b/centos.dhall @@ -10,6 +10,8 @@ let HaskellTools = ./HaskellTools.dhall let Cabal = ./Cabal.dhall +let + Image = ./Image.dhall let TripleVersion: Type = @@ -93,19 +95,22 @@ let CentosImage = let type: Type = - { fromImage : Text + { name : Text + , fromImage : Text + , runnerTags : List Text , bootstrapGhc : TripleVersion , llvm : Optional TripleVersion , ghcVersion : Text } let - toDocker: type -> CF.Type = \(opts : type) -> + toDocker: type -> Image.Type = \(opts : type) -> let ghcDir: Text = "/opt/ghc/${opts.ghcVersion}" let llvmDir: Text = "/opt/llvm" - in + let + image: CF.Type = CF.from opts.fromImage # CF.env (toMap { LANG = "C.UTF-8" }) # [ CF.Statement.Shell ["/bin/bash", "-o", "pipefail", "-c"] ] @@ -133,18 +138,27 @@ let # createUserStep # [ CF.Statement.Cmd ["bash"] ] + + in + Image:: + { name = opts.name + , runnerTags = opts.runnerTags + , image = image + } in { Type = type , TripleVersion = TripleVersion , toDocker = toDocker } -in -{ x86_64-linux-centos7 = - CentosImage.toDocker - { fromImage = "centos:7" - , bootstrapGhc = { version = "8.8.3", triple = "x86_64-centos7-linux" } - , llvm = None TripleVersion - , ghcVersion = "8.8.3" - } -} \ No newline at end of file +let images: List Image.Type = +[ CentosImage.toDocker + { name = "x86_64-linux-centos7" + , fromImage = "centos:7" + , runnerTags = [ "x86_64-linux" ] + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-centos7-linux" } + , llvm = None TripleVersion + , ghcVersion = "8.8.3" + } +] +in images \ No newline at end of file diff --git a/containers.dhall b/containers.dhall index 0da1b1d..df5dd17 100644 --- a/containers.dhall +++ b/containers.dhall @@ -1,17 +1,20 @@ +let + Prelude = ./Prelude.dhall +let + Map = Prelude.Map let CF = ./Containerfile.dhall let - Prelude = ./Prelude.dhall -in + Image = ./Image.dhall let - containers: Prelude.Map.Type Text CF.Type = - toMap (./alpine.dhall /\ ./debian.dhall /\ ./centos.dhall) + images: List Image.Type = + Prelude.List.concat Image.Type [./alpine.dhall, ./debian.dhall, ./centos.dhall] let DockerfileDir: Type = { Dockerfile : Text } let - toDockerfile: CF.Type -> DockerfileDir = - \(cf: CF.Type) -> { Dockerfile = CF.render cf } + toDockerfileDir: Image.Type -> Map.Entry Text DockerfileDir = + \(cf: Image.Type) -> Map.keyValue DockerfileDir cf.name { Dockerfile = CF.render cf.image } -in Prelude.Map.map Text CF.Type DockerfileDir toDockerfile containers +in Prelude.List.map Image.Type (Map.Entry Text DockerfileDir) toDockerfileDir images diff --git a/debian.dhall b/debian.dhall index 40db480..2985317 100644 --- a/debian.dhall +++ b/debian.dhall @@ -10,6 +10,8 @@ let HaskellTools = ./HaskellTools.dhall let Cabal = ./Cabal.dhall +let + Image = ./Image.dhall let TripleVersion: Type = @@ -85,7 +87,9 @@ let DebianImage = let type: Type = - { fromImage : Text + { name: Text + , fromImage : Text + , runnerTags : List Text , bootstrapLlvm : Optional TripleVersion , bootstrapGhc : TripleVersion , llvm : Optional TripleVersion @@ -95,135 +99,140 @@ let } let - toDocker: type -> CF.Type = \(opts : type) -> + toDocker: type -> Image.Type = \(opts : type) -> let ghcDir: Text = "/opt/ghc/${opts.ghcVersion}" let bootLlvmDir: Text = "/opt/llvm-bootstrap" let llvmDir: Text = "/opt/llvm" - let - installBootstrapLlvm = - merge { Some = \(llvmOpts: TripleVersion) -> - LlvmBindist.install (llvmOpts /\ { destDir = bootLlvmDir }) - , None = [] : CF.Type - } opts.bootstrapLlvm let bootstrapLlvmConfigureOptions = merge { Some = \(_: TripleVersion) -> [ "LLC=${bootLlvmDir}/bin/llc", "OPT=${bootLlvmDir}/bin/opt" ] , None = [] : List Text } opts.bootstrapLlvm - in - CF.from opts.fromImage - # CF.env (toMap { LANG = "C.UTF-8" }) - # [ CF.Statement.Shell ["/bin/bash", "-o", "pipefail", "-c"] ] - # installPackages (buildDepends # opts.extraPackages) - - -- install LLVM for bootstrap GHC - # LlvmBindist.maybeInstallTo bootLlvmDir opts.bootstrapLlvm - - -- install GHC - # GhcBindist.install - { version = opts.bootstrapGhc.version - , triple = opts.bootstrapGhc.triple - , destDir = ghcDir - , configureOpts = bootstrapLlvmConfigureOptions - } - # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) - - -- install LLVM to be used by built compiler - # LlvmBindist.maybeInstallTo llvmDir opts.llvm - # LlvmBindist.setEnv llvmDir - - -- install cabal-install - # Cabal.install opts.cabalSource - - -- install hscolour, alex, and happy - # HaskellTools.build - - # createUserStep - # [ CF.Statement.Cmd ["bash"] ] + let + image = + CF.from opts.fromImage + # CF.env (toMap { LANG = "C.UTF-8" }) + # [ CF.Statement.Shell ["/bin/bash", "-o", "pipefail", "-c"] ] + # installPackages (buildDepends # opts.extraPackages) + + -- install LLVM for bootstrap GHC + # LlvmBindist.maybeInstallTo bootLlvmDir opts.bootstrapLlvm + + -- install GHC + # GhcBindist.install + { version = opts.bootstrapGhc.version + , triple = opts.bootstrapGhc.triple + , destDir = ghcDir + , configureOpts = bootstrapLlvmConfigureOptions + } + # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) + + -- install LLVM to be used by built compiler + # LlvmBindist.maybeInstallTo llvmDir opts.llvm + # LlvmBindist.setEnv llvmDir + + -- install cabal-install + # Cabal.install opts.cabalSource + + -- install hscolour, alex, and happy + # HaskellTools.build + + # createUserStep + # [ CF.Statement.Cmd ["bash"] ] + + in Image::{ name = opts.name, runnerTags = opts.runnerTags, image = image } in { Type = type , toDocker = toDocker } -in -{ aarch64-linux-deb10 = - DebianImage.toDocker - { fromImage = "arm64v8/debian:buster" - , bootstrapLlvm = Some { version = "7.1.0" , triple = "aarch64-linux-gnu" } - , bootstrapGhc = { version = "8.8.3", triple = "aarch64-deb9-linux" } - , llvm = Some { version = "10.0.1" , triple = "aarch64-linux-gnu" } - , ghcVersion = "8.8.3" - , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" - , extraPackages = [] : List Text - } - -, armv7-linux-deb10 = - DebianImage.toDocker - { fromImage = "arm32v7/debian:buster" - , bootstrapLlvm = Some { version = "7.1.0", triple = "armv7a-linux-gnueabihf" } - , bootstrapGhc = { version = "8.8.3", triple = "armv7-deb9-linux" } - , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } - , ghcVersion = "8.8.3" - , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" - , extraPackages = [] : List Text - } - -, i386-linux-deb9 = - DebianImage.toDocker - { fromImage = "i386/debian:stretch" - , bootstrapLlvm = None TripleVersion - , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } - , llvm = None TripleVersion - , ghcVersion = "8.8.3" - , cabalSource = Cabal.Type.FromBindist "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz" - , extraPackages = [ "libgmp-dev", "cabal-install" ] : List Text - } - -, i386-linux-deb10 = - DebianImage.toDocker - { fromImage = "i386/debian:buster" - , bootstrapLlvm = None TripleVersion - , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } - , llvm = None TripleVersion - , ghcVersion = "8.8.3" - , cabalSource = Cabal.Type.FromSource "3.2.0.0" - , extraPackages = [ "cabal-install" ] : List Text - } - -, x86_64-linux-deb10 = - DebianImage.toDocker - { fromImage = "amd64/debian:buster" - , bootstrapLlvm = None TripleVersion - , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } - , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } - , ghcVersion = "8.8.3" - , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } - , extraPackages = [] : List Text - } - -, x86_64-linux-deb9 = - DebianImage.toDocker - { fromImage = "amd64/debian:stretch" - , bootstrapLlvm = None TripleVersion - , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } - , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } - , ghcVersion = "8.8.3" - , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } - , extraPackages = [ "libgmp-dev" ] : List Text - } - -, x86_64-linux-ubuntu20_04 = - DebianImage.toDocker - { fromImage = "amd64/ubuntu:20.04" - , bootstrapLlvm = None TripleVersion - , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } - , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } - , ghcVersion = "8.8.3" - , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } - , extraPackages = [] : List Text - } -} \ No newline at end of file +let images: List Image.Type = +[ DebianImage.toDocker + { name = "aarch64-linux-deb10" + , fromImage = "arm64v8/debian:buster" + , runnerTags = [ "aarch64-linux" ] + , bootstrapLlvm = Some { version = "7.1.0" , triple = "aarch64-linux-gnu" } + , bootstrapGhc = { version = "8.8.3", triple = "aarch64-deb9-linux" } + , llvm = Some { version = "10.0.1" , triple = "aarch64-linux-gnu" } + , ghcVersion = "8.8.3" + , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" + , extraPackages = [] : List Text + } + +, DebianImage.toDocker + { name = "armv7-linux-deb10" + , fromImage = "arm32v7/debian:buster" + , runnerTags = [ "armv7-linux" ] + , bootstrapLlvm = Some { version = "7.1.0", triple = "armv7a-linux-gnueabihf" } + , bootstrapGhc = { version = "8.8.3", triple = "armv7-deb9-linux" } + , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } + , ghcVersion = "8.8.3" + , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" + , extraPackages = [] : List Text + } + +, DebianImage.toDocker + { name = "i386-linux-deb9" + , fromImage = "i386/debian:stretch" + , runnerTags = [ "x86_64-linux" ] + , bootstrapLlvm = None TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } + , llvm = None TripleVersion + , ghcVersion = "8.8.3" + , cabalSource = Cabal.Type.FromBindist "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz" + , extraPackages = [ "libgmp-dev", "cabal-install" ] : List Text + } + +, DebianImage.toDocker + { name = "i386-linux-deb10" + , fromImage = "i386/debian:buster" + , runnerTags = [ "x86_64-linux" ] + , bootstrapLlvm = None TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } + , llvm = None TripleVersion + , ghcVersion = "8.8.3" + , cabalSource = Cabal.Type.FromSource "3.2.0.0" + , extraPackages = [ "cabal-install" ] : List Text + } + +, DebianImage.toDocker + { name = "x86_64-linux-deb10" + , fromImage = "amd64/debian:buster" + , runnerTags = [ "x86_64-linux" ] + , bootstrapLlvm = None TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } + , ghcVersion = "8.8.3" + , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } + , extraPackages = [] : List Text + } + +, DebianImage.toDocker + { name = "x86_64-linux-deb9" + , fromImage = "amd64/debian:stretch" + , runnerTags = [ "x86_64-linux" ] + , bootstrapLlvm = None TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } + , ghcVersion = "8.8.3" + , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } + , extraPackages = [ "libgmp-dev" ] : List Text + } + +, DebianImage.toDocker + { name = "x86_64-linux-ubuntu20_04" + , fromImage = "amd64/ubuntu:20.04" + , runnerTags = [ "x86_64-linux" ] + , bootstrapLlvm = None TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } + , ghcVersion = "8.8.3" + , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } + , extraPackages = [] : List Text + } +] +in images \ No newline at end of file -- GitLab From 454a5e62f34afbb30cad4d8aaa5adcd59fb725d2 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 04:23:10 -0400 Subject: [PATCH 30/74] hi --- alpine.dhall | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/alpine.dhall b/alpine.dhall index 887b205..5e27cc0 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -10,7 +10,7 @@ let Image = ./Image.dhall let - buildDepends: List Text = + coreBuildDepends: List Text = [ "autoconf" , "automake" , "binutils-gold" @@ -23,7 +23,6 @@ let , "ncurses-dev" , "ncurses-static" , "python3" - , "py3-sphinx" , "zlib-dev" , "xz" , "bash" @@ -35,11 +34,20 @@ let , "gmp-dev" , "cabal" , "ghc" + ] + +let + docsBuildDepends: List Text = + [ "py3-sphinx" , "texlive" , "texlive-xetex" , "texmf-dist-latexextra" , "ttf-dejavu" ] + +let + buildDepends: List Text = coreBuildDepends # docsBuildDepends + let installDepsStep: CF.Type = CF.run "Installing GHC build dependencies" [ "apk add --no-cache ${Prelude.Text.concatSep " " buildDepends}" ] -- GitLab From a2b7a52e85012a24ed75ccf57c1a20ae7fc3df84 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 04:26:20 -0400 Subject: [PATCH 31/74] hi --- GhcBindist.dhall | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/GhcBindist.dhall b/GhcBindist.dhall index 7f27561..2954dc4 100644 --- a/GhcBindist.dhall +++ b/GhcBindist.dhall @@ -23,13 +23,12 @@ let bindistUrl: Text = "https://downloads.haskell.org/~ghc/${opts.version}/ghc-${opts.version}-${opts.triple}.tar.xz" in CF.run "fetch GHC" [ "curl -L ${bindistUrl} | tar -Jx -C /tmp" ] - # CF.workdir "/tmp/ghc-${opts.version}" # CF.run "configure bindist" - [ "./configure ${Prelude.Text.concatSep " " opts.configureOpts} --prefix=${opts.destDir}" + [ "cd /tmp/ghc-${opts.version}*" + , "./configure ${Prelude.Text.concatSep " " opts.configureOpts} --prefix=${opts.destDir}" , "make install" ] - # CF.workdir "/tmp" - # CF.run "remove temporary directory" [ "rm -Rf /tmp/ghc-${opts.version}" ] + # CF.run "remove temporary directory" [ "rm -Rf /tmp/ghc-${opts.version}-*" ] # CF.run "test GHC" [ "${opts.destDir}/bin/ghc --version" ] in -- GitLab From cfcdb3e494279035194737bf566beca00e22a073 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 04:29:28 -0400 Subject: [PATCH 32/74] Factor out all-images --- all-images.dhall | 9 +++++++++ containers.dhall | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 all-images.dhall diff --git a/all-images.dhall b/all-images.dhall new file mode 100644 index 0000000..b3fead0 --- /dev/null +++ b/all-images.dhall @@ -0,0 +1,9 @@ +let + Prelude = ./Prelude.dhall +let + Image = ./Image.dhall + +let + all-images: List Image.Type = + Prelude.List.concat Image.Type [./alpine.dhall, ./debian.dhall, ./centos.dhall] +in all-images diff --git a/containers.dhall b/containers.dhall index df5dd17..ac81a00 100644 --- a/containers.dhall +++ b/containers.dhall @@ -8,9 +8,7 @@ let Image = ./Image.dhall let - images: List Image.Type = - Prelude.List.concat Image.Type [./alpine.dhall, ./debian.dhall, ./centos.dhall] - + images: List Image.Type = ./all-images.dhall let DockerfileDir: Type = { Dockerfile : Text } let -- GitLab From d106c7f5df6bf7d67aa981a0616b414fa9434741 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 04:32:44 -0400 Subject: [PATCH 33/74] hi --- alpine.dhall | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/alpine.dhall b/alpine.dhall index 5e27cc0..1676d13 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -62,12 +62,16 @@ let let fetchGhcStep: CF.Type = - GhcBindist.install - { version = ghcVersion - , triple = "x86_64-alpine3.10-linux-integer-simple" - , destDir = "/opt/ghc/${ghcVersion}" - , configureOpts = [] : List Text - } + let + destDir: Text = "/opt/ghc/${ghcVersion}" + in + GhcBindist.install + { version = ghcVersion + , triple = "x86_64-alpine3.10-linux-integer-simple" + , destDir = destDir + , configureOpts = [] : List Text + } + # CF.env (toMap { GHC = "${destDir}/bin/ghc" }) -- Create a normal user let -- GitLab From 62bce13d83d186f6743f25931dca3dfcd80b26d6 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 04:36:55 -0400 Subject: [PATCH 34/74] hi --- alpine.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpine.dhall b/alpine.dhall index 1676d13..f618f86 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -77,7 +77,7 @@ let let createUserStep: CF.Type = CF.run "create user" - [ "adduser ghc --gecos 'GHC builds' --disabled-password" + [ "adduser ghc --comment 'GHC builds' --disabled-password" , "echo 'ghc ALL = NOPASSWD : ALL' > /etc/sudoers.d/ghc" ] # [CF.Statement.User "ghc"] -- GitLab From a3c9f5eef1e1bfdafd129263940f346b4fbe964f Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 04:37:57 -0400 Subject: [PATCH 35/74] hi --- alpine.dhall | 2 +- centos.dhall | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine.dhall b/alpine.dhall index f618f86..1676d13 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -77,7 +77,7 @@ let let createUserStep: CF.Type = CF.run "create user" - [ "adduser ghc --comment 'GHC builds' --disabled-password" + [ "adduser ghc --gecos 'GHC builds' --disabled-password" , "echo 'ghc ALL = NOPASSWD : ALL' > /etc/sudoers.d/ghc" ] # [CF.Statement.User "ghc"] diff --git a/centos.dhall b/centos.dhall index 2609372..7468107 100644 --- a/centos.dhall +++ b/centos.dhall @@ -85,7 +85,7 @@ let let createUserStep: CF.Type = CF.run "create user" - [ "adduser ghc --gecos 'GHC builds' --disabled-password" + [ "adduser ghc --comment 'GHC builds' , "echo 'ghc ALL = NOPASSWD : ALL' > /etc/sudoers.d/ghc" ] # [CF.Statement.User "ghc"] -- GitLab From bfaea7aeca33f1dc5652ee5d121596da87ad8238 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 04:39:08 -0400 Subject: [PATCH 36/74] hi --- centos.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centos.dhall b/centos.dhall index 7468107..9086c9b 100644 --- a/centos.dhall +++ b/centos.dhall @@ -85,7 +85,7 @@ let let createUserStep: CF.Type = CF.run "create user" - [ "adduser ghc --comment 'GHC builds' + [ "adduser ghc --comment 'GHC builds'" , "echo 'ghc ALL = NOPASSWD : ALL' > /etc/sudoers.d/ghc" ] # [CF.Statement.User "ghc"] -- GitLab From 7bff27fc99d7f21ed14ce2e0cb6be18b1ae22206 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 04:46:03 -0400 Subject: [PATCH 37/74] Add fedora --- all-images.dhall | 7 +- fedora.dhall | 167 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 fedora.dhall diff --git a/all-images.dhall b/all-images.dhall index b3fead0..589da60 100644 --- a/all-images.dhall +++ b/all-images.dhall @@ -5,5 +5,10 @@ let let all-images: List Image.Type = - Prelude.List.concat Image.Type [./alpine.dhall, ./debian.dhall, ./centos.dhall] + Prelude.List.concat Image.Type + [ ./alpine.dhall + , ./debian.dhall + , ./centos.dhall + , ./fedora.dhall + ] in all-images diff --git a/fedora.dhall b/fedora.dhall new file mode 100644 index 0000000..d9ae03a --- /dev/null +++ b/fedora.dhall @@ -0,0 +1,167 @@ +let + Prelude = ./Prelude.dhall +let + CF = ./Containerfile.dhall +let + LlvmBindist = ./LlvmBindist.dhall +let + GhcBindist = ./GhcBindist.dhall +let + HaskellTools = ./HaskellTools.dhall +let + Cabal = ./Cabal.dhall +let + Image = ./Image.dhall + +let + TripleVersion: Type = + { triple : Text, version: Text } + +let + coreBuildDepends: List Text = + [ "coreutils" + , "binutils" + , "which" + , "git" + , "make" + , "automake" + , "autoconf" + , "gcc" + , "perl" + , "python3" + , "xz" + , "pxz" + , "bzip2" + , "lbzip2" + , "patch" + , "openssh-clients" + , "sudo" + , "zlib-devel" + , "sqlite" + , "ncurses-compat-libs" + , "gmp-devel" + , "ncurses-devel" + , "gcc-c++" + , "findutils" + , "curl" + , "wget" + , "jq" + ] + +let + docsBuildDepends: List Text = + [ "python3-pip" + , "texinfo" + , "texlive" + , "texlive-latex" + , "texlive-xetex" + , "texlive-collection-latex" + , "texlive-collection-latexrecommended" + , "texlive-xetex-def" + , "texlive-collection-xetex" + , "python-sphinx-latex" + , "dejavu-sans-fonts" + , "dejavu-serif-fonts" + , "dejavu-sans-mono-fonts" + ] + +let + buildDepends: List Text = coreBuildDepends # docsBuildDepends + +let + installPackages: List Text -> CF.Type = + \(pkgs: List Text) -> + CF.run "install build dependencies" + [ "dnf -y install ${Prelude.Text.concatSep " " pkgs}" ] + +-- Create a normal user +let + createUserStep: CF.Type = + CF.run "create user" + [ "adduser ghc --gecos 'GHC builds' --disabled-password" + , "echo 'ghc ALL = NOPASSWD : ALL' > /etc/sudoers.d/ghc" + ] + # [CF.Statement.User "ghc"] + # CF.workdir "/home/ghc/" + +let + FedoraImage = + let + type: Type = + { name: Text + , fromImage : Text + , runnerTags : List Text + , bootstrapLlvm : Optional TripleVersion + , bootstrapGhc : TripleVersion + , llvm : Optional TripleVersion + , ghcVersion : Text + , cabalSource : Cabal.Type + , extraPackages: List Text + } + + let + toDocker: type -> Image.Type = \(opts : type) -> + let + ghcDir: Text = "/opt/ghc/${opts.ghcVersion}" + let + bootLlvmDir: Text = "/opt/llvm-bootstrap" + let + llvmDir: Text = "/opt/llvm" + let + bootstrapLlvmConfigureOptions = + merge { Some = \(_: TripleVersion) -> [ "LLC=${bootLlvmDir}/bin/llc", "OPT=${bootLlvmDir}/bin/opt" ] + , None = [] : List Text + } opts.bootstrapLlvm + + let + image = + CF.from opts.fromImage + # CF.env (toMap { LANG = "C.UTF-8" }) + # [ CF.Statement.Shell ["/bin/bash", "-o", "pipefail", "-c"] ] + # installPackages (buildDepends # opts.extraPackages) + + -- install LLVM for bootstrap GHC + # LlvmBindist.maybeInstallTo bootLlvmDir opts.bootstrapLlvm + + -- install GHC + # GhcBindist.install + { version = opts.bootstrapGhc.version + , triple = opts.bootstrapGhc.triple + , destDir = ghcDir + , configureOpts = bootstrapLlvmConfigureOptions + } + # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) + + -- install LLVM to be used by built compiler + # LlvmBindist.maybeInstallTo llvmDir opts.llvm + # LlvmBindist.setEnv llvmDir + + -- install cabal-install + # Cabal.install opts.cabalSource + + -- install hscolour, alex, and happy + # HaskellTools.build + + # createUserStep + # [ CF.Statement.Cmd ["bash"] ] + + in Image::{ name = opts.name, runnerTags = opts.runnerTags, image = image } + in + { Type = type + , toDocker = toDocker + } + +let images: List Image.Type = +[ FedoraImage.toDocker + { name = "x86_64-linux-fedora27" + , fromImage = "amd64/fedora:27" + , runnerTags = [ "x86_64-linux" ] + , bootstrapLlvm = None TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-fedora27-linux" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } + , ghcVersion = "8.8.3" + , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } + , extraPackages = [] : List Text + } +] +in images \ No newline at end of file -- GitLab From a6f9ab8fde25fef3536ba0775ac66c98755c7d4a Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 04:59:11 -0400 Subject: [PATCH 38/74] hi --- debian.dhall | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/debian.dhall b/debian.dhall index 2985317..2c098e2 100644 --- a/debian.dhall +++ b/debian.dhall @@ -57,9 +57,14 @@ let , "texlive-binaries" , "texlive-fonts-recommended" , "lmodern" - , "texlive-generic-extra" ] +let debianBuildDepends: List Text = + [ "texlive-generic-extra" ] + +let ubuntuBuildDepends: List Text = + [ "texlive-plain-generic" ] + let buildDepends: List Text = coreBuildDepends # docsBuildDepends @@ -172,7 +177,7 @@ let images: List Image.Type = , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" - , extraPackages = [] : List Text + , extraPackages = debianBuildDepends } , DebianImage.toDocker @@ -184,7 +189,7 @@ let images: List Image.Type = , llvm = None TripleVersion , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromBindist "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz" - , extraPackages = [ "libgmp-dev", "cabal-install" ] : List Text + , extraPackages = debianBuildDepends # [ "libgmp-dev", "cabal-install" ] : List Text } , DebianImage.toDocker @@ -192,11 +197,11 @@ let images: List Image.Type = , fromImage = "i386/debian:buster" , runnerTags = [ "x86_64-linux" ] , bootstrapLlvm = None TripleVersion - , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } + , bootstrapGhc = { version = "8.8.3", triple = "i386-deb10-linux" } , llvm = None TripleVersion , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromSource "3.2.0.0" - , extraPackages = [ "cabal-install" ] : List Text + , extraPackages = debianBuildDepends # [ "cabal-install" ] : List Text } , DebianImage.toDocker @@ -208,7 +213,7 @@ let images: List Image.Type = , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } - , extraPackages = [] : List Text + , extraPackages = debianBuildDepends } , DebianImage.toDocker @@ -220,7 +225,7 @@ let images: List Image.Type = , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } - , extraPackages = [ "libgmp-dev" ] : List Text + , extraPackages = debianBuildDepends # [ "libgmp-dev" ] : List Text } , DebianImage.toDocker @@ -232,7 +237,7 @@ let images: List Image.Type = , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } - , extraPackages = [] : List Text + , extraPackages = ubuntuBuildDepends } ] in images \ No newline at end of file -- GitLab From 1fde1f0774f97265d062c0b45387f864fb6e5a43 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 05:00:01 -0400 Subject: [PATCH 39/74] hi --- fedora.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora.dhall b/fedora.dhall index d9ae03a..a22da13 100644 --- a/fedora.dhall +++ b/fedora.dhall @@ -78,7 +78,7 @@ let let createUserStep: CF.Type = CF.run "create user" - [ "adduser ghc --gecos 'GHC builds' --disabled-password" + [ "adduser ghc --comment 'GHC builds'" , "echo 'ghc ALL = NOPASSWD : ALL' > /etc/sudoers.d/ghc" ] # [CF.Statement.User "ghc"] -- GitLab From 8dfb5ecaee34361fea9cf0c42cc7bd6a223d28b9 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 05:04:18 -0400 Subject: [PATCH 40/74] hi --- debian.dhall | 13 +++++++------ fedora.dhall | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/debian.dhall b/debian.dhall index 2c098e2..77da38c 100644 --- a/debian.dhall +++ b/debian.dhall @@ -71,12 +71,13 @@ let let installPackages: List Text -> CF.Type = \(pkgs: List Text) -> - CF.run "install build dependencies" - [ "apt-get update" - , "apt-get install --no-install-recommends -qy ${Prelude.Text.concatSep " " pkgs}" - , "apt-get clean" - , "rm -rf /var/lib/apt/lists/*" - ] + CF.arg (toMap { DEBIAN_FRONTEND = "noninteractive" }) + # CF.run "install build dependencies" + [ "apt-get update" + , "apt-get install --no-install-recommends -qy ${Prelude.Text.concatSep " " pkgs}" + , "apt-get clean" + , "rm -rf /var/lib/apt/lists/*" + ] -- Create a normal user let diff --git a/fedora.dhall b/fedora.dhall index a22da13..d20e31e 100644 --- a/fedora.dhall +++ b/fedora.dhall @@ -72,7 +72,7 @@ let installPackages: List Text -> CF.Type = \(pkgs: List Text) -> CF.run "install build dependencies" - [ "dnf -y install ${Prelude.Text.concatSep " " pkgs}" ] + [ "dnf -y install ${Prelude.Text.concatSep " " pkgs}" ] -- Create a normal user let -- GitLab From f9cd8d2c1f00cb20e02e8cd67a82a299dc41961f Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 05:13:06 -0400 Subject: [PATCH 41/74] hi --- debian.dhall | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/debian.dhall b/debian.dhall index 77da38c..ebb6268 100644 --- a/debian.dhall +++ b/debian.dhall @@ -23,6 +23,7 @@ let , "libtinfo-dev" , "libsqlite3-0" , "libsqlite3-dev" + , "libgmp-dev" , "ca-certificates" , "g++" , "git" @@ -47,6 +48,12 @@ let , "libnuma-dev" -- For LLVM , "libtinfo5" + -- DWARF libraries + , "libdw1", "libdw-dev" + -- For nofib + , "valgrind" + -- For cross-compilation testing + , "crossbuild-essential-arm64" ] let @@ -164,7 +171,7 @@ let images: List Image.Type = , bootstrapLlvm = Some { version = "7.1.0" , triple = "aarch64-linux-gnu" } , bootstrapGhc = { version = "8.8.3", triple = "aarch64-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "aarch64-linux-gnu" } - , ghcVersion = "8.8.3" + , ghcVersion = "8.10.2" , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" , extraPackages = [] : List Text } @@ -176,7 +183,7 @@ let images: List Image.Type = , bootstrapLlvm = Some { version = "7.1.0", triple = "armv7a-linux-gnueabihf" } , bootstrapGhc = { version = "8.8.3", triple = "armv7-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } - , ghcVersion = "8.8.3" + , ghcVersion = "8.10.2" , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" , extraPackages = debianBuildDepends } @@ -190,7 +197,7 @@ let images: List Image.Type = , llvm = None TripleVersion , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromBindist "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz" - , extraPackages = debianBuildDepends # [ "libgmp-dev", "cabal-install" ] : List Text + , extraPackages = debianBuildDepends # [ "cabal-install" ] : List Text } , DebianImage.toDocker @@ -226,7 +233,7 @@ let images: List Image.Type = , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } - , extraPackages = debianBuildDepends # [ "libgmp-dev" ] : List Text + , extraPackages = debianBuildDepends : List Text } , DebianImage.toDocker -- GitLab From 99073ebe54d12e25bb29e1bfa246dabc91a0626e Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 09:54:56 -0400 Subject: [PATCH 42/74] hi --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a6edf17..6302f33 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -137,10 +137,10 @@ build-x86_64-linux-fedora27: - docker - x86_64-linux -build-x86_64-linux-ubuntu2004: +build-x86_64-linux-ubuntu20_04: extends: .build variables: - IMAGE: x86_64-linux-ubuntu2004 + IMAGE: x86_64-linux-ubuntu20_04 tags: - docker - x86_64-linux -- GitLab From 96bebbf0a500dd44e16d5091ac2b1d4d53514bb8 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 11:32:28 -0400 Subject: [PATCH 43/74] Move cross compilation tools --- debian.dhall | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/debian.dhall b/debian.dhall index ebb6268..078ff28 100644 --- a/debian.dhall +++ b/debian.dhall @@ -52,8 +52,6 @@ let , "libdw1", "libdw-dev" -- For nofib , "valgrind" - -- For cross-compilation testing - , "crossbuild-essential-arm64" ] let @@ -221,7 +219,10 @@ let images: List Image.Type = , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } - , extraPackages = debianBuildDepends + , extraPackages = + debianBuildDepends + -- For cross-compilation testing + # ["crossbuild-essential-arm64"] } , DebianImage.toDocker -- GitLab From f3e50972118b0153020984cfb0e8ef532e8fb9a7 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 12:04:38 -0400 Subject: [PATCH 44/74] Add image-jobs expression --- GitLabCi.dhall | 1 + image-jobs.dhall | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 GitLabCi.dhall create mode 100644 image-jobs.dhall diff --git a/GitLabCi.dhall b/GitLabCi.dhall new file mode 100644 index 0000000..8c9a03e --- /dev/null +++ b/GitLabCi.dhall @@ -0,0 +1 @@ +https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/a681eff7e479c8bcbd6743052f8358b1222ffd17/package.dhall \ No newline at end of file diff --git a/image-jobs.dhall b/image-jobs.dhall new file mode 100644 index 0000000..f899a7d --- /dev/null +++ b/image-jobs.dhall @@ -0,0 +1,56 @@ +let + Prelude = ./Prelude.dhall +let + Map = Prelude.Map +let + CF = ./Containerfile.dhall +let + Image = ./Image.dhall +let + GitLab = ./GitLabCi.dhall + +let + images: List Image.Type = ./all-images.dhall + +let + toJob: Image.Type -> Prelude.Map.Entry Text GitLab.Job.Type = + \(image: Image.Type) -> + let + base: Text = "registry.gitlab.haskell.org/$CI_PROJECT_PATH" + let + imageName: Text = "${base}/${image.name}" + + let job: GitLab.Job.Type = + GitLab.Job:: + { stage = Some "build" + , image = Some "docker:19.03" + , variables = toMap + { DOCKER_DRIVER = "overlay2" + , DOCKER_TLS_CERTDIR = "/certs" + } + , services = Some [ "docker:19.03-dind" ] + , script = + [ "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY" + , "docker pull ${imageName}:latest || true" + , "docker build --cache-from ${imageName}:latest --tag ${imageName}:$CI_COMMIT_SHA --tag ${imageName}:latest dockerfiles/${image.name}" + , '' + if [ -z "$CI_MERGE_REQUEST_ID" ]; then + docker push ${imageName}:$CI_COMMIT_SHA + docker push ${imageName}:latest + fi + '' + ] + } + + in Prelude.Map.keyValue GitLab.Job.Type image.name job + +let + jobs: Prelude.Map.Type Text GitLab.Job.Type = + Prelude.List.map Image.Type (Prelude.Map.Entry Text GitLab.Job.Type) toJob images + +let + json: Prelude.JSON.Type = + Prelude.JSON.object (Prelude.Map.map Text GitLab.Job.Type Prelude.JSON.Type GitLab.Job.toJSON jobs) + +in +Prelude.JSON.renderYAML json \ No newline at end of file -- GitLab From 53dc66b0dda3d154efb8c3278e46fafcc6ef2bc4 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 12:27:57 -0400 Subject: [PATCH 45/74] Add linters image --- debian.dhall | 31 +++++++++++++++++++++++++++++++ image-jobs.dhall | 5 +++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/debian.dhall b/debian.dhall index 078ff28..e850100 100644 --- a/debian.dhall +++ b/debian.dhall @@ -12,6 +12,8 @@ let Cabal = ./Cabal.dhall let Image = ./Image.dhall +let + docker_base_url: Text = "registry.gitlab.haskell.org/$CI_PROJECT_PATH" let TripleVersion: Type = @@ -248,5 +250,34 @@ let images: List Image.Type = , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = ubuntuBuildDepends } + +, Image:: + { name = "linters" + , runnerTags = [ "x86_64-linux" ] + , dependencies = [ "x86_64-linux-deb10" ] + , image = + let installMypy: CF.Type = + [ CF.Statement.User "root" ] + # installPackages [ "python3-pip" ] + # CF.run "installing mypy" [ "pip3 install mypy==0.701" ] + + let lintersCommit: Text = + "b5650c094c98daec9416ceac92ca2cf3c099640f" + let installLinters: CF.Type = + [ CF.Statement.User "ghc" ] + # CF.run "cloning linter repository" + [ "git clone https://gitlab.haskell.org/ghc/git-haskell-org-hooks" + , "git -C git-haskell-org-hooks checkout ${lintersCommit}" + ] + # CF.run "building linters" + [ "cd git-haskell-org-hooks" + , "$CABAL install" + ] + + in + CF.from "${docker_base_url}/x86_64-linux-deb10:$CI_COMMIT_SHA" + # installMypy + # installLinters + } ] in images \ No newline at end of file diff --git a/image-jobs.dhall b/image-jobs.dhall index f899a7d..3e48c68 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -16,9 +16,9 @@ let toJob: Image.Type -> Prelude.Map.Entry Text GitLab.Job.Type = \(image: Image.Type) -> let - base: Text = "registry.gitlab.haskell.org/$CI_PROJECT_PATH" + docker_base_url: Text = "registry.gitlab.haskell.org/$CI_PROJECT_PATH" let - imageName: Text = "${base}/${image.name}" + imageName: Text = "${docker_base_url}/${image.name}" let job: GitLab.Job.Type = GitLab.Job:: @@ -28,6 +28,7 @@ let { DOCKER_DRIVER = "overlay2" , DOCKER_TLS_CERTDIR = "/certs" } + , dependencies = image.dependencies , services = Some [ "docker:19.03-dind" ] , script = [ "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY" -- GitLab From 88c6ba3c4175b830c7e9476fbfda51ddcf616105 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 12:33:31 -0400 Subject: [PATCH 46/74] Try generating CI configuration --- .gitlab-ci.yml | 124 ++++------------------------------------------- image-jobs.dhall | 1 + 2 files changed, 11 insertions(+), 114 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6302f33..099219e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,9 +16,11 @@ generate: - apt-get install -y curl tar bzip2 - curl -L $DHALL_URL | tar -jx - ./bin/dhall to-directory-tree --file=containers.dhall --output=dockerfiles + - ./bin/dhall text --file=image-jobs.dhall > image-jobs.yaml artifacts: paths: - dockerfiles + - image-jobs.yaml .lint: stage: lint @@ -29,118 +31,12 @@ generate: - cd dockerfiles - find . -name "Dockerfile" -print0 | xargs -0 -n1 hadolint -.build: +build: stage: build - before_script: - - docker info - - image: docker:19.03 - services: - - docker:19.03-dind - - variables: - CONTAINER_IMAGE_BASE: registry.gitlab.haskell.org/$CI_PROJECT_PATH - DOCKER_DRIVER: overlay2 - DOCKER_TLS_CERTDIR: "/certs" - - script: - - cd dockerfiles - - | - CONTAINER_IMAGE="$CONTAINER_IMAGE_BASE/$IMAGE" - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker pull $CONTAINER_IMAGE:latest || true - docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest $IMAGE - if [ -z "$CI_MERGE_REQUEST_ID" ]; then - docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA - docker push $CONTAINER_IMAGE:latest - fi - -build-linters: - extends: .build - variables: - IMAGE: linters - tags: - - docker - - x86_64-linux - -build-aarch64-linux-deb10: - extends: .build - variables: - IMAGE: aarch64-linux-deb10 - allow_failure: true - tags: - - docker - - aarch64-linux - -build-armv7-linux-deb10: - extends: .build - variables: - IMAGE: armv7-linux-deb10 - allow_failure: true - tags: - - docker - - armv7-linux - -build-i386-linux-deb9: - extends: .build - variables: - IMAGE: i386-linux-deb9 - tags: - - docker - - x86_64-linux - -build-x86_64-linux-centos7: - extends: .build - variables: - IMAGE: x86_64-linux-centos7 - tags: - - docker - - x86_64-linux - -build-x86_64-linux-alpine3_12: - extends: .build - variables: - IMAGE: x86_64-linux-alpine3_12 - tags: - - docker - - x86_64-linux - -build-x86_64-linux-deb8: - extends: .build - variables: - IMAGE: x86_64-linux-deb8 - tags: - - docker - - x86_64-linux - -build-x86_64-linux-deb9: - extends: .build - variables: - IMAGE: x86_64-linux-deb9 - tags: - - docker - - x86_64-linux - -build-x86_64-linux-deb10: - extends: .build - variables: - IMAGE: x86_64-linux-deb10 - tags: - - docker - - x86_64-linux - -build-x86_64-linux-fedora27: - extends: .build - variables: - IMAGE: x86_64-linux-fedora27 - tags: - - docker - - x86_64-linux - -build-x86_64-linux-ubuntu20_04: - extends: .build - variables: - IMAGE: x86_64-linux-ubuntu20_04 - tags: - - docker - - x86_64-linux + needs: + - generate + trigger: + include: + - artifact: image-jobs.yaml + job: generate + strategy: depend \ No newline at end of file diff --git a/image-jobs.dhall b/image-jobs.dhall index 3e48c68..7fa92a9 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -30,6 +30,7 @@ let } , dependencies = image.dependencies , services = Some [ "docker:19.03-dind" ] + , before_script = Some [ "docker info" ] , script = [ "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY" , "docker pull ${imageName}:latest || true" -- GitLab From 41987773b24dcb4f17fb6c67e122d4710319599f Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 12:51:55 -0400 Subject: [PATCH 47/74] try it --- .gitlab-ci.yml | 1 + GitLabCi.dhall | 2 +- Image.dhall | 8 ++++++-- debian.dhall | 3 ++- image-jobs.dhall | 6 +++--- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 099219e..ee1d17c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - prepare - lint - build + - build-derived generate: stage: prepare diff --git a/GitLabCi.dhall b/GitLabCi.dhall index 8c9a03e..dca6465 100644 --- a/GitLabCi.dhall +++ b/GitLabCi.dhall @@ -1 +1 @@ -https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/a681eff7e479c8bcbd6743052f8358b1222ffd17/package.dhall \ No newline at end of file +https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/84c72592054cc1399fc018093d3516e4116a4d51/package.dhall \ No newline at end of file diff --git a/Image.dhall b/Image.dhall index 4f3b1c1..26eb6c4 100644 --- a/Image.dhall +++ b/Image.dhall @@ -8,11 +8,15 @@ let type: Type = { name: ImageName , runnerTags: List Text - , dependencies: List ImageName + , jobStage: Text + , needs: List ImageName , image: CF.Type } in { Type = type -, default = { dependencies = [] : List ImageName } +, default = + { needs = [] : List ImageName + , jobStage = "build" + } , ImageName = ImageName } \ No newline at end of file diff --git a/debian.dhall b/debian.dhall index e850100..0125cf5 100644 --- a/debian.dhall +++ b/debian.dhall @@ -254,7 +254,8 @@ let images: List Image.Type = , Image:: { name = "linters" , runnerTags = [ "x86_64-linux" ] - , dependencies = [ "x86_64-linux-deb10" ] + , jobStage = "build-derived" + , needs = [ "x86_64-linux-deb10" ] , image = let installMypy: CF.Type = [ CF.Statement.User "root" ] diff --git a/image-jobs.dhall b/image-jobs.dhall index 7fa92a9..1d05d2f 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -22,13 +22,13 @@ let let job: GitLab.Job.Type = GitLab.Job:: - { stage = Some "build" - , image = Some "docker:19.03" + { image = Some "docker:19.03" + , stage = Some image.jobStage , variables = toMap { DOCKER_DRIVER = "overlay2" , DOCKER_TLS_CERTDIR = "/certs" } - , dependencies = image.dependencies + , needs = image.needs , services = Some [ "docker:19.03-dind" ] , before_script = Some [ "docker info" ] , script = -- GitLab From 17d30ec7e56f46b66753d3c2be5bed3b6b61d5fe Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 13:09:52 -0400 Subject: [PATCH 48/74] Try again --- image-jobs.dhall | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/image-jobs.dhall b/image-jobs.dhall index 1d05d2f..5b0e300 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -50,9 +50,11 @@ let jobs: Prelude.Map.Type Text GitLab.Job.Type = Prelude.List.map Image.Type (Prelude.Map.Entry Text GitLab.Job.Type) toJob images -let - json: Prelude.JSON.Type = - Prelude.JSON.object (Prelude.Map.map Text GitLab.Job.Type Prelude.JSON.Type GitLab.Job.toJSON jobs) +let top: GitLab.Top.Type = + GitLab.Top:: + { stages = Some [ "build", "build-derived" ] + , jobs = jobs + } in -Prelude.JSON.renderYAML json \ No newline at end of file +Prelude.JSON.renderYAML (GitLab.Top.toJSON top) \ No newline at end of file -- GitLab From 3e0d1736ca9e7839c7faa0fcfeb1b4f5eec096f5 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 13:16:00 -0400 Subject: [PATCH 49/74] Fix it --- image-jobs.dhall | 1 + 1 file changed, 1 insertion(+) diff --git a/image-jobs.dhall b/image-jobs.dhall index 5b0e300..226c89c 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -24,6 +24,7 @@ let GitLab.Job:: { image = Some "docker:19.03" , stage = Some image.jobStage + , tags = Some (image.runnerTags # [ "docker" ]) , variables = toMap { DOCKER_DRIVER = "overlay2" , DOCKER_TLS_CERTDIR = "/certs" -- GitLab From 746b35bd73e34a613be133a06d129b0da00882e5 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 13:20:31 -0400 Subject: [PATCH 50/74] hi --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee1d17c..ac95166 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ generate: - cd dockerfiles - find . -name "Dockerfile" -print0 | xargs -0 -n1 hadolint -build: +build-images: stage: build needs: - generate -- GitLab From 2ae3d06d6772c3660aba7c65f37fe0f421f46c4b Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 13:20:33 -0400 Subject: [PATCH 51/74] Drop old dockerfiles --- aarch64-linux-deb10/Dockerfile | 76 --------------------------- armv7-linux-deb10/Dockerfile | 78 ---------------------------- i386-linux-deb9/Dockerfile | 55 -------------------- linters/Dockerfile | 82 ------------------------------ x86_64-linux-alpine/Dockerfile | 81 ----------------------------- x86_64-linux-centos7/Dockerfile | 66 ------------------------ x86_64-linux-deb10/Dockerfile | 82 ------------------------------ x86_64-linux-deb9/Dockerfile | 67 ------------------------ x86_64-linux-fedora27/Dockerfile | 61 ---------------------- x86_64-linux-ubuntu2004/Dockerfile | 69 ------------------------- 10 files changed, 717 deletions(-) delete mode 100644 aarch64-linux-deb10/Dockerfile delete mode 100644 armv7-linux-deb10/Dockerfile delete mode 100644 i386-linux-deb9/Dockerfile delete mode 100644 linters/Dockerfile delete mode 100644 x86_64-linux-alpine/Dockerfile delete mode 100644 x86_64-linux-centos7/Dockerfile delete mode 100644 x86_64-linux-deb10/Dockerfile delete mode 100644 x86_64-linux-deb9/Dockerfile delete mode 100644 x86_64-linux-fedora27/Dockerfile delete mode 100644 x86_64-linux-ubuntu2004/Dockerfile diff --git a/aarch64-linux-deb10/Dockerfile b/aarch64-linux-deb10/Dockerfile deleted file mode 100644 index eab770a..0000000 --- a/aarch64-linux-deb10/Dockerfile +++ /dev/null @@ -1,76 +0,0 @@ -FROM arm64v8/debian:buster - -ENV LANG C.UTF-8 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -# Core build utilities -RUN apt-get update \ - && apt-get install --no-install-recommends -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \ - ca-certificates g++ git make automake autoconf gcc \ - perl python3 texinfo xz-utils lbzip2 bzip2 patch openssh-client sudo time \ - jq wget curl locales libnuma-dev \ - # For LLVM - libtinfo5 \ - # Documentation tools - python3-sphinx texlive-xetex texlive-latex-extra texlive-binaries texlive-fonts-recommended lmodern texlive-generic-extra \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Boot LLVM -ENV BOOT_LLVM_DIR /opt/llvm-bootstrap -ENV BOOT_LLVM_VERSION 7.0.0 -ENV PATH /usr/local/bin:$PATH -RUN curl -L https://releases.llvm.org/$BOOT_LLVM_VERSION/clang+llvm-$BOOT_LLVM_VERSION-aarch64-linux-gnu.tar.xz | tar -xJC . && \ - mkdir $BOOT_LLVM_DIR && \ - cp -R clang+llvm*/* $BOOT_LLVM_DIR && \ - rm -R clang+llvm* && \ - $BOOT_LLVM_DIR/bin/llc --version - -# GHC -ENV GHC_VERSION 8.8.3 -RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-aarch64-deb9-linux.tar.xz | tar -xJ -WORKDIR /ghc-$GHC_VERSION -RUN ./configure --prefix=/usr/local LLC=$BOOT_LLVM_DIR/bin/llc OPT=$BOOT_LLVM_DIR/bin/opt && \ - make install -WORKDIR / -RUN rm -Rf ghc-* -ENV GHC /usr/local/bin/ghc -RUN $ghc --version - -# LLVM -ENV LLVM_DIR /opt/llvm -ENV LLVM_VERSION 10.0.0 -ENV LLC $LLVM_DIR/bin/llc -ENV OPT $LLVM_DIR/bin/opt -RUN curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-aarch64-linux-gnu.tar.xz \ - | tar -xJC . && \ - mkdir $LLVM_DIR && \ - cp -R clang+llvm*/* $LLVM_DIR && \ - rm -R clang+llvm* && \ - llc --version - -# Cabal -ENV CABAL_VERSION 3.2.0.0 -RUN curl -L http://home.smart-cactus.org/~ben/ghc/cabal-install-$CABAL_VERSION-aarch64-debian9-linux.tar.xz | tar -Jx && \ - mv cabal /usr/local/bin/cabal -ENV CABAL /usr/local/bin/cabal - -# Create a normal user. -RUN adduser ghc --gecos "GHC builds" --disabled-password -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Build Haskell tools -RUN $CABAL v2-update && \ - $CABAL install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour - -CMD ["bash"] - diff --git a/armv7-linux-deb10/Dockerfile b/armv7-linux-deb10/Dockerfile deleted file mode 100644 index f056865..0000000 --- a/armv7-linux-deb10/Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -FROM arm32v7/debian:buster - -ENV LANG C.UTF-8 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -# Core build utilities -RUN apt-get update \ - && apt-get install --no-install-recommends -qy zlib1g-dev libtinfo-dev libgmp10 libgmp-dev \ - libsqlite3-0 libsqlite3-dev \ - ca-certificates g++ git make automake autoconf gcc \ - perl python3 texinfo xz-utils lbzip2 bzip2 patch openssh-client sudo time \ - jq wget curl locales \ - # For LLVM - libtinfo5 \ - # Documentation tools - python3-sphinx texlive-xetex texlive-latex-extra texlive-binaries texlive-fonts-recommended lmodern texlive-generic-extra \ - cabal-install \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Boot LLVM -ENV BOOT_LLVM_DIR /opt/llvm-bootstrap -ENV BOOT_LLVM_VERSION 7.0.0 -ENV PATH /usr/local/bin:$PATH -RUN curl -L https://releases.llvm.org/$BOOT_LLVM_VERSION/clang+llvm-$BOOT_LLVM_VERSION-armv7a-linux-gnueabihf.tar.xz | tar -xJC . && \ - mkdir $BOOT_LLVM_DIR && \ - cp -R clang+llvm*/* $BOOT_LLVM_DIR && \ - rm -R clang+llvm* && \ - $BOOT_LLVM_DIR/bin/llc --version - -# GHC -ENV GHC_VERSION 8.8.1 -RUN curl -L https://downloads.haskell.org/ghc/$GHC_VERSION/ghc-$GHC_VERSION-armv7l-deb9-linux.tar.xz | tar -xJ -WORKDIR /ghc-$GHC_VERSION -RUN ./configure --prefix=/usr/local LLC=$BOOT_LLVM_DIR/bin/llc OPT=$BOOT_LLVM_DIR/bin/opt && \ - make install -WORKDIR / -RUN rm -Rf ghc-* -ENV GHC /usr/local/bin/ghc -RUN $GHC --version - -# LLVM -ENV LLVM_DIR /opt/llvm -ENV LLVM_VERSION 10.0.0 -ENV LLC $LLVM_DIR/bin/llc -ENV OPT $LLVM_DIR/bin/opt -RUN curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-armv7a-linux-gnueabihf.tar.xz \ - | tar -xJC . && \ - mkdir $LLVM_DIR && \ - cp -R clang+llvm*/* $LLVM_DIR && \ - rm -R clang+llvm* && \ - llc --version - -# Cabal -ENV CABAL_VERSION 3.2.0.0 -RUN cabal update && cabal install "cabal-install==$CABAL_VERSION" && \ - mv "$HOME/.cabal/bin/cabal" /usr/local/bin/cabal -ENV CABAL /usr/local/bin/cabal - -# Create a normal user. -RUN adduser ghc --gecos "GHC builds" --disabled-password -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Build Haskell tools -RUN $CABAL v2-update && \ - $CABAL install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour - -CMD ["bash"] - diff --git a/i386-linux-deb9/Dockerfile b/i386-linux-deb9/Dockerfile deleted file mode 100644 index 23a3b04..0000000 --- a/i386-linux-deb9/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -FROM i386/debian:stretch - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -ENV LANG C.UTF-8 - -# Core build utilities -RUN apt-get update -qq \ - && apt-get install --no-install-recommends -qy zlib1g-dev libtinfo-dev \ - libsqlite3-0 libsqlite3-dev \ - ca-certificates g++ git make automake autoconf gcc \ - perl python3 texinfo xz-utils pxz lbzip2 bzip2 patch openssh-client sudo time \ - jq wget curl locales \ - # Documentation tools - python3-pip texlive-xetex texlive-latex-extra texlive-generic-extra texlive-fonts-recommended lmodern \ - # Core build utilities - libgmp-dev:i386 \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* -RUN pip3 install sphinx==2.3.1 - -WORKDIR /tmp -# Get i386 GHC bindist for 32 bit CI builds. -ENV GHC_VERSION 8.8.3 -RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-i386-deb9-linux.tar.xz | tar -Jx; -WORKDIR /tmp/ghc-$GHC_VERSION -RUN setarch i386 ./configure --prefix=/opt/ghc-i386/$GHC_VERSION CFLAGS=-m32 --target=i386-unknown-linux --build=i386-unknown-linux --host=i386-unknown-linux; \ - make install; \ - rm -rf /tmp/ghc-$GHC_VERSION -ENV GHC /opt/ghc-i386/$GHC_VERSION/bin/ghc - -WORKDIR /tmp -# Get Cabal -ENV CABAL_VERSION 3.2.0.0 -RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-i386-unknown-linux.tar.xz | tar -Jx && \ - mv cabal /usr/local/bin/cabal -ENV CABAL /usr/local/bin/cabal - -# Create a normal user. -RUN adduser ghc --gecos "GHC builds" --disabled-password -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Build Haskell tools -RUN $CABAL v2-update && \ - $CABAL v2-install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour - -CMD ["bash"] diff --git a/linters/Dockerfile b/linters/Dockerfile deleted file mode 100644 index 3e3160b..0000000 --- a/linters/Dockerfile +++ /dev/null @@ -1,82 +0,0 @@ -FROM debian:buster - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -ENV LANG C.UTF-8 - -RUN apt-get update -qq; apt-get install --no-install-recommends -qy gnupg dirmngr \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# http://downloads.haskell.org/debian/ -RUN echo 'deb http://downloads.haskell.org/debian buster main' > /etc/apt/sources.list.d/ghc.list -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574 - -# Core build utilities -RUN apt-get update -qq && apt-get install --no-install-recommends -qy \ - zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev libgmp-dev \ - ca-certificates g++ git make automake autoconf gcc \ - perl python3 texinfo xz-utils lbzip2 bzip2 patch openssh-client sudo time \ - jq wget curl \ - # For source distributions - xutils-dev \ - # DWARF libraries - libdw1 libdw-dev \ - # For nofib - valgrind \ - # Documentation tools - python3-sphinx texlive-xetex texlive-latex-extra texlive-binaries texlive-fonts-recommended lmodern texlive-generic-extra \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - - -WORKDIR /tmp -# Install GHC and cabal -ENV GHC_VERSION 8.8.3 -RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-deb10-linux.tar.xz \ - | tar -Jx; -WORKDIR /tmp/ghc-$GHC_VERSION -RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ - make install; -ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc -WORKDIR /tmp -RUN rm -rf /tmp/ghc-$GHC_VERSION - -# Get Cabal -ENV CABAL_VERSION 3.2.0.0 -RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ - mv cabal /usr/local/bin/cabal -ENV CABAL /usr/local/bin/cabal - -# Create a normal user. -RUN adduser ghc --gecos "GHC builds" --disabled-password -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Build Haskell tools -RUN $CABAL v2-update && \ - $CABAL v2-install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour - -# Build Linting tools -USER root -RUN apt-get update -qq; apt-get install --no-install-recommends -qy python3-pip \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* -RUN pip3 install mypy==0.701 -USER ghc - -RUN $CABAL v2-update -ENV LINTER_COMMIT b5650c094c98daec9416ceac92ca2cf3c099640f -RUN git clone https://gitlab.haskell.org/ghc/git-haskell-org-hooks && \ - git -C git-haskell-org-hooks checkout $LINTER_COMMIT -WORKDIR /home/ghc/git-haskell-org-hooks -RUN $CABAL install - -CMD ["bash"] diff --git a/x86_64-linux-alpine/Dockerfile b/x86_64-linux-alpine/Dockerfile deleted file mode 100644 index e2c730c..0000000 --- a/x86_64-linux-alpine/Dockerfile +++ /dev/null @@ -1,81 +0,0 @@ -FROM alpine:3.12.0 - -SHELL ["/bin/ash", "-eo", "pipefail", "-c"] - -RUN echo "Installing GHC build dependencies..." && \ - apk add --no-cache \ - autoconf=~2.69 \ - automake=~1.16 \ - binutils-gold=~2.34 \ - build-base=~0.5 \ - coreutils=~8.32 \ - cpio=~2.13 \ - linux-headers=~5.4 \ - libffi-dev=~3.3 \ - musl-dev=~1 \ - ncurses-dev=~6.2 \ - ncurses-static=~6.2 \ - python3=~3.8 \ - py3-sphinx=~2.4 \ - zlib-dev=~1.2 \ - xz=~5.2 \ - bash=~5.0 \ - git=~2.26 \ - wget=~1.20 \ - sudo=~1.9 \ - grep=~3 \ - curl=~7.69 \ - gmp-dev=~6.2 \ - cabal=~3.2 \ - ghc=~8.8 \ - texlive=~20190410 \ - texlive-xetex=~20190410 \ - texmf-dist-latexextra=~2020 \ - ttf-dejavu=~2.37 - -WORKDIR /tmp -# Install GHC -ENV GHC_VERSION 8.8.3 -# NB: This is not an official bindist, but rather an alternative bindist taken -# from https://github.com/redneb/ghc-alt-libc. -RUN curl -L https://github.com/redneb/ghc-alt-libc/releases/download/ghc-$GHC_VERSION-musl/ghc-$GHC_VERSION-x86_64-unknown-linux-musl.tar.xz | tar -Jx; -# The ghc-alt-libc bindist requires libtinfow.so.6, so symlink what Alpine -# provides. This hack can likely be removed when we start using GHC's native -# Alpine bindists in the future. -RUN ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfow.so.6 -WORKDIR /tmp/ghc-$GHC_VERSION -RUN ./configure --disable-ld-override --prefix=/opt/ghc/$GHC_VERSION; \ - make install; -ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc - -WORKDIR /tmp -RUN rm -rf /tmp/ghc-$GHC_VERSION -ENV PATH /opt/ghc/$GHC_VERSION/bin:$PATH - -# Create a normal user. -RUN adduser ghc --gecos "GHC builds" --disabled-password -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Install cabal -#RUN cabal v2-update && \ -# cabal v2-install cabal-install --constraint 'cabal-install ^>= 3.0' -w $BOOT_GHC -#ENV PATH /home/ghc/.cabal/bin:$PATH - -# N.B. We currently cabal-install from the Alpine repository -ENV CABAL /usr/bin/cabal - -# Build Haskell tools -RUN $CABAL user-config update && \ - $CABAL v2-update && \ - $CABAL v2-install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour -ENV SPHINXBUILD /usr/bin/sphinx-build-3 - -CMD ["bash"] diff --git a/x86_64-linux-centos7/Dockerfile b/x86_64-linux-centos7/Dockerfile deleted file mode 100644 index 5425bf1..0000000 --- a/x86_64-linux-centos7/Dockerfile +++ /dev/null @@ -1,66 +0,0 @@ -FROM centos:7 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -ENV LANG C.UTF-8 - -# Core build utilities -RUN yum -y install coreutils binutils which git make \ - automake autoconf gcc perl python3 texinfo xz pxz lbzip2 bzip2 \ - patch openssh-clients sudo zlib-devel sqlite \ - ncurses-compat-libs gmp-devel ncurses-devel gcc-c++ findutils \ - curl wget jq - -# Documentation tools -RUN yum -y install python-sphinx \ - texlive texlive-latex texlive-xetex \ - texlive-collection-latex texlive-collection-latexrecommended \ - texlive-xetex-def texlive-collection-xetex \ - python-sphinx-latex dejavu-sans-fonts dejavu-serif-fonts \ - dejavu-sans-mono-fonts - -# This is in the PATH when I ssh into the CircleCI machine but somehow -# sphinx-build isn't found during configure unless we explicitly -# add it here as well; perhaps PATH is being overridden by CircleCI's -# infrastructure? -ENV PATH /usr/libexec/python3-sphinx:$PATH - -# systemd isn't running so remove it from nsswitch.conf -# Failing to do this will result in testsuite failures due to -# non-functional user lookup (#15230). -RUN sed -i -e 's/systemd//g' /etc/nsswitch.conf - -WORKDIR /tmp -# Install GHC and cabal -ENV GHC_VERSION 8.8.3 -RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-centos7-linux.tar.xz | tar -Jx -WORKDIR /tmp/ghc-$GHC_VERSION -RUN ./configure --prefix=/opt/ghc/$GHC_VERSION && make install -ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc -WORKDIR /tmp -RUN rm -rf /tmp/ghc-$GHC_VERSION - -WORKDIR /tmp -# Get Cabal -ENV CABAL_VERSION 3.2.0.0 -RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ - mv cabal /usr/local/bin/cabal -ENV CABAL /usr/local/bin/cabal - -# Create a normal user. -RUN adduser ghc --comment "GHC builds" -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Build Haskell tools -RUN $CABAL v2-update && \ - $CABAL v2-install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour - -CMD ["bash"] diff --git a/x86_64-linux-deb10/Dockerfile b/x86_64-linux-deb10/Dockerfile deleted file mode 100644 index 181b3a1..0000000 --- a/x86_64-linux-deb10/Dockerfile +++ /dev/null @@ -1,82 +0,0 @@ -FROM debian:buster - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -ENV LANG C.UTF-8 - -RUN apt-get update -qq; apt-get install --no-install-recommends -qy gnupg dirmngr \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# http://downloads.haskell.org/debian/ -RUN echo 'deb http://downloads.haskell.org/debian buster main' > /etc/apt/sources.list.d/ghc.list -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574 - -# Core build utilities -RUN apt-get update -qq && apt-get install --no-install-recommends -qy \ - zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev libgmp-dev \ - ca-certificates g++ git make automake autoconf gcc \ - perl python3 texinfo xz-utils lbzip2 bzip2 patch openssh-client sudo time \ - jq wget curl locales \ - # For source distributions - xutils-dev \ - # DWARF libraries - libdw1 libdw-dev \ - # For nofib - valgrind \ - # For LLVM - libtinfo5 \ - # Documentation tools - python3-pip texlive-xetex texlive-latex-extra texlive-binaries texlive-fonts-recommended lmodern texlive-generic-extra \ - # For cross compilation - crossbuild-essential-arm64 \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* -RUN pip3 install sphinx==2.3.1 - -WORKDIR /tmp -# Install GHC and cabal -ENV GHC_VERSION 8.8.1 -#RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-deb10-linux.tar.xz | tar -Jx; -RUN curl -L http://home.smart-cactus.org/~ben/ghc/release-prep/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-deb10-linux.tar.xz | tar -Jx; -WORKDIR /tmp/ghc-$GHC_VERSION -RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ - make install; -ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc -WORKDIR /tmp -RUN rm -rf /tmp/ghc-$GHC_VERSION - -# Get Cabal -ENV CABAL_VERSION 3.2.0.0 -RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ - mv cabal /usr/local/bin/cabal -ENV CABAL /usr/local/bin/cabal - -# LLVM -ENV LLVM_DIR /opt/llvm -ENV LLVM_VERSION 7.0.0 -ENV PATH $LLVM_DIR/bin:$PATH -RUN curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz \ - | tar -xJC .; \ - mkdir $LLVM_DIR && \ - cp -R clang+llvm*/* $LLVM_DIR && \ - rm -R clang+llvm* && \ - llc --version - -# Create a normal user. -RUN adduser ghc --gecos "GHC builds" --disabled-password -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Build Haskell tools -RUN $CABAL v2-update && \ - $CABAL v2-install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour - -CMD ["bash"] diff --git a/x86_64-linux-deb9/Dockerfile b/x86_64-linux-deb9/Dockerfile deleted file mode 100644 index 89707fa..0000000 --- a/x86_64-linux-deb9/Dockerfile +++ /dev/null @@ -1,67 +0,0 @@ -FROM debian:stretch - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -ENV LANG C.UTF-8 - -RUN apt-get update -qq; apt-get install --no-install-recommends -qy gnupg dirmngr \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# http://downloads.haskell.org/debian/ -RUN echo 'deb http://downloads.haskell.org/debian stretch main' > /etc/apt/sources.list.d/ghc.list -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574 - -# Core build utilities -RUN apt-get update -qq && apt-get install --no-install-recommends -qy \ - zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev libgmp-dev \ - ca-certificates g++ git make automake autoconf gcc \ - perl python3 texinfo xz-utils pxz lbzip2 bzip2 patch openssh-client sudo time \ - jq wget curl locales \ - # For source distributions - xutils-dev \ - # DWARF libraries - libdw1 libdw-dev \ - # For nofib - valgrind \ - # Documentation tools - texlive-xetex texlive-latex-extra texlive-binaries texlive-fonts-recommended lmodern texlive-generic-extra \ - python3-pip \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* -RUN pip3 install sphinx==2.3.1 - -WORKDIR /tmp -# Install GHC and cabal -ENV GHC_VERSION 8.8.3 -RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-deb9-linux.tar.xz | tar -Jx; -WORKDIR /tmp/ghc-$GHC_VERSION -RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ - make install; -ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc -WORKDIR /tmp -RUN rm -rf /tmp/ghc-$GHC_VERSION - -# Get Cabal -ENV CABAL_VERSION 3.2.0.0 -RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ - mv cabal /usr/local/bin/cabal -ENV CABAL /usr/local/bin/cabal - -# Create a normal user. -RUN adduser ghc --gecos "GHC builds" --disabled-password -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Build Haskell tools -RUN $CABAL v2-update && \ - $CABAL v2-install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour - -CMD ["bash"] diff --git a/x86_64-linux-fedora27/Dockerfile b/x86_64-linux-fedora27/Dockerfile deleted file mode 100644 index 9289440..0000000 --- a/x86_64-linux-fedora27/Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -FROM fedora:27 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -ENV LANG C.UTF-8 - -# Core build utilities -RUN dnf -y install coreutils binutils which git make \ - automake autoconf gcc perl python3 texinfo xz pxz bzip2 lbzip2 \ - patch openssh-clients sudo zlib-devel sqlite \ - ncurses-compat-libs gmp-devel ncurses-devel gcc-c++ findutils \ - curl wget jq - -# Documentation tools -RUN dnf -y install python3-pip \ - texlive texlive-latex texlive-xetex \ - texlive-collection-latex texlive-collection-latexrecommended \ - texlive-xetex-def texlive-collection-xetex \ - python-sphinx-latex dejavu-sans-fonts dejavu-serif-fonts \ - dejavu-sans-mono-fonts -RUN pip3 install sphinx==2.3.1 - -# systemd isn't running so remove it from nsswitch.conf -# Failing to do this will result in testsuite failures due to -# non-functional user lookup (#15230). -RUN sed -i -e 's/systemd//g' /etc/nsswitch.conf - -WORKDIR /tmp -# Install GHC and cabal -ENV GHC_VERSION 8.8.3 -RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-fedora27-linux.tar.xz | tar -Jx; -WORKDIR /tmp/ghc-$GHC_VERSION -RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ - make install; \ - rm -rf /tmp/ghc-$GHC_VERSION -ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc -WORKDIR /tmp - -# Get Cabal -ENV CABAL_VERSION 3.2.0.0 -RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ - mv cabal /usr/local/bin/cabal -ENV CABAL /usr/local/bin/cabal - -# Create a normal user. -RUN adduser ghc --comment "GHC builds" -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Build Haskell tools -RUN $CABAL v2-update && \ - $CABAL v2-install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour - -CMD ["bash"] diff --git a/x86_64-linux-ubuntu2004/Dockerfile b/x86_64-linux-ubuntu2004/Dockerfile deleted file mode 100644 index 3f03157..0000000 --- a/x86_64-linux-ubuntu2004/Dockerfile +++ /dev/null @@ -1,69 +0,0 @@ -FROM ubuntu:20.04 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -ENV LANG C.UTF-8 -ARG DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq; apt-get install --no-install-recommends -qy gnupg dirmngr \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# http://downloads.haskell.org/debian/ -RUN echo 'deb http://downloads.haskell.org/debian stretch main' > /etc/apt/sources.list.d/ghc.list -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574 - -# Core build utilities -RUN apt-get update -qq && apt-get install --no-install-recommends -qy \ - zlib1g-dev libtinfo-dev libtinfo5 libsqlite3-0 libsqlite3-dev libgmp-dev \ - ca-certificates g++ git make automake autoconf gcc \ - perl python3 texinfo xz-utils lbzip2 bzip2 patch openssh-client sudo time \ - jq wget curl locales \ - # For source distributions - xutils-dev \ - # DWARF libraries - libdw1 libdw-dev \ - # For nofib - valgrind \ - # Documentation tools - texlive-xetex texlive-latex-extra texlive-binaries texlive-fonts-recommended lmodern texlive-plain-generic \ - python3-pip \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* -RUN pip3 install sphinx==2.3.1 - -WORKDIR /tmp -# Install GHC and cabal -ENV GHC_VERSION 8.8.3 -RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-deb9-linux.tar.xz | tar -Jx; -WORKDIR /tmp/ghc-$GHC_VERSION -RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ - make install; - -WORKDIR /tmp -RUN rm -rf /tmp/ghc-$GHC_VERSION -ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc - -# Get Cabal -ENV CABAL_VERSION 3.2.0.0 -RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ - mv cabal /usr/local/bin/cabal -ENV CABAL /usr/local/bin/cabal - -# Create a normal user. -RUN adduser ghc --gecos "GHC builds" --disabled-password -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Build Haskell tools -RUN $CABAL v2-update && \ - $CABAL v2-install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour - -CMD ["bash"] -- GitLab From e5ac812e4d7c7cd5c688a6daa3b266afa2d39a08 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 13:31:33 -0400 Subject: [PATCH 52/74] Keep going --- .gitlab-ci.yml | 16 ++-------------- image-jobs.dhall | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac95166..f47ab63 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,8 @@ stages: - prepare - - lint - build - - build-derived +# Generate the CI configuration generate: stage: prepare image: debian:buster @@ -12,26 +11,15 @@ generate: tags: - x86_64-linux script: - - mkdir -p dockerfiles - apt-get update - apt-get install -y curl tar bzip2 - curl -L $DHALL_URL | tar -jx - - ./bin/dhall to-directory-tree --file=containers.dhall --output=dockerfiles - ./bin/dhall text --file=image-jobs.dhall > image-jobs.yaml artifacts: paths: - - dockerfiles - image-jobs.yaml -.lint: - stage: lint - image: hadolint/hadolint:latest-debian - tags: - - x86_64-linux - script: - - cd dockerfiles - - find . -name "Dockerfile" -print0 | xargs -0 -n1 hadolint - +# Spawn a child pipeline to lint and build the Dockerfiles build-images: stage: build needs: diff --git a/image-jobs.dhall b/image-jobs.dhall index 226c89c..fb2e0a9 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -47,14 +47,46 @@ let in Prelude.Map.keyValue GitLab.Job.Type image.name job +let + dockerfilesJob = + let + dhallUrl = "https://github.com/dhall-lang/dhall-haskell/releases/download/1.34.0/dhall-1.34.0-x86_64-linux.tar.bz2" + in GitLab.Job:: + { stage = Some "prepare" + , image = Some "debian:buster" + , tags = Some [ "x86_64-linux" ] + , script = [ + , "mkdir -p dockerfiles" + , "apt-get update" + , "apt-get install -y curl tar bzip2" + , "curl -L ${dhallUrl} | tar -jx" + , "./bin/dhall to-directory-tree --file=containers.dhall --output=dockerfiles" + ] + , artifacts = + Some (GitLab.ArtifactsSpec:: { paths = [ "dockerfiles" ] }) + } + +let + lintJob = + GitLab.Job:: + { stage = Some "lint" + , image = Some "hadolint/hadolint:latest-debian" + , tags = Some [ "x86_64-linux" ] + , script = + [ "find dockerfiles -name Dockerfile -print0 | xargs -0 -n1 hadolint" ] + } + let jobs: Prelude.Map.Type Text GitLab.Job.Type = Prelude.List.map Image.Type (Prelude.Map.Entry Text GitLab.Job.Type) toJob images let top: GitLab.Top.Type = GitLab.Top:: - { stages = Some [ "build", "build-derived" ] - , jobs = jobs + { stages = Some [ "prepare", "lint", "build", "build-derived" ] + , jobs = jobs # toMap + { generate-dockerfiles = dockerfilesJob + , lint = lintJob + } } in -- GitLab From 1f64d7fb4d3cbb56549ea124e255428e02c2ed2e Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 13:35:05 -0400 Subject: [PATCH 53/74] Disable linting for now --- image-jobs.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image-jobs.dhall b/image-jobs.dhall index fb2e0a9..216c651 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -85,7 +85,7 @@ let top: GitLab.Top.Type = { stages = Some [ "prepare", "lint", "build", "build-derived" ] , jobs = jobs # toMap { generate-dockerfiles = dockerfilesJob - , lint = lintJob + -- , lint = lintJob } } -- GitLab From 1513cc181087a697eb41677d19f43166001346a3 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 13:48:21 -0400 Subject: [PATCH 54/74] Docker-ify deb8 --- debian.dhall | 12 +++++++++ x86_64-linux-deb8/Dockerfile | 52 ------------------------------------ 2 files changed, 12 insertions(+), 52 deletions(-) delete mode 100644 x86_64-linux-deb8/Dockerfile diff --git a/debian.dhall b/debian.dhall index 0125cf5..487367e 100644 --- a/debian.dhall +++ b/debian.dhall @@ -239,6 +239,18 @@ let images: List Image.Type = , extraPackages = debianBuildDepends : List Text } +, DebianImage.toDocker + { name = "x86_64-linux-deb8" + , fromImage = "amd64/debian:jessie" + , runnerTags = [ "x86_64-linux" ] + , bootstrapLlvm = None TripleVersion + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb8-linux" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } + , ghcVersion = "8.8.3" + , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } + , extraPackages = debianBuildDepends : List Text + } + , DebianImage.toDocker { name = "x86_64-linux-ubuntu20_04" , fromImage = "amd64/ubuntu:20.04" diff --git a/x86_64-linux-deb8/Dockerfile b/x86_64-linux-deb8/Dockerfile deleted file mode 100644 index 33834d7..0000000 --- a/x86_64-linux-deb8/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -FROM debian:jessie - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -ENV LANG C.UTF-8 - -# Core build utilities -RUN apt-get update -qq && apt-get install --no-install-recommends -qy zlib1g-dev \ - libtinfo-dev libsqlite3-0 libsqlite3-dev \ - ca-certificates g++ git make automake autoconf gcc \ - perl python3 texinfo xz-utils pxz lbzip2 bzip2 patch openssh-client sudo libgmp-dev time \ - jq wget curl locales \ - # Documentation tools - python3-sphinx texlive-xetex texlive-latex-extra \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - - -WORKDIR /tmp -# Install GHC and cabal -ENV GHC_VERSION 8.8.3 -RUN curl -L https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-deb8-linux.tar.xz | tar -Jx; -WORKDIR /tmp/ghc-$GHC_VERSION -RUN ./configure --prefix=/opt/ghc/$GHC_VERSION; \ - make install; -ENV GHC /opt/ghc/$GHC_VERSION/bin/ghc -WORKDIR /tmp -RUN rm -rf /tmp/ghc-$GHC_VERSION - -# Get Cabal -ENV CABAL_VERSION 3.2.0.0 -RUN curl -L https://downloads.haskell.org/cabal/cabal-install-$CABAL_VERSION/cabal-install-$CABAL_VERSION-x86_64-unknown-linux.tar.xz | tar -Jx && \ - mv cabal /usr/local/bin/cabal -ENV CABAL /usr/local/bin/cabal - -# Create a normal user. -RUN adduser ghc --gecos "GHC builds" --disabled-password -RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc -USER ghc -WORKDIR /home/ghc/ - -# Build Haskell tools -RUN $CABAL v2-update && \ - $CABAL v2-install hscolour happy alex \ - --constraint 'happy ^>= 1.20.0' \ - --enable-static --install-method=copy \ - --installdir=/usr/local/bin -ENV HAPPY /usr/local/bin/happy -ENV ALEX /usr/local/bin/alex -ENV HSCOLOUR /usr/local/bin/hscolour - -CMD ["bash"] -- GitLab From 16f48ebb213ed0810dd7337d57f2494c98446903 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 13:58:03 -0400 Subject: [PATCH 55/74] Refactor --- GhcBindist.dhall | 18 +++++++++++++----- centos.dhall | 9 +++------ debian.dhall | 18 ++++-------------- fedora.dhall | 9 +++------ 4 files changed, 23 insertions(+), 31 deletions(-) diff --git a/GhcBindist.dhall b/GhcBindist.dhall index 2954dc4..75cd5a3 100644 --- a/GhcBindist.dhall +++ b/GhcBindist.dhall @@ -3,11 +3,16 @@ let let CF = ./Containerfile.dhall +let + BindistSpec: Type = + { version : Text + , triple : Text + } + let Options = { Type = - { version : Text - , triple : Text + { bindist : BindistSpec , destDir : Text , configureOpts : List Text } @@ -20,18 +25,21 @@ let install: Options.Type -> CF.Type = \(opts: Options.Type) -> let - bindistUrl: Text = "https://downloads.haskell.org/~ghc/${opts.version}/ghc-${opts.version}-${opts.triple}.tar.xz" + version = opts.bindist.version + let + bindistUrl: Text = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-${opts.bindist.triple}.tar.xz" in CF.run "fetch GHC" [ "curl -L ${bindistUrl} | tar -Jx -C /tmp" ] # CF.run "configure bindist" - [ "cd /tmp/ghc-${opts.version}*" + [ "cd /tmp/ghc-${version}*" , "./configure ${Prelude.Text.concatSep " " opts.configureOpts} --prefix=${opts.destDir}" , "make install" ] - # CF.run "remove temporary directory" [ "rm -Rf /tmp/ghc-${opts.version}-*" ] + # CF.run "remove temporary directory" [ "rm -Rf /tmp/ghc-${version}-*" ] # CF.run "test GHC" [ "${opts.destDir}/bin/ghc --version" ] in { Options = Options +, BindistSpec = BindistSpec , install = install } \ No newline at end of file diff --git a/centos.dhall b/centos.dhall index 9086c9b..688c621 100644 --- a/centos.dhall +++ b/centos.dhall @@ -98,14 +98,13 @@ let { name : Text , fromImage : Text , runnerTags : List Text - , bootstrapGhc : TripleVersion + , bootstrapGhc : GhcBindist.BindistSpec , llvm : Optional TripleVersion - , ghcVersion : Text } let toDocker: type -> Image.Type = \(opts : type) -> let - ghcDir: Text = "/opt/ghc/${opts.ghcVersion}" + ghcDir: Text = "/opt/ghc/${opts.bootstrapGhc.version}" let llvmDir: Text = "/opt/llvm" @@ -120,8 +119,7 @@ let -- install GHC # GhcBindist.install - { version = opts.bootstrapGhc.version - , triple = opts.bootstrapGhc.triple + { bindist = opts.bootstrapGhc , destDir = ghcDir , configureOpts = [] : List Text } @@ -158,7 +156,6 @@ let images: List Image.Type = , runnerTags = [ "x86_64-linux" ] , bootstrapGhc = { version = "8.8.3", triple = "x86_64-centos7-linux" } , llvm = None TripleVersion - , ghcVersion = "8.8.3" } ] in images \ No newline at end of file diff --git a/debian.dhall b/debian.dhall index 487367e..142aac8 100644 --- a/debian.dhall +++ b/debian.dhall @@ -104,9 +104,8 @@ let , fromImage : Text , runnerTags : List Text , bootstrapLlvm : Optional TripleVersion - , bootstrapGhc : TripleVersion + , bootstrapGhc : GhcBindist.BindistSpec , llvm : Optional TripleVersion - , ghcVersion : Text , cabalSource : Cabal.Type , extraPackages: List Text } @@ -114,7 +113,7 @@ let let toDocker: type -> Image.Type = \(opts : type) -> let - ghcDir: Text = "/opt/ghc/${opts.ghcVersion}" + ghcDir: Text = "/opt/ghc/${opts.bootstrapGhc.version}" let bootLlvmDir: Text = "/opt/llvm-bootstrap" let @@ -137,8 +136,7 @@ let -- install GHC # GhcBindist.install - { version = opts.bootstrapGhc.version - , triple = opts.bootstrapGhc.triple + { bindist = opts.bootstrapGhc , destDir = ghcDir , configureOpts = bootstrapLlvmConfigureOptions } @@ -171,7 +169,6 @@ let images: List Image.Type = , bootstrapLlvm = Some { version = "7.1.0" , triple = "aarch64-linux-gnu" } , bootstrapGhc = { version = "8.8.3", triple = "aarch64-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "aarch64-linux-gnu" } - , ghcVersion = "8.10.2" , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" , extraPackages = [] : List Text } @@ -181,9 +178,8 @@ let images: List Image.Type = , fromImage = "arm32v7/debian:buster" , runnerTags = [ "armv7-linux" ] , bootstrapLlvm = Some { version = "7.1.0", triple = "armv7a-linux-gnueabihf" } - , bootstrapGhc = { version = "8.8.3", triple = "armv7-deb9-linux" } + , bootstrapGhc = { version = "8.10.2", triple = "armv7-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } - , ghcVersion = "8.10.2" , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" , extraPackages = debianBuildDepends } @@ -195,7 +191,6 @@ let images: List Image.Type = , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } , llvm = None TripleVersion - , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromBindist "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz" , extraPackages = debianBuildDepends # [ "cabal-install" ] : List Text } @@ -207,7 +202,6 @@ let images: List Image.Type = , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "i386-deb10-linux" } , llvm = None TripleVersion - , ghcVersion = "8.8.3" , cabalSource = Cabal.Type.FromSource "3.2.0.0" , extraPackages = debianBuildDepends # [ "cabal-install" ] : List Text } @@ -219,7 +213,6 @@ let images: List Image.Type = , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } - , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = debianBuildDepends @@ -234,7 +227,6 @@ let images: List Image.Type = , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } - , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = debianBuildDepends : List Text } @@ -246,7 +238,6 @@ let images: List Image.Type = , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb8-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } - , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = debianBuildDepends : List Text } @@ -258,7 +249,6 @@ let images: List Image.Type = , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } - , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = ubuntuBuildDepends } diff --git a/fedora.dhall b/fedora.dhall index d20e31e..afef7ee 100644 --- a/fedora.dhall +++ b/fedora.dhall @@ -92,9 +92,8 @@ let , fromImage : Text , runnerTags : List Text , bootstrapLlvm : Optional TripleVersion - , bootstrapGhc : TripleVersion + , bootstrapGhc : GhcBindist.BindistSpec , llvm : Optional TripleVersion - , ghcVersion : Text , cabalSource : Cabal.Type , extraPackages: List Text } @@ -102,7 +101,7 @@ let let toDocker: type -> Image.Type = \(opts : type) -> let - ghcDir: Text = "/opt/ghc/${opts.ghcVersion}" + ghcDir: Text = "/opt/ghc/${opts.bootstrapGhc.version}" let bootLlvmDir: Text = "/opt/llvm-bootstrap" let @@ -125,8 +124,7 @@ let -- install GHC # GhcBindist.install - { version = opts.bootstrapGhc.version - , triple = opts.bootstrapGhc.triple + { bindist = opts.bootstrapGhc , destDir = ghcDir , configureOpts = bootstrapLlvmConfigureOptions } @@ -159,7 +157,6 @@ let images: List Image.Type = , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-fedora27-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } - , ghcVersion = "8.8.3" , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = [] : List Text } -- GitLab From 471c9ea4960b794045d7bdd27800f84a83a5f7ed Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:03:40 -0400 Subject: [PATCH 56/74] Fix it --- image-jobs.dhall | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/image-jobs.dhall b/image-jobs.dhall index 216c651..9e9b759 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -12,6 +12,10 @@ let let images: List Image.Type = ./all-images.dhall +let + mkJobEntry: Text -> GitLab.Job.Type -> Prelude.Map.Type Text GitLab.Job.Type = + Prelude.Map.keyValue GitLab.Job.Type + let toJob: Image.Type -> Prelude.Map.Entry Text GitLab.Job.Type = \(image: Image.Type) -> @@ -45,7 +49,7 @@ let ] } - in Prelude.Map.keyValue GitLab.Job.Type image.name job + in mkJobEntry image.name job let dockerfilesJob = @@ -54,6 +58,7 @@ let in GitLab.Job:: { stage = Some "prepare" , image = Some "debian:buster" + , dependencies = Some [ "generate-dockerfiles" ] , tags = Some [ "x86_64-linux" ] , script = [ , "mkdir -p dockerfiles" -- GitLab From a88742c06367f83fce669800989320f838cb7e80 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:07:27 -0400 Subject: [PATCH 57/74] iFix ti --- alpine.dhall | 3 +-- image-jobs.dhall | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/alpine.dhall b/alpine.dhall index 1676d13..5600fa0 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -66,8 +66,7 @@ let destDir: Text = "/opt/ghc/${ghcVersion}" in GhcBindist.install - { version = ghcVersion - , triple = "x86_64-alpine3.10-linux-integer-simple" + { bindist = { version = ghcVersion, triple = "x86_64-alpine3.10-linux-integer-simple" } , destDir = destDir , configureOpts = [] : List Text } diff --git a/image-jobs.dhall b/image-jobs.dhall index 9e9b759..c67eeda 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -13,8 +13,8 @@ let images: List Image.Type = ./all-images.dhall let - mkJobEntry: Text -> GitLab.Job.Type -> Prelude.Map.Type Text GitLab.Job.Type = - Prelude.Map.keyValue GitLab.Job.Type + mkJobEntry: Text -> GitLab.Job.Type -> Prelude.Map.Entry Text GitLab.Job.Type = + Prelude.Map.keyValue GitLab.Job.Type let toJob: Image.Type -> Prelude.Map.Entry Text GitLab.Job.Type = @@ -58,7 +58,7 @@ let in GitLab.Job:: { stage = Some "prepare" , image = Some "debian:buster" - , dependencies = Some [ "generate-dockerfiles" ] + , dependencies = [ "generate-dockerfiles" ] , tags = Some [ "x86_64-linux" ] , script = [ , "mkdir -p dockerfiles" @@ -87,6 +87,8 @@ let let top: GitLab.Top.Type = GitLab.Top:: + -- N.B. Jobs sadly can only depend upon jobs in previous stages. Hence the + -- `build-derived` stage, which exists only for the `linter` job. { stages = Some [ "prepare", "lint", "build", "build-derived" ] , jobs = jobs # toMap { generate-dockerfiles = dockerfilesJob -- GitLab From a134f59208680dc33d8ed4c04c8f13537693e5d0 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:09:38 -0400 Subject: [PATCH 58/74] Whoops --- image-jobs.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image-jobs.dhall b/image-jobs.dhall index c67eeda..40dd50b 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -34,6 +34,7 @@ let , DOCKER_TLS_CERTDIR = "/certs" } , needs = image.needs + , dependencies = [ "generate-dockerfiles" ] , services = Some [ "docker:19.03-dind" ] , before_script = Some [ "docker info" ] , script = @@ -58,7 +59,6 @@ let in GitLab.Job:: { stage = Some "prepare" , image = Some "debian:buster" - , dependencies = [ "generate-dockerfiles" ] , tags = Some [ "x86_64-linux" ] , script = [ , "mkdir -p dockerfiles" -- GitLab From 97d59af19689c52b6f329d6b425ffb7ab49e6c75 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:10:43 -0400 Subject: [PATCH 59/74] Try again --- image-jobs.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image-jobs.dhall b/image-jobs.dhall index 40dd50b..edf072e 100644 --- a/image-jobs.dhall +++ b/image-jobs.dhall @@ -33,7 +33,7 @@ let { DOCKER_DRIVER = "overlay2" , DOCKER_TLS_CERTDIR = "/certs" } - , needs = image.needs + , needs = image.needs # [ "generate-dockerfiles" ] , dependencies = [ "generate-dockerfiles" ] , services = Some [ "docker:19.03-dind" ] , before_script = Some [ "docker info" ] -- GitLab From e5dd11cc0e72518701aac8530a4cf035b05864a2 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:15:31 -0400 Subject: [PATCH 60/74] GhcBindist -> components/Ghc --- alpine.dhall | 4 ++-- centos.dhall | 6 +++--- GhcBindist.dhall => components/Ghc.dhall | 4 ++-- containers.dhall | 2 +- debian.dhall | 6 +++--- fedora.dhall | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) rename GhcBindist.dhall => components/Ghc.dhall (94%) diff --git a/alpine.dhall b/alpine.dhall index 5600fa0..5943c7d 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -55,7 +55,7 @@ let installDepsStep: CF.Type = let LlvmBindist = ./LlvmBindist.dhall let - GhcBindist = ./GhcBindist.dhall + Ghc = ./components/Ghc.dhall let ghcVersion: Text = "8.10.2" @@ -65,7 +65,7 @@ let let destDir: Text = "/opt/ghc/${ghcVersion}" in - GhcBindist.install + Ghc.install { bindist = { version = ghcVersion, triple = "x86_64-alpine3.10-linux-integer-simple" } , destDir = destDir , configureOpts = [] : List Text diff --git a/centos.dhall b/centos.dhall index 688c621..48adf27 100644 --- a/centos.dhall +++ b/centos.dhall @@ -5,7 +5,7 @@ let let LlvmBindist = ./LlvmBindist.dhall let - GhcBindist = ./GhcBindist.dhall + Ghc = ./components/Ghc.dhall let HaskellTools = ./HaskellTools.dhall let @@ -98,7 +98,7 @@ let { name : Text , fromImage : Text , runnerTags : List Text - , bootstrapGhc : GhcBindist.BindistSpec + , bootstrapGhc : Ghc.BindistSpec , llvm : Optional TripleVersion } let @@ -118,7 +118,7 @@ let # nsswitchWorkaroundStep -- install GHC - # GhcBindist.install + # Ghc.install { bindist = opts.bootstrapGhc , destDir = ghcDir , configureOpts = [] : List Text diff --git a/GhcBindist.dhall b/components/Ghc.dhall similarity index 94% rename from GhcBindist.dhall rename to components/Ghc.dhall index 75cd5a3..c8997e7 100644 --- a/GhcBindist.dhall +++ b/components/Ghc.dhall @@ -1,7 +1,7 @@ let - Prelude = ./Prelude.dhall + Prelude = ../Prelude.dhall let - CF = ./Containerfile.dhall + CF = ../Containerfile.dhall let BindistSpec: Type = diff --git a/containers.dhall b/containers.dhall index ac81a00..79e8d9f 100644 --- a/containers.dhall +++ b/containers.dhall @@ -15,4 +15,4 @@ let toDockerfileDir: Image.Type -> Map.Entry Text DockerfileDir = \(cf: Image.Type) -> Map.keyValue DockerfileDir cf.name { Dockerfile = CF.render cf.image } -in Prelude.List.map Image.Type (Map.Entry Text DockerfileDir) toDockerfileDir images +in Prelude.List.map Image.Type (Map.Entry Text DockerfileDir) toDockerfileDir images \ No newline at end of file diff --git a/debian.dhall b/debian.dhall index 142aac8..1742cd9 100644 --- a/debian.dhall +++ b/debian.dhall @@ -5,7 +5,7 @@ let let LlvmBindist = ./LlvmBindist.dhall let - GhcBindist = ./GhcBindist.dhall + Ghc = ./components/Ghc.dhall let HaskellTools = ./HaskellTools.dhall let @@ -104,7 +104,7 @@ let , fromImage : Text , runnerTags : List Text , bootstrapLlvm : Optional TripleVersion - , bootstrapGhc : GhcBindist.BindistSpec + , bootstrapGhc : Ghc.BindistSpec , llvm : Optional TripleVersion , cabalSource : Cabal.Type , extraPackages: List Text @@ -135,7 +135,7 @@ let # LlvmBindist.maybeInstallTo bootLlvmDir opts.bootstrapLlvm -- install GHC - # GhcBindist.install + # Ghc.install { bindist = opts.bootstrapGhc , destDir = ghcDir , configureOpts = bootstrapLlvmConfigureOptions diff --git a/fedora.dhall b/fedora.dhall index afef7ee..de2a707 100644 --- a/fedora.dhall +++ b/fedora.dhall @@ -5,7 +5,7 @@ let let LlvmBindist = ./LlvmBindist.dhall let - GhcBindist = ./GhcBindist.dhall + Ghc = ./components/Ghc.dhall let HaskellTools = ./HaskellTools.dhall let @@ -92,7 +92,7 @@ let , fromImage : Text , runnerTags : List Text , bootstrapLlvm : Optional TripleVersion - , bootstrapGhc : GhcBindist.BindistSpec + , bootstrapGhc : Ghc.BindistSpec , llvm : Optional TripleVersion , cabalSource : Cabal.Type , extraPackages: List Text @@ -123,7 +123,7 @@ let # LlvmBindist.maybeInstallTo bootLlvmDir opts.bootstrapLlvm -- install GHC - # GhcBindist.install + # Ghc.install { bindist = opts.bootstrapGhc , destDir = ghcDir , configureOpts = bootstrapLlvmConfigureOptions -- GitLab From 3106a7a4735f287fdebd494801a536be40d6de4a Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:16:48 -0400 Subject: [PATCH 61/74] Cabal -> components/Cabal --- alpine.dhall | 2 +- centos.dhall | 2 +- Cabal.dhall => components/Cabal.dhall | 2 +- debian.dhall | 2 +- fedora.dhall | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename Cabal.dhall => components/Cabal.dhall (97%) diff --git a/alpine.dhall b/alpine.dhall index 5943c7d..02ee497 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -5,7 +5,7 @@ let let HaskellTools = ./HaskellTools.dhall let - Cabal = ./Cabal.dhall + Cabal = ./components/Cabal.dhall let Image = ./Image.dhall diff --git a/centos.dhall b/centos.dhall index 48adf27..34ff57d 100644 --- a/centos.dhall +++ b/centos.dhall @@ -9,7 +9,7 @@ let let HaskellTools = ./HaskellTools.dhall let - Cabal = ./Cabal.dhall + Cabal = ./components/Cabal.dhall let Image = ./Image.dhall diff --git a/Cabal.dhall b/components/Cabal.dhall similarity index 97% rename from Cabal.dhall rename to components/Cabal.dhall index 590fc7f..a08ec6e 100644 --- a/Cabal.dhall +++ b/components/Cabal.dhall @@ -1,5 +1,5 @@ let - CF = ./Containerfile.dhall + CF = ../Containerfile.dhall let setEnv: Text -> CF.Type = diff --git a/debian.dhall b/debian.dhall index 1742cd9..46024bd 100644 --- a/debian.dhall +++ b/debian.dhall @@ -9,7 +9,7 @@ let let HaskellTools = ./HaskellTools.dhall let - Cabal = ./Cabal.dhall + Cabal = ./components/Cabal.dhall let Image = ./Image.dhall let diff --git a/fedora.dhall b/fedora.dhall index de2a707..9d63eec 100644 --- a/fedora.dhall +++ b/fedora.dhall @@ -9,7 +9,7 @@ let let HaskellTools = ./HaskellTools.dhall let - Cabal = ./Cabal.dhall + Cabal = ./components/Cabal.dhall let Image = ./Image.dhall -- GitLab From c7ebb21df76b377cb579a251f30a91399d01916b Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:18:27 -0400 Subject: [PATCH 62/74] HaskellTools -> components/HaskellTools --- alpine.dhall | 2 +- centos.dhall | 2 +- HaskellTools.dhall => components/HaskellTools.dhall | 2 +- debian.dhall | 2 +- fedora.dhall | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename HaskellTools.dhall => components/HaskellTools.dhall (94%) diff --git a/alpine.dhall b/alpine.dhall index 02ee497..ea9308f 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -3,7 +3,7 @@ let let CF = ./Containerfile.dhall let - HaskellTools = ./HaskellTools.dhall + HaskellTools = ./components/HaskellTools.dhall let Cabal = ./components/Cabal.dhall let diff --git a/centos.dhall b/centos.dhall index 34ff57d..7f2c723 100644 --- a/centos.dhall +++ b/centos.dhall @@ -7,7 +7,7 @@ let let Ghc = ./components/Ghc.dhall let - HaskellTools = ./HaskellTools.dhall + HaskellTools = ./components/HaskellTools.dhall let Cabal = ./components/Cabal.dhall let diff --git a/HaskellTools.dhall b/components/HaskellTools.dhall similarity index 94% rename from HaskellTools.dhall rename to components/HaskellTools.dhall index b37cd98..0bb71d5 100644 --- a/HaskellTools.dhall +++ b/components/HaskellTools.dhall @@ -1,5 +1,5 @@ let - CF = ./Containerfile.dhall + CF = ../Containerfile.dhall let build: CF.Type = diff --git a/debian.dhall b/debian.dhall index 46024bd..2a37b8b 100644 --- a/debian.dhall +++ b/debian.dhall @@ -7,7 +7,7 @@ let let Ghc = ./components/Ghc.dhall let - HaskellTools = ./HaskellTools.dhall + HaskellTools = ./components/HaskellTools.dhall let Cabal = ./components/Cabal.dhall let diff --git a/fedora.dhall b/fedora.dhall index 9d63eec..3844627 100644 --- a/fedora.dhall +++ b/fedora.dhall @@ -7,7 +7,7 @@ let let Ghc = ./components/Ghc.dhall let - HaskellTools = ./HaskellTools.dhall + HaskellTools = ./components/HaskellTools.dhall let Cabal = ./components/Cabal.dhall let -- GitLab From 5f656b221d0ca1223e24c111badecd5c296787db Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:21:45 -0400 Subject: [PATCH 63/74] Move dependency stubs into deps/ --- Image.dhall | 2 +- LlvmBindist.dhall | 4 ++-- all-images.dhall | 2 +- alpine.dhall | 4 ++-- centos.dhall | 4 ++-- components/Cabal.dhall | 2 +- components/Ghc.dhall | 4 ++-- components/HaskellTools.dhall | 2 +- containers.dhall | 4 ++-- debian.dhall | 4 ++-- Containerfile.dhall => deps/Containerfile.dhall | 0 GitLabCi.dhall => deps/GitLabCi.dhall | 0 Prelude.dhall => deps/Prelude.dhall | 0 fedora.dhall | 4 ++-- 14 files changed, 18 insertions(+), 18 deletions(-) rename Containerfile.dhall => deps/Containerfile.dhall (100%) rename GitLabCi.dhall => deps/GitLabCi.dhall (100%) rename Prelude.dhall => deps/Prelude.dhall (100%) diff --git a/Image.dhall b/Image.dhall index 26eb6c4..1978950 100644 --- a/Image.dhall +++ b/Image.dhall @@ -1,5 +1,5 @@ let - CF = ./Containerfile.dhall + CF = ./deps/Containerfile.dhall let ImageName = Text diff --git a/LlvmBindist.dhall b/LlvmBindist.dhall index 34c03ed..6c55e79 100644 --- a/LlvmBindist.dhall +++ b/LlvmBindist.dhall @@ -1,7 +1,7 @@ let - Prelude = ./Prelude.dhall + Prelude = ./deps/Prelude.dhall let - CF = ./Containerfile.dhall + CF = ./deps/Containerfile.dhall let Options = diff --git a/all-images.dhall b/all-images.dhall index 589da60..7287b11 100644 --- a/all-images.dhall +++ b/all-images.dhall @@ -1,5 +1,5 @@ let - Prelude = ./Prelude.dhall + Prelude = ./deps/Prelude.dhall let Image = ./Image.dhall diff --git a/alpine.dhall b/alpine.dhall index ea9308f..20c8f17 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -1,7 +1,7 @@ let - Prelude = ./Prelude.dhall + Prelude = ./deps/Prelude.dhall let - CF = ./Containerfile.dhall + CF = ./deps/Containerfile.dhall let HaskellTools = ./components/HaskellTools.dhall let diff --git a/centos.dhall b/centos.dhall index 7f2c723..46f288b 100644 --- a/centos.dhall +++ b/centos.dhall @@ -1,7 +1,7 @@ let - Prelude = ./Prelude.dhall + Prelude = ./deps/Prelude.dhall let - CF = ./Containerfile.dhall + CF = ./deps/Containerfile.dhall let LlvmBindist = ./LlvmBindist.dhall let diff --git a/components/Cabal.dhall b/components/Cabal.dhall index a08ec6e..59a0ff0 100644 --- a/components/Cabal.dhall +++ b/components/Cabal.dhall @@ -1,5 +1,5 @@ let - CF = ../Containerfile.dhall + CF = ../deps/Containerfile.dhall let setEnv: Text -> CF.Type = diff --git a/components/Ghc.dhall b/components/Ghc.dhall index c8997e7..22a3059 100644 --- a/components/Ghc.dhall +++ b/components/Ghc.dhall @@ -1,7 +1,7 @@ let - Prelude = ../Prelude.dhall + Prelude = ../deps/Prelude.dhall let - CF = ../Containerfile.dhall + CF = ../deps/Containerfile.dhall let BindistSpec: Type = diff --git a/components/HaskellTools.dhall b/components/HaskellTools.dhall index 0bb71d5..39a899d 100644 --- a/components/HaskellTools.dhall +++ b/components/HaskellTools.dhall @@ -1,5 +1,5 @@ let - CF = ../Containerfile.dhall + CF = ../deps/Containerfile.dhall let build: CF.Type = diff --git a/containers.dhall b/containers.dhall index 79e8d9f..3dd7b8a 100644 --- a/containers.dhall +++ b/containers.dhall @@ -1,9 +1,9 @@ let - Prelude = ./Prelude.dhall + Prelude = ./deps/Prelude.dhall let Map = Prelude.Map let - CF = ./Containerfile.dhall + CF = ./deps/Containerfile.dhall let Image = ./Image.dhall diff --git a/debian.dhall b/debian.dhall index 2a37b8b..15b771a 100644 --- a/debian.dhall +++ b/debian.dhall @@ -1,7 +1,7 @@ let - Prelude = ./Prelude.dhall + Prelude = ./deps/Prelude.dhall let - CF = ./Containerfile.dhall + CF = ./deps/Containerfile.dhall let LlvmBindist = ./LlvmBindist.dhall let diff --git a/Containerfile.dhall b/deps/Containerfile.dhall similarity index 100% rename from Containerfile.dhall rename to deps/Containerfile.dhall diff --git a/GitLabCi.dhall b/deps/GitLabCi.dhall similarity index 100% rename from GitLabCi.dhall rename to deps/GitLabCi.dhall diff --git a/Prelude.dhall b/deps/Prelude.dhall similarity index 100% rename from Prelude.dhall rename to deps/Prelude.dhall diff --git a/fedora.dhall b/fedora.dhall index 3844627..37bf133 100644 --- a/fedora.dhall +++ b/fedora.dhall @@ -1,7 +1,7 @@ let - Prelude = ./Prelude.dhall + Prelude = ./deps/Prelude.dhall let - CF = ./Containerfile.dhall + CF = ./deps/Containerfile.dhall let LlvmBindist = ./LlvmBindist.dhall let -- GitLab From eb7a02fabc884ad2de4dd96a335cd6856a06f3cb Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:25:01 -0400 Subject: [PATCH 64/74] LlvmBindist -> components/Llvm --- alpine.dhall | 8 +++----- centos.dhall | 5 ++--- LlvmBindist.dhall => components/Llvm.dhall | 4 ++-- debian.dhall | 8 ++++---- fedora.dhall | 8 ++++---- 5 files changed, 15 insertions(+), 18 deletions(-) rename LlvmBindist.dhall => components/Llvm.dhall (94%) diff --git a/alpine.dhall b/alpine.dhall index 20c8f17..a3da0d1 100644 --- a/alpine.dhall +++ b/alpine.dhall @@ -6,6 +6,9 @@ let HaskellTools = ./components/HaskellTools.dhall let Cabal = ./components/Cabal.dhall +let + Ghc = ./components/Ghc.dhall + let Image = ./Image.dhall @@ -52,11 +55,6 @@ let installDepsStep: CF.Type = CF.run "Installing GHC build dependencies" [ "apk add --no-cache ${Prelude.Text.concatSep " " buildDepends}" ] -let - LlvmBindist = ./LlvmBindist.dhall -let - Ghc = ./components/Ghc.dhall - let ghcVersion: Text = "8.10.2" diff --git a/centos.dhall b/centos.dhall index 46f288b..9224a93 100644 --- a/centos.dhall +++ b/centos.dhall @@ -3,7 +3,7 @@ let let CF = ./deps/Containerfile.dhall let - LlvmBindist = ./LlvmBindist.dhall + Llvm = ./components/Llvm.dhall let Ghc = ./components/Ghc.dhall let @@ -126,7 +126,7 @@ let # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) -- install LLVM to be used by built compiler - # LlvmBindist.maybeInstallTo llvmDir opts.llvm + # Llvm.maybeInstallTo llvmDir opts.llvm -- install cabal-install # Cabal.install (Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" }) @@ -145,7 +145,6 @@ let } in { Type = type - , TripleVersion = TripleVersion , toDocker = toDocker } diff --git a/LlvmBindist.dhall b/components/Llvm.dhall similarity index 94% rename from LlvmBindist.dhall rename to components/Llvm.dhall index 6c55e79..28be5f0 100644 --- a/LlvmBindist.dhall +++ b/components/Llvm.dhall @@ -1,7 +1,7 @@ let - Prelude = ./deps/Prelude.dhall + Prelude = ../deps/Prelude.dhall let - CF = ./deps/Containerfile.dhall + CF = ../deps/Containerfile.dhall let Options = diff --git a/debian.dhall b/debian.dhall index 15b771a..86a755b 100644 --- a/debian.dhall +++ b/debian.dhall @@ -3,7 +3,7 @@ let let CF = ./deps/Containerfile.dhall let - LlvmBindist = ./LlvmBindist.dhall + Llvm = ./components/Llvm.dhall let Ghc = ./components/Ghc.dhall let @@ -132,7 +132,7 @@ let # installPackages (buildDepends # opts.extraPackages) -- install LLVM for bootstrap GHC - # LlvmBindist.maybeInstallTo bootLlvmDir opts.bootstrapLlvm + # Llvm.maybeInstallTo bootLlvmDir opts.bootstrapLlvm -- install GHC # Ghc.install @@ -143,8 +143,8 @@ let # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) -- install LLVM to be used by built compiler - # LlvmBindist.maybeInstallTo llvmDir opts.llvm - # LlvmBindist.setEnv llvmDir + # Llvm.maybeInstallTo llvmDir opts.llvm + # Llvm.setEnv llvmDir -- install cabal-install # Cabal.install opts.cabalSource diff --git a/fedora.dhall b/fedora.dhall index 37bf133..ff1e561 100644 --- a/fedora.dhall +++ b/fedora.dhall @@ -3,7 +3,7 @@ let let CF = ./deps/Containerfile.dhall let - LlvmBindist = ./LlvmBindist.dhall + Llvm = ./components/Llvm.dhall let Ghc = ./components/Ghc.dhall let @@ -120,7 +120,7 @@ let # installPackages (buildDepends # opts.extraPackages) -- install LLVM for bootstrap GHC - # LlvmBindist.maybeInstallTo bootLlvmDir opts.bootstrapLlvm + # Llvm.maybeInstallTo bootLlvmDir opts.bootstrapLlvm -- install GHC # Ghc.install @@ -131,8 +131,8 @@ let # CF.env (toMap { GHC = "${ghcDir}/bin/ghc" }) -- install LLVM to be used by built compiler - # LlvmBindist.maybeInstallTo llvmDir opts.llvm - # LlvmBindist.setEnv llvmDir + # Llvm.maybeInstallTo llvmDir opts.llvm + # Llvm.setEnv llvmDir -- install cabal-install # Cabal.install opts.cabalSource -- GitLab From 0972d36a25dd8a409d823b829e1e1ce19e6a76a9 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:34:07 -0400 Subject: [PATCH 65/74] More refactoring --- .gitlab-ci.yml | 6 +- containers.dhall | 18 ----- image-jobs.dhall | 100 ---------------------------- all-images.dhall => images.dhall | 8 +-- alpine.dhall => images/alpine.dhall | 15 +++-- centos.dhall => images/centos.dhall | 15 +++-- debian.dhall => images/debian.dhall | 17 +++-- fedora.dhall => images/fedora.dhall | 16 +++-- 8 files changed, 42 insertions(+), 153 deletions(-) delete mode 100644 containers.dhall delete mode 100644 image-jobs.dhall rename all-images.dhall => images.dhall (58%) rename alpine.dhall => images/alpine.dhall (88%) rename centos.dhall => images/centos.dhall (92%) rename debian.dhall => images/debian.dhall (96%) rename fedora.dhall => images/fedora.dhall (93%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f47ab63..58c80ca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,10 +14,10 @@ generate: - apt-get update - apt-get install -y curl tar bzip2 - curl -L $DHALL_URL | tar -jx - - ./bin/dhall text --file=image-jobs.dhall > image-jobs.yaml + - ./bin/dhall text --file=gitlab-pipeline.dhall > gitlab-pipeline.yaml artifacts: paths: - - image-jobs.yaml + - gitlab-pipeline.yaml # Spawn a child pipeline to lint and build the Dockerfiles build-images: @@ -26,6 +26,6 @@ build-images: - generate trigger: include: - - artifact: image-jobs.yaml + - artifact: gitlab-pipeline.yaml job: generate strategy: depend \ No newline at end of file diff --git a/containers.dhall b/containers.dhall deleted file mode 100644 index 3dd7b8a..0000000 --- a/containers.dhall +++ /dev/null @@ -1,18 +0,0 @@ -let - Prelude = ./deps/Prelude.dhall -let - Map = Prelude.Map -let - CF = ./deps/Containerfile.dhall -let - Image = ./Image.dhall - -let - images: List Image.Type = ./all-images.dhall -let - DockerfileDir: Type = { Dockerfile : Text } -let - toDockerfileDir: Image.Type -> Map.Entry Text DockerfileDir = - \(cf: Image.Type) -> Map.keyValue DockerfileDir cf.name { Dockerfile = CF.render cf.image } - -in Prelude.List.map Image.Type (Map.Entry Text DockerfileDir) toDockerfileDir images \ No newline at end of file diff --git a/image-jobs.dhall b/image-jobs.dhall deleted file mode 100644 index edf072e..0000000 --- a/image-jobs.dhall +++ /dev/null @@ -1,100 +0,0 @@ -let - Prelude = ./Prelude.dhall -let - Map = Prelude.Map -let - CF = ./Containerfile.dhall -let - Image = ./Image.dhall -let - GitLab = ./GitLabCi.dhall - -let - images: List Image.Type = ./all-images.dhall - -let - mkJobEntry: Text -> GitLab.Job.Type -> Prelude.Map.Entry Text GitLab.Job.Type = - Prelude.Map.keyValue GitLab.Job.Type - -let - toJob: Image.Type -> Prelude.Map.Entry Text GitLab.Job.Type = - \(image: Image.Type) -> - let - docker_base_url: Text = "registry.gitlab.haskell.org/$CI_PROJECT_PATH" - let - imageName: Text = "${docker_base_url}/${image.name}" - - let job: GitLab.Job.Type = - GitLab.Job:: - { image = Some "docker:19.03" - , stage = Some image.jobStage - , tags = Some (image.runnerTags # [ "docker" ]) - , variables = toMap - { DOCKER_DRIVER = "overlay2" - , DOCKER_TLS_CERTDIR = "/certs" - } - , needs = image.needs # [ "generate-dockerfiles" ] - , dependencies = [ "generate-dockerfiles" ] - , services = Some [ "docker:19.03-dind" ] - , before_script = Some [ "docker info" ] - , script = - [ "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY" - , "docker pull ${imageName}:latest || true" - , "docker build --cache-from ${imageName}:latest --tag ${imageName}:$CI_COMMIT_SHA --tag ${imageName}:latest dockerfiles/${image.name}" - , '' - if [ -z "$CI_MERGE_REQUEST_ID" ]; then - docker push ${imageName}:$CI_COMMIT_SHA - docker push ${imageName}:latest - fi - '' - ] - } - - in mkJobEntry image.name job - -let - dockerfilesJob = - let - dhallUrl = "https://github.com/dhall-lang/dhall-haskell/releases/download/1.34.0/dhall-1.34.0-x86_64-linux.tar.bz2" - in GitLab.Job:: - { stage = Some "prepare" - , image = Some "debian:buster" - , tags = Some [ "x86_64-linux" ] - , script = [ - , "mkdir -p dockerfiles" - , "apt-get update" - , "apt-get install -y curl tar bzip2" - , "curl -L ${dhallUrl} | tar -jx" - , "./bin/dhall to-directory-tree --file=containers.dhall --output=dockerfiles" - ] - , artifacts = - Some (GitLab.ArtifactsSpec:: { paths = [ "dockerfiles" ] }) - } - -let - lintJob = - GitLab.Job:: - { stage = Some "lint" - , image = Some "hadolint/hadolint:latest-debian" - , tags = Some [ "x86_64-linux" ] - , script = - [ "find dockerfiles -name Dockerfile -print0 | xargs -0 -n1 hadolint" ] - } - -let - jobs: Prelude.Map.Type Text GitLab.Job.Type = - Prelude.List.map Image.Type (Prelude.Map.Entry Text GitLab.Job.Type) toJob images - -let top: GitLab.Top.Type = - GitLab.Top:: - -- N.B. Jobs sadly can only depend upon jobs in previous stages. Hence the - -- `build-derived` stage, which exists only for the `linter` job. - { stages = Some [ "prepare", "lint", "build", "build-derived" ] - , jobs = jobs # toMap - { generate-dockerfiles = dockerfilesJob - -- , lint = lintJob - } - } - -in -Prelude.JSON.renderYAML (GitLab.Top.toJSON top) \ No newline at end of file diff --git a/all-images.dhall b/images.dhall similarity index 58% rename from all-images.dhall rename to images.dhall index 7287b11..1334b71 100644 --- a/all-images.dhall +++ b/images.dhall @@ -6,9 +6,9 @@ let let all-images: List Image.Type = Prelude.List.concat Image.Type - [ ./alpine.dhall - , ./debian.dhall - , ./centos.dhall - , ./fedora.dhall + [ ./images/alpine.dhall + , ./images/debian.dhall + , ./images/centos.dhall + , ./images/fedora.dhall ] in all-images diff --git a/alpine.dhall b/images/alpine.dhall similarity index 88% rename from alpine.dhall rename to images/alpine.dhall index a3da0d1..28f2911 100644 --- a/alpine.dhall +++ b/images/alpine.dhall @@ -1,16 +1,17 @@ +-- Alpine Linux Docker images + let - Prelude = ./deps/Prelude.dhall + Prelude = ../deps/Prelude.dhall let - CF = ./deps/Containerfile.dhall + CF = ../deps/Containerfile.dhall let - HaskellTools = ./components/HaskellTools.dhall + HaskellTools = ../components/HaskellTools.dhall let - Cabal = ./components/Cabal.dhall + Cabal = ../components/Cabal.dhall let - Ghc = ./components/Ghc.dhall - + Ghc = ../components/Ghc.dhall let - Image = ./Image.dhall + Image = ../Image.dhall let coreBuildDepends: List Text = diff --git a/centos.dhall b/images/centos.dhall similarity index 92% rename from centos.dhall rename to images/centos.dhall index 9224a93..3648bb2 100644 --- a/centos.dhall +++ b/images/centos.dhall @@ -1,17 +1,18 @@ +-- Centos Docker images let - Prelude = ./deps/Prelude.dhall + Prelude = ../deps/Prelude.dhall let - CF = ./deps/Containerfile.dhall + CF = ../deps/Containerfile.dhall let - Llvm = ./components/Llvm.dhall + Llvm = ../components/Llvm.dhall let - Ghc = ./components/Ghc.dhall + Ghc = ../components/Ghc.dhall let - HaskellTools = ./components/HaskellTools.dhall + HaskellTools = ../components/HaskellTools.dhall let - Cabal = ./components/Cabal.dhall + Cabal = ../components/Cabal.dhall let - Image = ./Image.dhall + Image = ../Image.dhall let TripleVersion: Type = diff --git a/debian.dhall b/images/debian.dhall similarity index 96% rename from debian.dhall rename to images/debian.dhall index 86a755b..531f6f8 100644 --- a/debian.dhall +++ b/images/debian.dhall @@ -1,17 +1,20 @@ +-- Debian/Ubuntu Linux Docker images + let - Prelude = ./deps/Prelude.dhall + Prelude = ../deps/Prelude.dhall let - CF = ./deps/Containerfile.dhall + CF = ../deps/Containerfile.dhall let - Llvm = ./components/Llvm.dhall + Llvm = ../components/Llvm.dhall let - Ghc = ./components/Ghc.dhall + Ghc = ../components/Ghc.dhall let - HaskellTools = ./components/HaskellTools.dhall + HaskellTools = ../components/HaskellTools.dhall let - Cabal = ./components/Cabal.dhall + Cabal = ../components/Cabal.dhall let - Image = ./Image.dhall + Image = ../Image.dhall + let docker_base_url: Text = "registry.gitlab.haskell.org/$CI_PROJECT_PATH" diff --git a/fedora.dhall b/images/fedora.dhall similarity index 93% rename from fedora.dhall rename to images/fedora.dhall index ff1e561..fccabe5 100644 --- a/fedora.dhall +++ b/images/fedora.dhall @@ -1,17 +1,19 @@ +-- Fedora Linux Docker images + let - Prelude = ./deps/Prelude.dhall + Prelude = ../deps/Prelude.dhall let - CF = ./deps/Containerfile.dhall + CF = ../deps/Containerfile.dhall let - Llvm = ./components/Llvm.dhall + Llvm = ../components/Llvm.dhall let - Ghc = ./components/Ghc.dhall + Ghc = ../components/Ghc.dhall let - HaskellTools = ./components/HaskellTools.dhall + HaskellTools = ../components/HaskellTools.dhall let - Cabal = ./components/Cabal.dhall + Cabal = ../components/Cabal.dhall let - Image = ./Image.dhall + Image = ../Image.dhall let TripleVersion: Type = -- GitLab From 60d670446a1cc3e122f147f1b036f83962899e04 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:39:04 -0400 Subject: [PATCH 66/74] More --- dockerfiles.dhall | 18 ++++++++ gitlab-pipeline.dhall | 102 ++++++++++++++++++++++++++++++++++++++++++ images/debian.dhall | 27 +++++------ 3 files changed, 134 insertions(+), 13 deletions(-) create mode 100644 dockerfiles.dhall create mode 100644 gitlab-pipeline.dhall diff --git a/dockerfiles.dhall b/dockerfiles.dhall new file mode 100644 index 0000000..1421d90 --- /dev/null +++ b/dockerfiles.dhall @@ -0,0 +1,18 @@ +let + Prelude = ./deps/Prelude.dhall +let + Map = Prelude.Map +let + CF = ./deps/Containerfile.dhall +let + Image = ./Image.dhall + +let + images: List Image.Type = ./images.dhall +let + DockerfileDir: Type = { Dockerfile : Text } +let + toDockerfileDir: Image.Type -> Map.Entry Text DockerfileDir = + \(cf: Image.Type) -> Map.keyValue DockerfileDir cf.name { Dockerfile = CF.render cf.image } + +in Prelude.List.map Image.Type (Map.Entry Text DockerfileDir) toDockerfileDir images \ No newline at end of file diff --git a/gitlab-pipeline.dhall b/gitlab-pipeline.dhall new file mode 100644 index 0000000..c64253e --- /dev/null +++ b/gitlab-pipeline.dhall @@ -0,0 +1,102 @@ +-- Defines the child GitLab CI pipeline which builds our Docker images. + +let + Prelude = ./deps/Prelude.dhall +let + Map = Prelude.Map +let + CF = ./deps/Containerfile.dhall +let + Image = ./Image.dhall +let + GitLab = ./deps/GitLabCi.dhall + +let + images: List Image.Type = ./images.dhall + +let + mkJobEntry: Text -> GitLab.Job.Type -> Prelude.Map.Entry Text GitLab.Job.Type = + Prelude.Map.keyValue GitLab.Job.Type + +let + toJob: Image.Type -> Prelude.Map.Entry Text GitLab.Job.Type = + \(image: Image.Type) -> + let + docker_base_url: Text = "registry.gitlab.haskell.org/$CI_PROJECT_PATH" + let + imageName: Text = "${docker_base_url}/${image.name}" + + let job: GitLab.Job.Type = + GitLab.Job:: + { image = Some "docker:19.03" + , stage = Some image.jobStage + , tags = Some (image.runnerTags # [ "docker" ]) + , variables = toMap + { DOCKER_DRIVER = "overlay2" + , DOCKER_TLS_CERTDIR = "/certs" + } + , needs = image.needs # [ "generate-dockerfiles" ] + , dependencies = [ "generate-dockerfiles" ] + , services = Some [ "docker:19.03-dind" ] + , before_script = Some [ "docker info" ] + , script = + [ "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY" + , "docker pull ${imageName}:latest || true" + , "docker build --cache-from ${imageName}:latest --tag ${imageName}:$CI_COMMIT_SHA --tag ${imageName}:latest dockerfiles/${image.name}" + , '' + if [ -z "$CI_MERGE_REQUEST_ID" ]; then + docker push ${imageName}:$CI_COMMIT_SHA + docker push ${imageName}:latest + fi + '' + ] + } + + in mkJobEntry image.name job + +let + dockerfilesJob = + let + dhallUrl = "https://github.com/dhall-lang/dhall-haskell/releases/download/1.34.0/dhall-1.34.0-x86_64-linux.tar.bz2" + in GitLab.Job:: + { stage = Some "prepare" + , image = Some "debian:buster" + , tags = Some [ "x86_64-linux" ] + , script = [ + , "mkdir -p dockerfiles" + , "apt-get update" + , "apt-get install -y curl tar bzip2" + , "curl -L ${dhallUrl} | tar -jx" + , "./bin/dhall to-directory-tree --file=dockerfiles.dhall --output=dockerfiles" + ] + , artifacts = + Some (GitLab.ArtifactsSpec:: { paths = [ "dockerfiles" ] }) + } + +let + lintJob = + GitLab.Job:: + { stage = Some "lint" + , image = Some "hadolint/hadolint:latest-debian" + , tags = Some [ "x86_64-linux" ] + , script = + [ "find dockerfiles -name Dockerfile -print0 | xargs -0 -n1 hadolint" ] + } + +let + jobs: Prelude.Map.Type Text GitLab.Job.Type = + Prelude.List.map Image.Type (Prelude.Map.Entry Text GitLab.Job.Type) toJob images + +let top: GitLab.Top.Type = + GitLab.Top:: + -- N.B. Jobs sadly can only depend upon jobs in previous stages. Hence the + -- `build-derived` stage, which exists only for the `linter` job. + { stages = Some [ "prepare", "lint", "build", "build-derived" ] + , jobs = jobs # toMap + { generate-dockerfiles = dockerfilesJob + -- , lint = lintJob + } + } + +in +Prelude.JSON.renderYAML (GitLab.Top.toJSON top) \ No newline at end of file diff --git a/images/debian.dhall b/images/debian.dhall index 531f6f8..0cf49af 100644 --- a/images/debian.dhall +++ b/images/debian.dhall @@ -170,7 +170,7 @@ let images: List Image.Type = , fromImage = "arm64v8/debian:buster" , runnerTags = [ "aarch64-linux" ] , bootstrapLlvm = Some { version = "7.1.0" , triple = "aarch64-linux-gnu" } - , bootstrapGhc = { version = "8.8.3", triple = "aarch64-deb9-linux" } + , bootstrapGhc = { version = "8.10.2", triple = "aarch64-deb10-linux" } , llvm = Some { version = "10.0.1" , triple = "aarch64-linux-gnu" } , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" , extraPackages = [] : List Text @@ -181,7 +181,7 @@ let images: List Image.Type = , fromImage = "arm32v7/debian:buster" , runnerTags = [ "armv7-linux" ] , bootstrapLlvm = Some { version = "7.1.0", triple = "armv7a-linux-gnueabihf" } - , bootstrapGhc = { version = "8.10.2", triple = "armv7-deb9-linux" } + , bootstrapGhc = { version = "8.10.2", triple = "armv7-deb10-linux" } , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" , extraPackages = debianBuildDepends @@ -198,16 +198,17 @@ let images: List Image.Type = , extraPackages = debianBuildDepends # [ "cabal-install" ] : List Text } -, DebianImage.toDocker - { name = "i386-linux-deb10" - , fromImage = "i386/debian:buster" - , runnerTags = [ "x86_64-linux" ] - , bootstrapLlvm = None TripleVersion - , bootstrapGhc = { version = "8.8.3", triple = "i386-deb10-linux" } - , llvm = None TripleVersion - , cabalSource = Cabal.Type.FromSource "3.2.0.0" - , extraPackages = debianBuildDepends # [ "cabal-install" ] : List Text - } +-- N.B. Need bindist for deb10 i386 +--, DebianImage.toDocker +-- { name = "i386-linux-deb10" +-- , fromImage = "i386/debian:buster" +-- , runnerTags = [ "x86_64-linux" ] +-- , bootstrapLlvm = None TripleVersion +-- , bootstrapGhc = { version = "8.8.3", triple = "i386-deb10-linux" } +-- , llvm = None TripleVersion +-- , cabalSource = Cabal.Type.FromSource "3.2.0.0" +-- , extraPackages = debianBuildDepends # [ "cabal-install" ] : List Text +-- } , DebianImage.toDocker { name = "x86_64-linux-deb10" @@ -240,7 +241,7 @@ let images: List Image.Type = , runnerTags = [ "x86_64-linux" ] , bootstrapLlvm = None TripleVersion , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb8-linux" } - , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } + , llvm = None VersionTriple , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = debianBuildDepends : List Text } -- GitLab From 737265a0eef13a1b1da803ad015cb780632901bc Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:45:02 -0400 Subject: [PATCH 67/74] A bit of documentation --- Image.dhall | 3 +++ README.mkd | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/Image.dhall b/Image.dhall index 1978950..d692d4a 100644 --- a/Image.dhall +++ b/Image.dhall @@ -1,7 +1,10 @@ +--| A description of a Docker image + let CF = ./deps/Containerfile.dhall let + --| The name a of a Docker image ImageName = Text let diff --git a/README.mkd b/README.mkd index 8602ecd..e212792 100644 --- a/README.mkd +++ b/README.mkd @@ -8,3 +8,11 @@ Registry. See the [GHC Wiki](https://gitlab.haskell.org/ghc/ghc/wikis/continuous-integration-configuration) for details. + +Building images +--------------- + +The Dockerfiles are defined via [Dhall](https://dhall-lang.org/) expressions. +In particular, each major class of Linux distributions has its definitions defined in +a file in the `images/` directory. Logic for managing various shared toolchain +components (e.g. GHC, `cabal-install`, and LLVM) is contained in `components/`. -- GitLab From 51612347d0979f90caa79d050d76aefac2909729 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:51:27 -0400 Subject: [PATCH 68/74] More clean-up --- components/Llvm.dhall | 18 ++++++++++++------ images/centos.dhall | 8 ++------ images/debian.dhall | 28 ++++++++++++---------------- images/fedora.dhall | 12 ++++-------- 4 files changed, 30 insertions(+), 36 deletions(-) diff --git a/components/Llvm.dhall b/components/Llvm.dhall index 28be5f0..badc23b 100644 --- a/components/Llvm.dhall +++ b/components/Llvm.dhall @@ -4,10 +4,15 @@ let CF = ../deps/Containerfile.dhall let - Options = - { Type = + BindistSpec: Type = { version : Text , triple : Text + } + +let + Options = + { Type = + { bindist : BindistSpec , destDir : Text } , default = {} @@ -17,7 +22,7 @@ let install: Options.Type -> CF.Type = \(opts: Options.Type) -> let - url: Text = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${opts.version}/clang+llvm-${opts.version}-${opts.triple}.tar.xz" + url: Text = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${opts.bindist.version}/clang+llvm-${opts.bindist.version}-${opts.bindist.triple}.tar.xz" in CF.run "install LLVM for bootstrap GHC" @@ -29,10 +34,10 @@ let ] let - maybeInstallTo: Text -> Optional { triple: Text, version: Text } -> CF.Type = - \(destDir: Text) -> \(opts: Optional {triple: Text, version: Text}) -> + maybeInstallTo: Text -> Optional BindistSpec -> CF.Type = + \(destDir: Text) -> \(opts: Optional BindistSpec) -> merge - { Some = \(tv: {triple: Text, version: Text}) -> install (tv /\ { destDir = destDir }) + { Some = \(tv: BindistSpec) -> install { bindist = tv, destDir = destDir } , None = [] : CF.Type } opts @@ -46,6 +51,7 @@ let in { Options = Options +, BindistSpec = BindistSpec , install = install , maybeInstallTo = maybeInstallTo , setEnv = setEnv diff --git a/images/centos.dhall b/images/centos.dhall index 3648bb2..cc32279 100644 --- a/images/centos.dhall +++ b/images/centos.dhall @@ -14,10 +14,6 @@ let let Image = ../Image.dhall -let - TripleVersion: Type = - { triple : Text, version: Text } - let coreBuildDepends: List Text = [ "coreutils" @@ -100,7 +96,7 @@ let , fromImage : Text , runnerTags : List Text , bootstrapGhc : Ghc.BindistSpec - , llvm : Optional TripleVersion + , llvm : Optional Llvm.BindistSpec } let toDocker: type -> Image.Type = \(opts : type) -> @@ -155,7 +151,7 @@ let images: List Image.Type = , fromImage = "centos:7" , runnerTags = [ "x86_64-linux" ] , bootstrapGhc = { version = "8.8.3", triple = "x86_64-centos7-linux" } - , llvm = None TripleVersion + , llvm = None Llvm.BindistSpec } ] in images \ No newline at end of file diff --git a/images/debian.dhall b/images/debian.dhall index 0cf49af..13a1958 100644 --- a/images/debian.dhall +++ b/images/debian.dhall @@ -18,10 +18,6 @@ let let docker_base_url: Text = "registry.gitlab.haskell.org/$CI_PROJECT_PATH" -let - TripleVersion: Type = - { triple : Text, version: Text } - let coreBuildDepends: List Text = [ "zlib1g-dev" @@ -106,9 +102,9 @@ let { name: Text , fromImage : Text , runnerTags : List Text - , bootstrapLlvm : Optional TripleVersion + , bootstrapLlvm : Optional Llvm.BindistSpec , bootstrapGhc : Ghc.BindistSpec - , llvm : Optional TripleVersion + , llvm : Optional Llvm.BindistSpec , cabalSource : Cabal.Type , extraPackages: List Text } @@ -123,7 +119,7 @@ let llvmDir: Text = "/opt/llvm" let bootstrapLlvmConfigureOptions = - merge { Some = \(_: TripleVersion) -> [ "LLC=${bootLlvmDir}/bin/llc", "OPT=${bootLlvmDir}/bin/opt" ] + merge { Some = \(_: Llvm.BindistSpec) -> [ "LLC=${bootLlvmDir}/bin/llc", "OPT=${bootLlvmDir}/bin/opt" ] , None = [] : List Text } opts.bootstrapLlvm @@ -191,9 +187,9 @@ let images: List Image.Type = { name = "i386-linux-deb9" , fromImage = "i386/debian:stretch" , runnerTags = [ "x86_64-linux" ] - , bootstrapLlvm = None TripleVersion + , bootstrapLlvm = None Llvm.BindistSpec , bootstrapGhc = { version = "8.8.3", triple = "i386-deb9-linux" } - , llvm = None TripleVersion + , llvm = None Llvm.BindistSpec , cabalSource = Cabal.Type.FromBindist "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz" , extraPackages = debianBuildDepends # [ "cabal-install" ] : List Text } @@ -203,9 +199,9 @@ let images: List Image.Type = -- { name = "i386-linux-deb10" -- , fromImage = "i386/debian:buster" -- , runnerTags = [ "x86_64-linux" ] --- , bootstrapLlvm = None TripleVersion +-- , bootstrapLlvm = None Llvm.BindistSpec -- , bootstrapGhc = { version = "8.8.3", triple = "i386-deb10-linux" } --- , llvm = None TripleVersion +-- , llvm = None Llvm.BindistSpec -- , cabalSource = Cabal.Type.FromSource "3.2.0.0" -- , extraPackages = debianBuildDepends # [ "cabal-install" ] : List Text -- } @@ -214,7 +210,7 @@ let images: List Image.Type = { name = "x86_64-linux-deb10" , fromImage = "amd64/debian:buster" , runnerTags = [ "x86_64-linux" ] - , bootstrapLlvm = None TripleVersion + , bootstrapLlvm = None Llvm.BindistSpec , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb10-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } @@ -228,7 +224,7 @@ let images: List Image.Type = { name = "x86_64-linux-deb9" , fromImage = "amd64/debian:stretch" , runnerTags = [ "x86_64-linux" ] - , bootstrapLlvm = None TripleVersion + , bootstrapLlvm = None Llvm.BindistSpec , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } @@ -239,9 +235,9 @@ let images: List Image.Type = { name = "x86_64-linux-deb8" , fromImage = "amd64/debian:jessie" , runnerTags = [ "x86_64-linux" ] - , bootstrapLlvm = None TripleVersion + , bootstrapLlvm = None Llvm.BindistSpec , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb8-linux" } - , llvm = None VersionTriple + , llvm = None Llvm.BindistSpec , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = debianBuildDepends : List Text } @@ -250,7 +246,7 @@ let images: List Image.Type = { name = "x86_64-linux-ubuntu20_04" , fromImage = "amd64/ubuntu:20.04" , runnerTags = [ "x86_64-linux" ] - , bootstrapLlvm = None TripleVersion + , bootstrapLlvm = None Llvm.BindistSpec , bootstrapGhc = { version = "8.8.3", triple = "x86_64-deb9-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } diff --git a/images/fedora.dhall b/images/fedora.dhall index fccabe5..fc37e5f 100644 --- a/images/fedora.dhall +++ b/images/fedora.dhall @@ -15,10 +15,6 @@ let let Image = ../Image.dhall -let - TripleVersion: Type = - { triple : Text, version: Text } - let coreBuildDepends: List Text = [ "coreutils" @@ -93,9 +89,9 @@ let { name: Text , fromImage : Text , runnerTags : List Text - , bootstrapLlvm : Optional TripleVersion + , bootstrapLlvm : Optional Llvm.BindistSpec , bootstrapGhc : Ghc.BindistSpec - , llvm : Optional TripleVersion + , llvm : Optional Llvm.BindistSpec , cabalSource : Cabal.Type , extraPackages: List Text } @@ -110,7 +106,7 @@ let llvmDir: Text = "/opt/llvm" let bootstrapLlvmConfigureOptions = - merge { Some = \(_: TripleVersion) -> [ "LLC=${bootLlvmDir}/bin/llc", "OPT=${bootLlvmDir}/bin/opt" ] + merge { Some = \(_: Llvm.BindistSpec) -> [ "LLC=${bootLlvmDir}/bin/llc", "OPT=${bootLlvmDir}/bin/opt" ] , None = [] : List Text } opts.bootstrapLlvm @@ -156,7 +152,7 @@ let images: List Image.Type = { name = "x86_64-linux-fedora27" , fromImage = "amd64/fedora:27" , runnerTags = [ "x86_64-linux" ] - , bootstrapLlvm = None TripleVersion + , bootstrapLlvm = None Llvm.BindistSpec , bootstrapGhc = { version = "8.8.3", triple = "x86_64-fedora27-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } -- GitLab From d614ce2bfa4b2671aa463eeee8007d3848e367fa Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 14:59:40 -0400 Subject: [PATCH 69/74] More documentation --- README.mkd | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.mkd b/README.mkd index e212792..760998c 100644 --- a/README.mkd +++ b/README.mkd @@ -9,10 +9,36 @@ See the [GHC Wiki](https://gitlab.haskell.org/ghc/ghc/wikis/continuous-integration-configuration) for details. -Building images ---------------- +CI Pipeline +----------- The Dockerfiles are defined via [Dhall](https://dhall-lang.org/) expressions. In particular, each major class of Linux distributions has its definitions defined in a file in the `images/` directory. Logic for managing various shared toolchain components (e.g. GHC, `cabal-install`, and LLVM) is contained in `components/`. + +The CI build proceeds as follows: + + * the pipeline in `.gitlab-ci.yml` uses `gitlab-pipeline.dhall` to generate + `gitlab-pipeline.yaml` which defines a child pipeline describing the jobs + needed to build each of the defined images. + * the `generate` job in `gitlab-pipeline.yaml` generates Dockerfiles + using `dockerfiles.dhall`. These are propagated as artifacts to the jobs + that follow. + * each of the jobs in the `build` and `build-derived` stages derived in + `gitlab-pipeline.yaml` build a Docker image from one of the Dockerfiles + generated by the `generate` job. + +Building images manually +------------------------ + +To build images outside of CI (e.g. for testing) simply generate the +`Dockerfile`s from `dockerfiles.dhall` using the `dhall to-directory-tree` +command: + +```bash +$ dhall to-directory-tree --file=dockerfiles.dhall --output=dockerfiles +``` + +This will produce a directory, `dockerfiles/`, which contains one directory +per Docker image. -- GitLab From 956a65b8e9c1343eea5b1bc72835e04f4fee7605 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 15:09:13 -0400 Subject: [PATCH 70/74] Fix ARM --- images/debian.dhall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/debian.dhall b/images/debian.dhall index 13a1958..8548920 100644 --- a/images/debian.dhall +++ b/images/debian.dhall @@ -165,7 +165,7 @@ let images: List Image.Type = { name = "aarch64-linux-deb10" , fromImage = "arm64v8/debian:buster" , runnerTags = [ "aarch64-linux" ] - , bootstrapLlvm = Some { version = "7.1.0" , triple = "aarch64-linux-gnu" } + , bootstrapLlvm = Some { version = "9.0.1" , triple = "aarch64-linux-gnu" } , bootstrapGhc = { version = "8.10.2", triple = "aarch64-deb10-linux" } , llvm = Some { version = "10.0.1" , triple = "aarch64-linux-gnu" } , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" @@ -176,7 +176,7 @@ let images: List Image.Type = { name = "armv7-linux-deb10" , fromImage = "arm32v7/debian:buster" , runnerTags = [ "armv7-linux" ] - , bootstrapLlvm = Some { version = "7.1.0", triple = "armv7a-linux-gnueabihf" } + , bootstrapLlvm = Some { version = "9.0.1", triple = "armv7a-linux-gnueabihf" } , bootstrapGhc = { version = "8.10.2", triple = "armv7-deb10-linux" } , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" -- GitLab From 7212f96115c86ca1c372db71f0ccbd386a2ac05d Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 15:09:17 -0400 Subject: [PATCH 71/74] Add Fedora 32 bindist --- images/fedora.dhall | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/images/fedora.dhall b/images/fedora.dhall index fc37e5f..063b387 100644 --- a/images/fedora.dhall +++ b/images/fedora.dhall @@ -158,5 +158,16 @@ let images: List Image.Type = , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = [] : List Text } + +, FedoraImage.toDocker + { name = "x86_64-linux-fedora32" + , fromImage = "amd64/fedora:32" + , runnerTags = [ "x86_64-linux" ] + , bootstrapLlvm = None Llvm.BindistSpec + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-fedora32-linux" } + , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } + , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } + , extraPackages = [] : List Text + } ] in images \ No newline at end of file -- GitLab From 35fa0648bd6cd878614eebf1c45811bcf8377bbe Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 16:04:57 -0400 Subject: [PATCH 72/74] Fix it --- images/debian.dhall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/debian.dhall b/images/debian.dhall index 8548920..8112723 100644 --- a/images/debian.dhall +++ b/images/debian.dhall @@ -179,7 +179,7 @@ let images: List Image.Type = , bootstrapLlvm = Some { version = "9.0.1", triple = "armv7a-linux-gnueabihf" } , bootstrapGhc = { version = "8.10.2", triple = "armv7-deb10-linux" } , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } - , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-aarch64-debian9-linux.tar.xz" + , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-armv7l-debian9-linux.tar.xz" , extraPackages = debianBuildDepends } @@ -283,4 +283,4 @@ let images: List Image.Type = # installLinters } ] -in images \ No newline at end of file +in images -- GitLab From ae07f9a6b88faa132c46e4d86140b940c539d3e6 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 16:27:07 -0400 Subject: [PATCH 73/74] Fix fedora32 --- images/fedora.dhall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/fedora.dhall b/images/fedora.dhall index 063b387..8f71565 100644 --- a/images/fedora.dhall +++ b/images/fedora.dhall @@ -164,10 +164,10 @@ let images: List Image.Type = , fromImage = "amd64/fedora:32" , runnerTags = [ "x86_64-linux" ] , bootstrapLlvm = None Llvm.BindistSpec - , bootstrapGhc = { version = "8.8.3", triple = "x86_64-fedora32-linux" } + , bootstrapGhc = { version = "8.8.3", triple = "x86_64-fedora27-linux" } , llvm = Some { version = "10.0.1" , triple = "x86_64-linux-gnu-ubuntu-16.04" } , cabalSource = Cabal.fromUpstreamBindist { version = "3.2.0.0", triple = "x86_64-unknown-linux" } , extraPackages = [] : List Text } ] -in images \ No newline at end of file +in images -- GitLab From 384c885fd8b83f94be18e0f92ddba8fc6c1284cd Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 3 Sep 2020 16:33:43 -0400 Subject: [PATCH 74/74] Fix linters --- images/debian.dhall | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/images/debian.dhall b/images/debian.dhall index 8112723..033214f 100644 --- a/images/debian.dhall +++ b/images/debian.dhall @@ -16,7 +16,7 @@ let Image = ../Image.dhall let - docker_base_url: Text = "registry.gitlab.haskell.org/$CI_PROJECT_PATH" + docker_base_url: Text = "registry.gitlab.haskell.org/ghc/ci-images" let coreBuildDepends: List Text = @@ -179,7 +179,7 @@ let images: List Image.Type = , bootstrapLlvm = Some { version = "9.0.1", triple = "armv7a-linux-gnueabihf" } , bootstrapGhc = { version = "8.10.2", triple = "armv7-deb10-linux" } , llvm = Some { version = "10.0.1" , triple = "armv7a-linux-gnueabihf" } - , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-armv7l-debian9-linux.tar.xz" + , cabalSource = Cabal.Type.FromBindist "http://home.smart-cactus.org/~ben/ghc/cabal-install-3.2.0.0-armv7l-debian10-linux.tar.xz" , extraPackages = debianBuildDepends } @@ -274,11 +274,13 @@ let images: List Image.Type = ] # CF.run "building linters" [ "cd git-haskell-org-hooks" - , "$CABAL install" + , "$CABAL update" + , "$CABAL install -w $GHC" ] + # CF.env (toMap { PATH = "/home/ghc/.cabal/bin:$PATH" }) in - CF.from "${docker_base_url}/x86_64-linux-deb10:$CI_COMMIT_SHA" + CF.from "${docker_base_url}/x86_64-linux-deb10:latest" # installMypy # installLinters } -- GitLab