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

Update CI: GHC 9.10, update and cleanup shell.nix #267

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci '--distribution' 'jammy' 'github' 'cabal.project'
# haskell-ci 'github' 'cabal.project' '--config=cabal.haskell-ci'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.18.1
# version: 0.19.20240608
#
# REGENDATA ("0.18.1",["--distribution","jammy","github","cabal.project"])
# REGENDATA ("0.19.20240608",["github","cabal.project","--config=cabal.haskell-ci"])
#
name: Haskell-CI
on:
Expand All @@ -28,14 +28,19 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.4
- compiler: ghc-9.6.5
compilerKind: ghc
compilerVersion: 9.6.4
compilerVersion: 9.6.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.6
Expand Down Expand Up @@ -148,7 +153,7 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -176,15 +181,15 @@ jobs:
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(gibbon)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(gibbon)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -200,7 +205,7 @@ jobs:
run: |
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
- name: save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Test our Nix setup"
on:
pull_request:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- uses: rrbutani/use-nix-shell-action@v1
with:
file: shell.nix
- run: cabal update
- run: cabal build exe:gibbon
- run: cabal test gibbon --test-show-details=direct
8 changes: 6 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
packages: gibbon-compiler

program-options
ghc-options: -Werror=x-no-partial
if (impl(ghc >= 9.8))
program-options
ghc-options: -Werror=x-no-partial
else
program-options
ghc-options: -Werror
5 changes: 3 additions & 2 deletions gibbon-compiler/gibbon.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ tested-with: GHC==9.4.6
, GHC==9.0.2
, GHC==8.10.7
, GHC==8.8.4
, GHC==9.6.4
, GHC==9.6.5
, GHC==9.8.2
, GHC==9.10.1

flag LLVM_ENABLED
description: Enable LLVM backend
Expand Down Expand Up @@ -99,7 +100,7 @@ library
, process >= 1.4.3 && < 2
, filepath >= 1.4.1 && < 2
, directory >= 1.3 && < 2
, containers >= 0.5.8 && < 0.7
, containers >= 0.5.8 && < 0.8
, deepseq >= 1.4.2 && < 1.6
, mtl >= 2.2.1 && < 3
, transformers >= 0.5.2 && < 1
Expand Down
34 changes: 16 additions & 18 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
let
moz_overlay = import (builtins.fetchGit {
name = "nixpkgs-mozilla-2023-11-13";
url = "https://github.com/mozilla/nixpkgs-mozilla";
ref = "refs/heads/master";
# Most recent commit hash as of 2023-11-13
rev = "6eabade97bc28d707a8b9d82ad13ef143836736e";
});
pkgs = import (builtins.fetchGit {
url = "https://github.com/nixos/nixpkgs/";
ref = "refs/tags/23.05";
}) { overlays = [ moz_overlay ]; };
stdenv = pkgs.overrideCC pkgs.stdenv pkgs.gcc7;
ghc = pkgs.haskell.compiler.ghc94;
rust = (pkgs.rustChannelOf { rustToolchain = ./gibbon-rts/rust-toolchain; }).rust;
clang = pkgs.clang_14;
llvm = pkgs.llvm_14;
ref = "refs/tags/24.05";
}) {};

clang = pkgs.clang_16;
llvm = pkgs.llvm_16;
gibbon_dir = builtins.toString ./.;
in
with pkgs;
stdenv.mkDerivation {

# we are stuck with GCC 7 because Cilk was kicked out in GCC 8,
# OpenCilk needs packaging in nixpkgs, see
# https://github.com/NixOS/nixpkgs/issues/144256
mkShell.override { stdenv = pkgs.gcc7Stdenv; } {

# we use default Haskell toolchain supplied with the chosen nixpkgs; this way we hit their cache
inputsFrom = [ (pkgs.haskellPackages.callCabal2nix "gibbon-compiler" ./gibbon-compiler { }).env ];

name = "basicGibbonEnv";
buildInputs = [ # Haskell
ghc cabal-install stack
buildInputs = [
# C/C++
clang llvm gcc7 boehmgc uthash
# Rust
rust
rustc cargo
# Racket
racket
# Other utilities
Expand Down
Loading