mirror of
https://github.com/anoma/juvix.git
synced 2024-12-23 23:30:40 +03:00
Upgrade stack snapshot to use ghc-9.2.5 (#1621)
* upgrade stack snapshot to use ghc-9.2.5 * use lts-20.2 * Update alpine GHC Dockerfile to 9.2.5 We also build the Juvix runtime before the stack build in the linux-static-binary workflow file. * Add some documentation on how to build and deploy the alpine GHC image * Docker documentation clarification. Co-authored-by: Paul Cadman <git@paulcadman.dev>
This commit is contained in:
parent
ca410301b0
commit
2db738a76f
5
.github/workflows/linux-static-binary.yaml
vendored
5
.github/workflows/linux-static-binary.yaml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
build:
|
||||
name: Build static binary
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/paulcadman/ghc-alpine:9.2.4
|
||||
container: ghcr.io/paulcadman/ghc-alpine:9.2.5
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v3
|
||||
@ -31,6 +31,9 @@ jobs:
|
||||
- name: Stack permissions bug workaround
|
||||
run: "chown -R $(id -un):$(id -gn) ~"
|
||||
|
||||
- name: Runtime build
|
||||
run: make runtime
|
||||
|
||||
- name: build Juvix
|
||||
run: stack install --allow-different-user --system-ghc --ghc-options='-split-sections -optl-static'
|
||||
|
||||
|
@ -10,19 +10,21 @@ RUN tar xf ghc-8.10.2-x86_64-alpine3.10-linux-integer-simple.tar.xz
|
||||
|
||||
RUN cd ghc-8.10.2-x86_64-unknown-linux && ./configure --prefix /opt && make install
|
||||
|
||||
RUN curl https://downloads.haskell.org/~ghc/9.2.4/ghc-9.2.4-src.tar.xz -OL
|
||||
RUN curl https://downloads.haskell.org/~ghc/9.2.5/ghc-9.2.5-src.tar.xz -OL
|
||||
|
||||
RUN tar xf ghc-9.2.4-src.tar.xz
|
||||
RUN tar xf ghc-9.2.5-src.tar.xz
|
||||
|
||||
WORKDIR /ghc-9.2.4
|
||||
WORKDIR /ghc-9.2.5
|
||||
|
||||
RUN GHC=/opt/bin/ghc ./configure --prefix /usr/local
|
||||
|
||||
RUN make -j
|
||||
RUN make install
|
||||
|
||||
RUN apk add --no-cache clang llvm
|
||||
|
||||
WORKDIR /
|
||||
|
||||
RUN curl https://get.haskellstack.org/stable/linux-x86_64.tar.gz -OL
|
||||
RUN tar xf linux-x86_64.tar.gz
|
||||
RUN cp stack-2.7.5-linux-x86_64/stack /usr/local/bin
|
||||
RUN curl https://github.com/commercialhaskell/stack/releases/download/v2.9.1/stack-2.9.1-linux-x86_64.tar.gz -OL
|
||||
RUN tar xf stack-2.9.1-linux-x86_64.tar.gz
|
||||
RUN cp stack-2.9.1-linux-x86_64/stack /usr/local/bin
|
46
docker/README.md
Normal file
46
docker/README.md
Normal file
@ -0,0 +1,46 @@
|
||||
# The GHC alpine image
|
||||
|
||||
We need this image to workaround an issue with the official GHC alpine binary,
|
||||
see https://gitlab.haskell.org/ghc/ghc/-/issues/20266
|
||||
|
||||
We use this image to make static linux binaries.
|
||||
|
||||
## Building the image
|
||||
|
||||
The tag of the image should be prefixed by the location of the GitHub docker
|
||||
repository that you're pushing to. In this case the repository is `
|
||||
ghcr.io/paulcadman`.
|
||||
|
||||
``` shell
|
||||
docker build -t ghcr.io/paulcadman/ghc-alpine:9.2.5 -f Dockerfile-ghc-alpine-9.2.5 .
|
||||
```
|
||||
|
||||
## Authenticating with the GitHub Docker repository
|
||||
|
||||
First create a classic personal access token with `repo` and `write:packages`
|
||||
permissions.
|
||||
|
||||
Consult the GitHub documentation on how to do this:
|
||||
|
||||
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry
|
||||
|
||||
Set the token to the variable `CR_PAT` and then authenticate:
|
||||
|
||||
``` shell
|
||||
echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
|
||||
```
|
||||
|
||||
NB: You do not substitue your username for `USERNAME` in the command above.
|
||||
|
||||
## Testing the image
|
||||
|
||||
``` shell
|
||||
docker run -it --rm ghcr.io/paulcadman/ghc-alpine:9.2.5
|
||||
```
|
||||
|
||||
## Pushing the image
|
||||
|
||||
``` shell
|
||||
docker push ghcr.io/paulcadman/ghc-alpine:9.2.5
|
||||
|
||||
```
|
@ -1,3 +1,3 @@
|
||||
ghc-options:
|
||||
"$locals": -optP-Wno-nonportable-include-path
|
||||
resolver: nightly-2022-08-04
|
||||
resolver: lts-20.2
|
||||
|
Loading…
Reference in New Issue
Block a user