Skip to content

Commit d818a88

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. The minimum version of LLVM that GitHub Actions' Ubuntu 22.04 runners support is LLVM 12, so I took the time to update the LLVM versions accordingly.
1 parent 5676b29 commit d818a88

9 files changed

+86
-47
lines changed

.github/Dockerfile-crux-llvm

+37-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
1-
FROM haskell:8.8.4 AS build
1+
FROM ubuntu:22.04 AS build
22

3-
RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
4-
RUN apt-get update && apt-get install -y wget libncurses-dev unzip clang-11 llvm-11-tools
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+
# Crux dependencies \
8+
zlib1g-dev \
9+
# LLVM toolchain
10+
clang-12 llvm-12-tools \
11+
# Miscellaneous
12+
locales unzip wget
13+
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
14+
locale-gen
15+
ENV LANG en_US.UTF-8
16+
ENV LANGUAGE en_US:en
17+
ENV LC_ALL en_US.UTF-8
518

619
WORKDIR /usr/local/bin
7-
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20210917/ubuntu-18.04-bin.zip"
20+
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220812/ubuntu-22.04-bin.zip"
821
RUN unzip solvers.zip && rm solvers.zip && chmod +x *
922

23+
ENV PATH=/root/ghcup-download/bin:/root/.ghcup/bin:$PATH
24+
RUN mkdir -p /root/ghcup-download/bin && \
25+
curl -L https://downloads.haskell.org/~ghcup/0.1.17.7/x86_64-linux-ghcup-0.1.17.7 -o /root/ghcup-download/bin/ghcup && \
26+
chmod +x /root/ghcup-download/bin/ghcup
27+
RUN mkdir -p /root/.ghcup && \
28+
ghcup --version && \
29+
ghcup install cabal 3.6.2.0 && \
30+
ghcup install ghc 8.8.4 && \
31+
ghcup set ghc 8.8.4
1032
RUN cabal v2-update
1133

1234
ARG DIR=/crux-llvm
@@ -20,32 +42,32 @@ ADD crux-llvm ${DIR}/build/crux-llvm
2042
ADD dependencies ${DIR}/build/dependencies
2143
ADD .github/cabal.project.crux-llvm ${DIR}/build/cabal.project
2244
ADD cabal.GHC-8.8.4.config ${DIR}/build/cabal.project.freeze
23-
# Workaround until we have an LLVM 11 build available
24-
RUN cp $DIR/build/crux-llvm/c-src/libcxx-7.1.0.bc $DIR/build/crux-llvm/c-src/libcxx-11.0.1.bc
45+
# Workaround until we have an LLVM 12 build available
46+
RUN cp $DIR/build/crux-llvm/c-src/libcxx-7.1.0.bc $DIR/build/crux-llvm/c-src/libcxx-12.0.1.bc
2547

2648
WORKDIR ${DIR}/build
2749
RUN cabal v2-build --only-dependencies crux-llvm
2850
RUN cabal v2-build crux-llvm
29-
ENV CLANG=clang-11
30-
ENV LLVM_LINK=llvm-link-11
51+
ENV CLANG=clang-12
52+
ENV LLVM_LINK=llvm-link-12
3153
RUN cabal v2-test crux-llvm
3254
RUN cp `cabal v2-exec which crux-llvm` /usr/local/bin
3355
RUN cp `cabal v2-exec which crux-llvm-svcomp` /usr/local/bin
3456

35-
FROM debian:buster-slim
57+
FROM ubuntu:22.04
3658

3759
USER root
38-
RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
39-
RUN apt-get update
40-
RUN apt-get install -y libgmp10 zlibc zlib1g clang-11 llvm-11-tools unzip locales
60+
RUN apt-get update && \
61+
apt-get install -y \
62+
libgmp10 zlib1g clang-12 llvm-12-tools unzip locales
4163

