Skip to content

Commit e86ef0c

Browse files
committed
CI: Use Ubuntu 22.04, drop 18.04
GitHub Actions has deprecated its Ubuntu 18.04 runners, and they will be removed by December 1, 2022. Moreover, GitHub Actions now offers Ubuntu 22.04 runners. It seems like a good time to upgrade our CI accordingly. Somewhat annoyingly, the `haskell` Docker images that we use in our Dockerfiles use such an old version of Debian that their version of `glibc` is incompatible with any of the `what4-solvers` built for Ubuntu 20.04 or 22.04. As a result, I switched them from the `haskell` Docker image to the `ubuntu` one. This required some minor tweaks to how dependencies are installed, but nothing too serious.
1 parent 007ecae commit e86ef0c

File tree

4 files changed

+44
-22
lines changed

4 files changed

+44
-22
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
workflow_dispatch:
1010

1111
env:
12-
SOLVER_PKG_VERSION: "snapshot-20220721"
12+
SOLVER_PKG_VERSION: "snapshot-20220812"
1313
# The CACHE_VERSION can be updated to force the use of a new cache if
1414
# the current cache contents become corrupted/invalid. This can
1515
# sometimes happen when (for example) the OS version is changed but
@@ -20,7 +20,7 @@ env:
2020

2121
jobs:
2222
config:
23-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-22.04
2424
outputs:
2525
name: ${{ steps.config.outputs.name }}
2626
version: ${{ steps.config.outputs.version }}
@@ -58,7 +58,7 @@ jobs:
5858
strategy:
5959
fail-fast: false
6060
matrix:
61-
os: [ubuntu-20.04, macos-12, windows-2019]
61+
os: [ubuntu-22.04, macos-12, windows-2019]
6262
ghc-version: ["8.8.4", "8.10.7", "9.0.2", "9.2.2"]
6363
exclude:
6464
# https://gitlab.haskell.org/ghc/ghc/-/issues/18550
@@ -71,7 +71,7 @@ jobs:
7171
include:
7272
# We include one job from an older Ubuntu LTS release to increase our
7373
# coverage of possible Linux configurations.
74-
- os: ubuntu-18.04
74+
- os: ubuntu-22.04
7575
ghc-version: 8.8.4
7676
outputs:
7777
test-lib-json: ${{ steps.test-lib.outputs.targets-json }}
@@ -231,12 +231,12 @@ jobs:
231231
matrix:
232232
suite: [test-lib]
233233
target: ${{ fromJson(needs.build.outputs.test-lib-json) }}
234-
os: [ubuntu-20.04, macos-12, windows-2019]
234+
os: [ubuntu-22.04, macos-12, windows-2019]
235235
continue-on-error: [false]
236236
include:
237237
- suite: rpc
238238
target: ''
239-
os: ubuntu-20.04
239+
os: ubuntu-22.04
240240
continue-on-error: false
241241
#- suite: rpc
242242
# target: ''
@@ -311,7 +311,7 @@ jobs:
311311
cryptol-remote-api/run_rpc_tests.sh
312312
313313
build-push-image:
314-
runs-on: ubuntu-20.04
314+
runs-on: ubuntu-22.04
315315
needs: [config]
316316
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || needs.config.outputs.release == 'true'
317317
strategy:

Dockerfile

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
1-
FROM haskell:8.8.4 AS build
1+
FROM ubuntu:22.04 AS build
22

3-
RUN apt-get update && apt-get install -y libncurses-dev unzip
3+
RUN apt-get update && \
4+
apt-get install -y \
5+
# ghcup requirements
6+
build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev libncurses6 libtinfo6 \
7+
# Cryptol dependencies
8+
zlib1g-dev \
9+
# Miscellaneous
10+
unzip
411
RUN useradd -m cryptol
512
COPY --chown=cryptol:cryptol . /cryptol
613
USER cryptol
714
WORKDIR /cryptol
815
RUN mkdir -p rootfs/usr/local/bin
916
WORKDIR /cryptol/rootfs/usr/local/bin
10-
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220114/ubuntu-18.04-bin.zip"
17+
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220812/ubuntu-22.04-bin.zip"
1118
RUN unzip solvers.zip && rm solvers.zip && chmod +x *
1219
WORKDIR /cryptol
13-
ENV PATH=/cryptol/rootfs/usr/local/bin:$PATH
20+
ENV PATH=/cryptol/rootfs/usr/local/bin:/home/cryptol/.local/bin:/home/cryptol/.ghcup/bin:$PATH
1421
RUN z3 --version
1522
ARG CRYPTOLPATH="/cryptol/.cryptol"
1623
ENV LANG=C.UTF-8 \
1724
LC_ALL=C.UTF-8
1825
COPY cabal.GHC-8.8.4.config cabal.project.freeze
26+
RUN mkdir -p /home/cryptol/.local/bin && \
27+
curl -L https://downloads.haskell.org/~ghcup/0.1.17.7/x86_64-linux-ghcup-0.1.17.7 -o /home/cryptol/.local/bin/ghcup && \
28+
chmod +x /home/cryptol/.local/bin/ghcup
29+
RUN mkdir -p /home/cryptol/.ghcup && \
30+
ghcup --version && \
31+
ghcup install cabal 3.6.2.0 && \
32+
ghcup install ghc 8.8.4 && \
33+
ghcup set ghc 8.8.4
1934
RUN cabal v2-update && \
2035
cabal v2-build -j cryptol:exe:cryptol && \
2136
cp $(cabal v2-exec which cryptol) rootfs/usr/local/bin && \
@@ -33,9 +48,9 @@ RUN mkdir -p rootfs/"${CRYPTOLPATH}" \
3348
USER root
3449
RUN chown -R root:root /cryptol/rootfs
3550

