Skip to content

Commit

Permalink
Merge pull request #948 from GaloisInc/ghc-9.0
Browse files Browse the repository at this point in the history
Support building with GHC 9.0
  • Loading branch information
RyanGlScott authored Jan 7, 2022
2 parents f343d78 + 49014ce commit be3d315
Show file tree
Hide file tree
Showing 44 changed files with 1,413 additions and 1,212 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/crucible-go-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest] # , macos-10.15] # , windows-latest]
ghc: ["8.6.5", "8.8.4", "8.10.4"]
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2"]
allow-failure: [false]
include:
- os: macos-10.15
Expand All @@ -38,13 +38,18 @@ jobs:
ghc: 8.8.4
allow-failure: true
- os: macos-10.15
ghc: 8.10.2
ghc: 8.10.7
allow-failure: true
- os: macos-10.15
ghc: 9.0.2
allow-failure: true
# Windows only seems to work on 8.6.5. Others result in
# segfaults or other internal errors.
exclude:
- os: windows-latest
ghc: 8.10.2
ghc: 9.0.2
- os: windows-latest
ghc: 8.10.7
- os: windows-latest
ghc: 8.8.4
name: crucible-go - GHC v${{ matrix.ghc }} - ${{ matrix.os }}
Expand All @@ -58,9 +63,12 @@ jobs:
with:
ghc-version: ${{ matrix.ghc }}

- uses: cachix/install-nix-action@v12
- name: Install Nix
uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-20.09
nix_path: nixpkgs=channel:21.11
install_url: https://releases.nixos.org/nix/nix-2.4/install

- uses: actions/cache@v2
name: Cache cabal store
with:
Expand All @@ -80,7 +88,12 @@ jobs:
- name: Setup Environment Vars
run: |
GHC=haskell.compiler.ghc$(echo ${{ matrix.ghc }} | sed -e s,\\.,,g)
echo GHC=$GHC >> $GITHUB_ENV
case ${{ matrix.ghc }} in
8.6.5) GHC_NIXPKGS=github:nixos/nixpkgs/20.09 ;;
9.0.2) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-unstable ;;
*) GHC_NIXPKGS=github:nixos/nixpkgs/21.11 ;;
esac
echo NS="nix shell ${GHC_NIXPKGS}#cabal-install ${GHC_NIXPKGS}#${GHC} nixpkgs#gmp nixpkgs#zlib nixpkgs#zlib.dev" >> $GITHUB_ENV
- name: Package's Cabal/GHC compatibility
shell: bash
Expand All @@ -95,7 +108,7 @@ jobs:
defsetup() { echo import Distribution.Simple; echo main = defaultMain; }
setup_src() { if [ ! -f Setup.hs ] ; then defsetup > DefSetup.hs; fi; ls *Setup.hs; }
setup_bin() { echo setup.${{ matrix.ghc }}; }
with_ghc() { nix-shell -p $GHC --run "$(echo ${@})"; }
with_ghc() { $NS -c ${@}; }
(cd crucible-go; with_ghc ghc -o $(setup_bin) $(setup_src) && ./$(setup_bin) clean)
- run: cabal update
- run: cabal configure crux-go --enable-tests
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/crucible-jvm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest] # , macos-10.15] # , windows-latest]
ghc: ["8.6.5", "8.8.4", "8.10.4"]
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2"]
allow-failure: [false]
include:
- os: macos-10.15
Expand All @@ -38,13 +38,18 @@ jobs:
ghc: 8.8.4
allow-failure: true
- os: macos-10.15
ghc: 8.10.2
ghc: 8.10.7
allow-failure: true
- os: macos-10.15
ghc: 9.0.2
allow-failure: true
# Windows only seems to work on 8.6.5. Others result in
# segfaults or other internal errors.
exclude:
- os: windows-latest
ghc: 8.10.2
ghc: 9.0.2
- os: windows-latest
ghc: 8.10.7
- os: windows-latest
ghc: 8.8.4
name: crucible-jvm - GHC v${{ matrix.ghc }} - ${{ matrix.os }}
Expand All @@ -58,9 +63,12 @@ jobs:
with:
ghc-version: ${{ matrix.ghc }}

- uses: cachix/install-nix-action@v12
- name: Install Nix
uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-20.09
nix_path: nixpkgs=channel:21.11
install_url: https://releases.nixos.org/nix/nix-2.4/install

