Skip to content

Commit

Permalink
Add workflow to build ghc-alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilKWarmdahl committed Nov 5, 2024
1 parent a32aa55 commit cf9e109
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release-ghc-alpine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
push:
branches:
- ekw/SRE-996/release-ghc-alpine
tags:
- ghc-alpine/*

jobs:
release-ghc-alpine:
uses: concordium/.github/.github/workflows/s3-release-workflow.yaml@ekw/SRE-996/s3-artifact
with:
SERVICE_NAME: "ghc-alpine"
BUILD_ARGS: --build-arg BOOTSTRAP_HASKELL_GHC_VERSION="9.4.6" --build-arg GHC_VERSION="9.4.6"
DOCKER_FILE: docker/ghc-alpine.Dockerfile
FILE_NAME: "ghc-9.2.5-x86_64-unknown-linux-integer-gmp.tar.xz"
BUCKET: "s3://static-libraries.concordium.com"
IAM_ROLE: "arn:aws:iam::192549843005:role/github_ghc-alpine"
18 changes: 18 additions & 0 deletions docker/ghc-alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM alpine:latest
ARG GHC_VERSION
ARG BOOTSTRAP_HASKELL_GHC_VERSION

WORKDIR /

# Install system ghc and dependencies
RUN apk add musl-dev python3 autoconf automake ncurses-dev make file g++ xz git bash wget gmp-dev gmp libffi libffi-dev curl
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1
ENV BOOTSTRAP_HASKELL_NO_UPGRADE=1
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

# Get GHC source
RUN git clone -b ghc-"$GHC_VERSION"-release https://gitlab.haskell.org/ghc/ghc.git/ --recurse-submodules

COPY ../scripts/ghc-alpine-build.sh /ghc-alpine-build.sh
RUN chmod +x /ghc-alpine-build.sh
ENTRYPOINT ["../scripts/ghc-alpine-build.sh"]
21 changes: 21 additions & 0 deletions scripts/ghc-alpine-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -ex

. "$HOME/.ghcup/env"

cd ghc/
cabal install happy alex --install-method=copy
cp ~/.cabal/bin/* /usr/bin

# Build GHC
./boot
./configure --disable-numa
./hadrian/build -j17 --docs=none
mkdir _build/docs
./hadrian/build binary-dist --docs=none

# Copy ghc to out
ls _build
ls _build/bindist
cp _build/bindist/ghc-"$GHC_VERSION"-x86_64-unknown-linux.tar.xz /build/dpkg-build-package/ghc-"$GHC_VERSION"-x86_64-unknown-linux-integer-gmp.tar.xz

0 comments on commit cf9e109

Please sign in to comment.