36-
FROM debian:buster-20210511-slim
51+
FROM ubuntu:22.04
3752
RUN apt-get update \
38-
&& apt-get install -y libgmp10 libgomp1 libffi6 libncurses6 libtinfo6 libreadline7 \
53+
&& apt-get install -y libgmp10 libgomp1 libffi8 libncurses6 libtinfo6 libreadline8 \
3954
&& apt-get clean && rm -rf /var/lib/apt/lists/*
4055
RUN useradd -m cryptol && chown -R cryptol:cryptol /home/cryptol
4156
COPY --from=build /cryptol/rootfs /

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Cryptol currently uses Microsoft Research's [Z3 SMT
4646
solver](https://github.com/Z3Prover/z3) by default to solve constraints
4747
during type checking, and as the default solver for the `:sat` and
4848
`:prove` commands. Cryptol generally requires the most recent version
49-
of Z3, but you can see the specific version tested in CI by looking [here](https://github.com/GaloisInc/what4-solvers/releases/tag/snapshot-20220721).
49+
of Z3, but you can see the specific version tested in CI by looking [here](https://github.com/GaloisInc/what4-solvers/releases/tag/snapshot-20220812).
5050

5151
You can download Z3 binaries for a variety of platforms from their
5252
[releases page](https://github.com/Z3Prover/z3/releases). If you
@@ -75,8 +75,8 @@ Cryptol builds and runs on various flavors of Linux, Mac OS X, and
7575
Windows. We regularly build and test it in the following environments:
7676

7777
- macOS 12, 64-bit
78-
- Ubuntu 18.04, 64-bit
7978
- Ubuntu 20.04, 64-bit
79+
- Ubuntu 22.04, 64-bit
8080
- Windows Server 2019, 64-bit
8181

8282
## Prerequisites

cryptol-remote-api/Dockerfile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
ARG GHCVER="8.10.7"
22
ARG GHCVER_BOOTSTRAP="8.10.2"
3-
FROM debian:buster-20210511 AS toolchain
3+
FROM ubuntu:22.04 AS toolchain
44
ARG PORTABILITY=false
5-
RUN apt-get update && apt-get install -y libncurses-dev libz-dev unzip \
6-
build-essential curl libffi-dev libffi6 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 libnuma-dev \
7-
$(if ${PORTABILITY}; then echo git autoconf python3; fi)
5+
RUN apt-get update && \
6+
apt-get install -y \
7+
# ghcup requirements
8+
build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev libncurses6 libtinfo6 \
9+
# Cryptol dependencies
10+
zlib1g-dev \
11+
# GHC build dependencies
12+
$(if ${PORTABILITY}; then echo git autoconf python3 libnuma-dev; fi) \
13+
# Miscellaneous
14+
unzip
815
ENV GHCUP_INSTALL_BASE_PREFIX=/opt \
916
PATH=/opt/.ghcup/bin:$PATH
1017
RUN curl -o /usr/local/bin/ghcup "https://downloads.haskell.org/~ghcup/0.1.17.7/x86_64-linux-ghcup-0.1.17.7" && \
@@ -57,14 +64,14 @@ ENV PATH=/usr/local/bin:/cryptol/rootfs/usr/local/bin:$PATH
5764
RUN mkdir -p rootfs/"${CRYPTOLPATH}" \
5865
&& cp -r lib/* rootfs/"${CRYPTOLPATH}"
5966
WORKDIR /cryptol/rootfs/usr/local/bin
60-
RUN curl -sL -o solvers.zip "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220114/ubuntu-18.04-bin.zip" && \
67+
RUN curl -sL -o solvers.zip "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220812/ubuntu-22.04-bin.zip" && \
6168
unzip solvers.zip && rm solvers.zip && chmod +x *
6269
USER root
6370
RUN chown -R root:root /cryptol/rootfs
6471

65-
FROM debian:buster-20210511-slim
72+
FROM ubuntu:22.04
6673
RUN apt-get update \
67-
&& apt-get install -y libgmp10 libgomp1 libffi6 libncurses6 libtinfo6 libreadline7 libnuma-dev openssl \
74+
&& apt-get install -y libgmp10 libgomp1 libffi8 libncurses6 libtinfo6 libreadline8 libnuma-dev openssl \
6875
&& apt-get clean && rm -rf /var/lib/apt/lists/*
6976
RUN useradd -m cryptol && chown -R cryptol:cryptol /home/cryptol
7077
COPY --from=build /cryptol/rootfs /

0 commit comments

Comments
 (0)