Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ekw/sre 996/release ghc alpine #4

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
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.4.6-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 ["/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-1.20.1.1 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/pkg-root/ghc-"$GHC_VERSION"-x86_64-unknown-linux-integer-gmp.tar.xz
Loading