- uses: actions/cache@v2
name: Cache cabal store
with:
Expand All @@ -80,7 +88,12 @@ jobs:
- name: Setup Environment Vars
run: |
GHC=haskell.compiler.ghc$(echo ${{ matrix.ghc }} | sed -e s,\\.,,g)
echo GHC=$GHC >> $GITHUB_ENV
case ${{ matrix.ghc }} in
8.6.5) GHC_NIXPKGS=github:nixos/nixpkgs/20.09 ;;
9.0.2) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-unstable ;;
*) GHC_NIXPKGS=github:nixos/nixpkgs/21.11 ;;
esac
echo NS="nix shell ${GHC_NIXPKGS}#cabal-install ${GHC_NIXPKGS}#${GHC} nixpkgs#gmp nixpkgs#zlib nixpkgs#zlib.dev" >> $GITHUB_ENV
- name: Package's Cabal/GHC compatibility
shell: bash
Expand All @@ -95,7 +108,7 @@ jobs:
defsetup() { echo import Distribution.Simple; echo main = defaultMain; }
setup_src() { if [ ! -f Setup.hs ] ; then defsetup > DefSetup.hs; fi; ls *Setup.hs; }
setup_bin() { echo setup.${{ matrix.ghc }}; }
with_ghc() { nix-shell -p $GHC --run "$(echo ${@})"; }
with_ghc() { $NS -c ${@}; }
(cd crucible-jvm; with_ghc ghc -o $(setup_bin) $(setup_src) && ./$(setup_bin) clean)
- run: cabal update
- run: cabal configure crucible-jvm --enable-tests
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/crucible-wasm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest] # , macos-10.15] # , windows-latest]
ghc: ["8.6.5", "8.8.4", "8.10.4"]
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2"]
allow-failure: [false]
include:
- os: macos-10.15
Expand All @@ -38,13 +38,18 @@ jobs:
ghc: 8.8.4
allow-failure: true
- os: macos-10.15
ghc: 8.10.2
ghc: 8.10.7
allow-failure: true
- os: macos-10.15
ghc: 9.0.2
allow-failure: true
# Windows only seems to work on 8.6.5. Others result in
# segfaults or other internal errors.
exclude:
- os: windows-latest
ghc: 8.10.2
ghc: 9.0.2
- os: windows-latest
ghc: 8.10.7
- os: windows-latest
ghc: 8.8.4
name: crucible-wasm - GHC v${{ matrix.ghc }} - ${{ matrix.os }}
Expand All @@ -58,9 +63,12 @@ jobs:
with:
ghc-version: ${{ matrix.ghc }}

- uses: cachix/install-nix-action@v12
- name: Install Nix
uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-20.09
nix_path: nixpkgs=channel:21.11
install_url: https://releases.nixos.org/nix/nix-2.4/install

- uses: actions/cache@v2
name: Cache cabal store
with:
Expand All @@ -80,7 +88,12 @@ jobs:
- name: Setup Environment Vars
run: |
GHC=haskell.compiler.ghc$(echo ${{ matrix.ghc }} | sed -e s,\\.,,g)
echo GHC=$GHC >> $GITHUB_ENV
case ${{ matrix.ghc }} in
8.6.5) GHC_NIXPKGS=github:nixos/nixpkgs/20.09 ;;
9.0.2) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-unstable ;;
*) GHC_NIXPKGS=github:nixos/nixpkgs/21.11 ;;
esac
echo NS="nix shell ${GHC_NIXPKGS}#cabal-install ${GHC_NIXPKGS}#${GHC} nixpkgs#gmp nixpkgs#zlib nixpkgs#zlib.dev" >> $GITHUB_ENV
- name: Package's Cabal/GHC compatibility
shell: bash
Expand All @@ -95,7 +108,7 @@ jobs:
defsetup() { echo import Distribution.Simple; echo main = defaultMain; }
setup_src() { if [ ! -f Setup.hs ] ; then defsetup > DefSetup.hs; fi; ls *Setup.hs; }
setup_bin() { echo setup.${{ matrix.ghc }}; }
with_ghc() { nix-shell -p $GHC --run "$(echo ${@})"; }
with_ghc() { $NS -c ${@}; }
(cd crucible-wasm; with_ghc ghc -o $(setup_bin) $(setup_src) && ./$(setup_bin) clean)
- run: cabal update
- run: cabal configure crucible-wasm --enable-tests
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/crux-llvm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-18.04] # , macos-10.15] # , windows-latest]
ghc: ["8.6.5", "8.8.4", "8.10.4"]
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2"]
allow-failure: [false]
include:
- os: macos-10.15
Expand All @@ -55,13 +55,18 @@ jobs:
ghc: 8.8.4
allow-failure: true
- os: macos-10.15
ghc: 8.10.2
ghc: 8.10.7
allow-failure: true
- os: macos-10.15
ghc: 9.0.2
allow-failure: true
# Windows only seems to work on 8.6.5. Others result in
# segfaults or other internal errors.
exclude:
- os: windows-latest
ghc: 8.10.2
ghc: 9.0.2
- os: windows-latest
ghc: 8.10.7
- os: windows-latest
ghc: 8.8.4
name: crux-llvm - GHC v${{ matrix.ghc }} - ${{ matrix.os }}
Expand All @@ -75,9 +80,12 @@ jobs:
with:
ghc-version: ${{ matrix.ghc }}

- uses: cachix/install-nix-action@v12
- name: Install Nix
uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-20.09
nix_path: nixpkgs=channel:21.11
install_url: https://releases.nixos.org/nix/nix-2.4/install