4264
COPY --from=build /usr/local/bin/* /usr/local/bin/
4365

4466
ARG DIR=/crux-llvm
4567
WORKDIR ${DIR}
4668
ADD crux-llvm/c-src c-src
4769
# Use LLVM 7 bitcode file for libcxx until LLVM version is available
48-
RUN cp c-src/libcxx-7.1.0.bc c-src/libcxx-11.0.1.bc
70+
RUN cp c-src/libcxx-7.1.0.bc c-src/libcxx-12.0.1.bc
4971

5072
# (Temporary) fix for
5173
# https://github.com/galoisinc/crucible/issues/887: the libDir default
@@ -56,8 +78,8 @@ RUN cp -r c-src /usr/local/
5678
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
5779
locale-gen
5880
ENV LD_LIBRARY_PATH=/usr/local/lib
59-
ENV CLANG=clang-11
60-
ENV LLVM_LINK=llvm-link-11
81+
ENV CLANG=clang-12
82+
ENV LLVM_LINK=llvm-link-12
6183
ENV LANG en_US.UTF-8
6284
ENV LANGUAGE en_US:en
6385
ENV LC_ALL en_US.UTF-8

.github/Dockerfile-crux-mir

+23-6
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,21 @@ RUN rustup component add --toolchain nightly-2020-03-22 rustc-dev
77
RUN rustup default nightly-2020-03-22
88
RUN cargo install --locked
99

10-
FROM haskell:8.8.4 AS build
10+
FROM ubuntu:22.04 AS build
1111

12-
RUN apt-get update && apt-get install -y wget libncurses-dev unzip
12+
RUN apt-get update && \
13+
apt-get install -y \
14+
# ghcup requirements
15+
build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev libncurses6 libtinfo6 \
16+
# Crux dependencies \
17+
zlib1g-dev \
18+
# Miscellaneous
19+
unzip wget
1320

1421
COPY --from=mir_json /usr/local/cargo /usr/local/cargo
1522
COPY --from=mir_json /usr/local/rustup /usr/local/rustup
1623
WORKDIR /usr/local/bin
17-
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20210917/ubuntu-18.04-bin.zip"
24+
RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20220812/ubuntu-22.04-bin.zip"
1825
RUN unzip solvers.zip && rm solvers.zip && chmod +x *
1926

2027
ENV CARGO_HOME=/usr/local/cargo
@@ -23,6 +30,15 @@ ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/rustup/lib
2330
ENV LANG=C.UTF-8 \
2431
LC_ALL=C.UTF-8
2532

33+
ENV PATH=/root/ghcup-download/bin:/root/.ghcup/bin:$PATH
34+
RUN mkdir -p /root/ghcup-download/bin && \
35+
curl -L https://downloads.haskell.org/~ghcup/0.1.17.7/x86_64-linux-ghcup-0.1.17.7 -o /root/ghcup-download/bin/ghcup && \
36+
chmod +x /root/ghcup-download/bin/ghcup
37+
RUN mkdir -p /root/.ghcup && \
38+
ghcup --version && \
39+
ghcup install cabal 3.6.2.0 && \
40+
ghcup install ghc 8.8.4 && \
41+
ghcup set ghc 8.8.4
2642
RUN cabal v2-update
2743

2844
ARG DIR=/crux-mir
@@ -47,11 +63,12 @@ RUN ./translate_libs.sh
4763
WORKDIR ${DIR}/build
4864
RUN cabal v2-test crux-mir
4965

50-
FROM debian:buster-slim
66+
FROM ubuntu:22.04
5167

5268
USER root
53-
RUN apt-get update
54-
RUN apt-get install -y libgmp10 zlibc zlib1g libcurl4
69+
RUN apt-get update && \
70+
apt-get install -y \
71+
libgmp10 zlib1g libcurl4
5572

5673
ARG DIR=/crux-mir
5774
COPY --from=mir_json /usr/local/cargo /usr/local/cargo

.github/ci.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ test() {
6464

6565
install_llvm() {
6666
if [[ "$RUNNER_OS" = "Linux" ]]; then
67-
sudo apt-get update -q && sudo apt-get install -y clang-10 llvm-10-tools
67+
sudo apt-get update -q && sudo apt-get install -y clang-12 llvm-12-tools
6868
elif [[ "$RUNNER_OS" = "macOS" ]]; then
6969
brew install llvm@11
7070
elif [[ "$RUNNER_OS" = "Windows" ]]; then

.github/workflows/crucible-go-build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
os: [ubuntu-20.04]
29+
os: [ubuntu-22.04]
3030
ghc: ["8.10.7", "9.0.2", "9.2.4"]
3131
include:
3232
- os: macos-12
@@ -64,7 +64,7 @@ jobs:
6464
- shell: bash
6565
run: .github/ci.sh install_system_deps
6666
env:
67-
SOLVER_PKG_VERSION: "snapshot-20220721"
67+
SOLVER_PKG_VERSION: "snapshot-20220812"
6868
BUILD_TARGET_OS: ${{ matrix.os }}
6969

7070
- name: Setup Environment Vars

.github/workflows/crucible-jvm-build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
os: [ubuntu-20.04]
29+
os: [ubuntu-22.04]
3030
ghc: ["8.10.7", "9.0.2", "9.2.4"]
3131
include:
3232
- os: macos-12
@@ -64,7 +64,7 @@ jobs:
6464
- shell: bash
6565
run: .github/ci.sh install_system_deps
6666
env:
67-
SOLVER_PKG_VERSION: "snapshot-20220721"
67+
SOLVER_PKG_VERSION: "snapshot-20220812"
6868
BUILD_TARGET_OS: ${{ matrix.os }}
6969

7070
- name: Setup Environment Vars

.github/workflows/crucible-wasm-build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
os: [ubuntu-20.04]
29+
os: [ubuntu-22.04]
3030
ghc: ["8.10.7", "9.0.2", "9.2.4"]
3131
include:
3232
- os: macos-12
@@ -64,7 +64,7 @@ jobs:
6464
- shell: bash
6565
run: .github/ci.sh install_system_deps
6666
env:
67-
SOLVER_PKG_VERSION: "snapshot-20220721"
67+
SOLVER_PKG_VERSION: "snapshot-20220812"
6868
BUILD_TARGET_OS: ${{ matrix.os }}
6969

7070
- name: Setup Environment Vars

.github/workflows/crux-llvm-build.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121

2222
jobs:
2323
outputs:
24-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-22.04
2525
outputs:
2626
changed: ${{ steps.outputs.outputs.changed-files }}
2727
name: ${{ steps.outputs.outputs.name }}
@@ -43,12 +43,12 @@ jobs:
4343
strategy:
4444
fail-fast: false
4545
matrix:
46-
os: [ubuntu-20.04]
46+
os: [ubuntu-22.04]
4747
ghc: ["8.10.7", "9.0.2", "9.2.4"]
4848
include:
49-
- os: ubuntu-20.04
49+
- os: ubuntu-22.04
5050
ghc: 8.8.4
51-
- os: ubuntu-18.04
51+
- os: ubuntu-20.04
5252
ghc: 9.2.4
5353
- os: macos-12
5454
ghc: 9.2.4
@@ -85,7 +85,7 @@ jobs:
8585
- shell: bash
8686
run: .github/ci.sh install_system_deps
8787
env:
88-
SOLVER_PKG_VERSION: "snapshot-20220721"
88+
SOLVER_PKG_VERSION: "snapshot-20220812"
8989
BUILD_TARGET_OS: ${{ matrix.os }}
9090

9191
- name: Setup Environment Vars
@@ -149,25 +149,25 @@ jobs:
149149
run: .github/ci.sh test crucible-llvm
150150
if: runner.os == 'Linux'
151151
env:
152-
LLVM_LINK: "llvm-link-10"
153-
LLVM_AS: "llvm-as-10"
154-
CLANG: "clang-10"
152+
LLVM_LINK: "llvm-link-12"
153+
LLVM_AS: "llvm-as-12"
154+
CLANG: "clang-12"
155155

156156
- shell: bash
157157
name: Test crux-llvm (Linux)
158158
run: .github/ci.sh test crux-llvm
159159
if: runner.os == 'Linux'
160160
env:
161-
LLVM_LINK: "llvm-link-10"
162-
CLANG: "clang-10"
161+
LLVM_LINK: "llvm-link-12"
162+
CLANG: "clang-12"
163163

164164
- shell: bash
165165
name: Test uc-crux-llvm (Linux)
166166
run: .github/ci.sh test uc-crux-llvm
167-
if: matrix.os == 'ubuntu-20.04'
167+
if: matrix.os == 'ubuntu-22.04'
168168
env:
169-
LLVM_LINK: "llvm-link-10"
170-
CLANG: "clang-10"
169+
LLVM_LINK: "llvm-link-12"
170+
CLANG: "clang-12"
171171

172172
- shell: bash
173173
name: Install LLVM-11 for MacOS

.github/workflows/crux-mir-build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222

2323
jobs:
2424
outputs:
25-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-22.04
2626
outputs:
2727
changed: ${{ steps.outputs.outputs.changed-files }}
2828
name: ${{ steps.outputs.outputs.name }}
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
os: [ubuntu-20.04]
45+
os: [ubuntu-22.04]
4646
ghc: ["8.10.7", "9.0.2", "9.2.4"]
4747
include:
4848
- os: macos-12
@@ -86,7 +86,7 @@ jobs:
8686
- shell: bash
8787
run: .github/ci.sh install_system_deps
8888
env:
89-
SOLVER_PKG_VERSION: "snapshot-20220721"
89+
SOLVER_PKG_VERSION: "snapshot-20220812"
9090
BUILD_TARGET_OS: ${{ matrix.os }}
9191

9292
- name: Setup Environment Vars

.github/workflows/uc-crux-llvm-lint.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
lint:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
name: uc-crux-llvm lint
1212
steps:
1313
- uses: actions/checkout@v2
@@ -18,9 +18,9 @@ jobs:
1818
run: |
1919
cd uc-crux-llvm/
2020
curl --location -o hlint.tar.gz \
21-
https://github.com/ndmitchell/hlint/releases/download/v3.3/hlint-3.3-x86_64-linux.tar.gz
21+
https://github.com/ndmitchell/hlint/releases/download/v3.4.1/hlint-3.4.1-x86_64-linux.tar.gz
2222
tar xvf hlint.tar.gz
23-
./hlint-3.3/hlint exe src test
23+
./hlint-3.4.1/hlint exe src test
2424
2525
- uses: mrkkrp/ormolu-action@v2
2626
# This is currently disabled, since it complains about

0 commit comments

Comments
 (0)