- uses: actions/cache@v2
name: Cache cabal store
with:
Expand All @@ -97,7 +105,12 @@ jobs:
- name: Setup Environment Vars
run: |
GHC=haskell.compiler.ghc$(echo ${{ matrix.ghc }} | sed -e s,\\.,,g)
echo GHC=$GHC >> $GITHUB_ENV
case ${{ matrix.ghc }} in
8.6.5) GHC_NIXPKGS=github:nixos/nixpkgs/20.09 ;;
9.0.2) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-unstable ;;
*) GHC_NIXPKGS=github:nixos/nixpkgs/21.11 ;;
esac
echo NS="nix shell ${GHC_NIXPKGS}#cabal-install ${GHC_NIXPKGS}#${GHC} nixpkgs#gmp nixpkgs#zlib nixpkgs#zlib.dev" >> $GITHUB_ENV
- name: Package's Cabal/GHC compatibility
shell: bash
Expand All @@ -112,7 +125,7 @@ jobs:
defsetup() { echo import Distribution.Simple; echo main = defaultMain; }
setup_src() { if [ ! -f Setup.hs ] ; then defsetup > DefSetup.hs; fi; ls *Setup.hs; }
setup_bin() { echo setup.${{ matrix.ghc }}; }
with_ghc() { nix-shell -p $GHC --run "$(echo ${@})"; }
with_ghc() { $NS -c ${@}; }
(cd crucible; with_ghc ghc -o $(setup_bin) $(setup_src) && ./$(setup_bin) clean)
(cd crucible-llvm; with_ghc ghc -o $(setup_bin) $(setup_src) && ./$(setup_bin) clean)
(cd crux; with_ghc ghc -o $(setup_bin) $(setup_src) && ./$(setup_bin) clean)
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/crux-mir-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ jobs:
matrix:
# We want Windows soon, but it doesn't need to be now
os: [ubuntu-latest, macos-10.15] #, windows-latest]
# We want GHC 8.10 soon, but it doesn't need to be now
ghc: ["8.6.5", "8.8.4"] # "8.10.2"]
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2"]
# Windows only seems to work on 8.6.5. Others result in
# segfaults or other internal errors.
exclude:
- os: windows-latest
ghc: 8.10.2
ghc: 9.0.2
- os: windows-latest
ghc: 8.10.7
- os: windows-latest
ghc: 8.8.4
name: crux-mir - GHC v${{ matrix.ghc }} - ${{ matrix.os }}
Expand All @@ -62,9 +63,11 @@ jobs:
with:
ghc-version: ${{ matrix.ghc }}

- uses: cachix/install-nix-action@v12
- name: Install Nix
uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-20.09
nix_path: nixpkgs=channel:21.11
install_url: https://releases.nixos.org/nix/nix-2.4/install

- name: Install latest Rust nightly
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -92,7 +95,12 @@ jobs:
- name: Setup Environment Vars
run: |
GHC=haskell.compiler.ghc$(echo ${{ matrix.ghc }} | sed -e s,\\.,,g)
echo GHC=$GHC >> $GITHUB_ENV
case ${{ matrix.ghc }} in
8.6.5) GHC_NIXPKGS=github:nixos/nixpkgs/20.09 ;;
9.0.2) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-unstable ;;
*) GHC_NIXPKGS=github:nixos/nixpkgs/21.11 ;;
esac
echo NS="nix shell ${GHC_NIXPKGS}#cabal-install ${GHC_NIXPKGS}#${GHC} nixpkgs#gmp nixpkgs#zlib nixpkgs#zlib.dev" >> $GITHUB_ENV
- name: Package's Cabal/GHC compatibility
shell: bash
Expand All @@ -107,7 +115,7 @@ jobs:
defsetup() { echo import Distribution.Simple; echo main = defaultMain; }
setup_src() { if [ ! -f Setup.hs ] ; then defsetup > DefSetup.hs; fi; ls *Setup.hs; }
setup_bin() { echo setup.${{ matrix.ghc }}; }
with_ghc() { nix-shell -p $GHC --run "$(echo ${@})"; }
with_ghc() { $NS -c ${@}; }
(cd crux-mir; with_ghc ghc -o $(setup_bin) $(setup_src) && ./$(setup_bin) clean)
- shell: bash
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,31 @@ Testing with coverage tracking is currently only available via
Use `scripts/stack-test-coverage.sh` to generate a coverage
report for all test suites.

Notes on Freeze Files
---------------------

We use the `cabal.GHC-*.config` files to constrain dependency versions in CI.
We recommand using the following command for best results before building
locally:

```
ln -s cabal.GHC-<VER>.config cabal.project.freeze
```

These configuration files were generated using
`cabal freeze --enable-tests --enable-benchmarks`. Note that at present, these
configuration files assume a Unix-like operating system, as we do not currently
test Windows on CI. If you would like to use these configuration files on
Windows, you will need to make some manual changes to remove certain packages
and flags:

```
regex-posix
tasty +unix
unix
unix-compat
```

Acknowledgements
----------------

Expand Down
Loading

0 comments on commit be3d315

Please sign in to comment.