Skip to content

Commit

Permalink
Fix #132: add support for GHC 9.6.4 (#134)
Browse files Browse the repository at this point in the history
* Fix #132: add support for GHC 9.6.4

`nix flake lock --update-input haskellNix`

* Drop ghc99

* Set hlint for 9.2.8 to 3.6.1

* Bump max compiler.

Maybe we want to this actually be "unreleased"?

* disable hls for 9.7+

We need to find a hls (and have it in haskell.nix) that builds with 9.8 🤦

* Try to fix tools

* 9.0 use lhs 2.4

* Split out IOGFull into static as well.

* cleanup R

* fix typo

* R doesn't build for aarch64-musl

* Disable R on aarch64; disable hls on -js and -windows

* Disable R (libjpeg-turbo fails to build for x86_64-musl)

---------

Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
  • Loading branch information
yvan-sraka and angerman committed Apr 16, 2024
1 parent 82eb2a0 commit c79eecf
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 78 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Expand Up @@ -39,7 +39,6 @@ jobs:
- ghc92
- ghc96
- ghc98
- ghc99
target-platform:
- ""
- "-static"
Expand Down
5 changes: 3 additions & 2 deletions cross-js.nix
Expand Up @@ -87,15 +87,16 @@ pkgs.mkShell ({
stdenv.cc.cc.lib ]) ++ (with pkgs.buildPackages; [
])
++ pkgs.lib.optional (withHLS && (compiler-not-in (
pkgs.lib.optional (builtins.compareVersions compiler.version "9.9" >= 0) compiler-nix-name
# it appears we can't get HLS build with 9.8 yet.
pkgs.lib.optional (builtins.compareVersions compiler.version "9.7" >= 0) compiler-nix-name
++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in (
pkgs.lib.optional (builtins.compareVersions compiler.version "9.8" >= 0) compiler-nix-name
++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint")
++ pkgs.lib.optional withIOG
(with pkgs; [ cddl cbor-diag ]
++ map pkgs.lib.getDev (with pkgs; [
libblst libsodium-vrf secp256k1 #R_4_1_3
libblst libsodium-vrf secp256k1
]))
;
})
5 changes: 3 additions & 2 deletions cross-windows.nix
Expand Up @@ -174,15 +174,16 @@ pkgs.pkgsBuildBuild.mkShell ({
windows.mingw_w64_pthreads
])
++ pkgs.lib.optional (withHLS && (compiler-not-in (
pkgs.lib.optional (builtins.compareVersions compiler.version "9.9" >= 0) compiler-nix-name
# it appears we can't get HLS build with 9.8 yet.
pkgs.lib.optional (builtins.compareVersions compiler.version "9.7" >= 0) compiler-nix-name
++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in (
pkgs.lib.optional (builtins.compareVersions compiler.version "9.8" >= 0) compiler-nix-name
++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint")
++ pkgs.lib.optional withIOG
(with pkgs.pkgsBuildBuild; [ cddl cbor-diag ]
++ map pkgs.lib.getDev (with pkgs; [
libblst libsodium-vrf secp256k1 #R_4_1_3
libblst libsodium-vrf secp256k1
]))
;
})
12 changes: 7 additions & 5 deletions dynamic.nix
Expand Up @@ -95,21 +95,23 @@ pkgs.mkShell {
++ pkgs.lib.optional pkgs.stdenv.hostPlatform.isLinux systemd
)
++ pkgs.lib.optional (withHLS && (compiler-not-in (
pkgs.lib.optional (builtins.compareVersions compiler.version "9.9" >= 0) compiler-nix-name
pkgs.lib.optional (builtins.compareVersions compiler.version "9.7" >= 0) compiler-nix-name
++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in (
pkgs.lib.optional (builtins.compareVersions compiler.version "9.8" >= 0) compiler-nix-name
pkgs.lib.optional (builtins.compareVersions compiler.version "9.10" >= 0) compiler-nix-name
++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint")
++ pkgs.lib.optional withIOG
(with pkgs; [
cddl
cbor-diag
#R_4_1_3 # for plutus
#postgresql # for db-sync
gh
jq
yq-go
]
++ map pkgs.lib.getDev (with pkgs; [ libblst libsodium-vrf secp256k1 icu ] ++ pkgs.lib.optional (withIOGFull) [ R_4_1_3 postgresql ]))
++ map pkgs.lib.getDev (with pkgs; [ libblst libsodium-vrf secp256k1 icu ]
++ pkgs.lib.optional (withIOGFull) [
(if pkgs.stdenv.hostPlatform.isAarch64 then null else R) # for plutus; R is broken on aarch64
postgresql # for db-sync
]))
;
}
141 changes: 97 additions & 44 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 10 additions & 14 deletions flake.nix
Expand Up @@ -32,19 +32,8 @@
'';
postFixup = "";
});
});
# the haskell inline-r package depends on internals of the R
# project that have been hidden in R 4.2+. See
# https://github.com/tweag/HaskellR/issues/374
oldR = (final: prev: {
R_4_1_3 = final.R.overrideDerivation (old: rec {
version = "4.1.3";
patches = []; # upstream patches will most likely break this build, as they are specific to a different version.
src = final.fetchurl {
url = "https://cran.r-project.org/src/base/R-${final.lib.versions.major version}/${old.pname}-${version}.tar.gz";
sha256 = "sha256-Ff9bMzxhCUBgsqUunB2OxVzELdAp45yiKr2qkJUm/tY="; };
});
});

cddl-tools = (final: prev: {
cbor-diag = final.callPackage ./pkgs/cbor-diag { };
cddl = final.callPackage ./pkgs/cddl { };
Expand Down Expand Up @@ -86,8 +75,7 @@
"ghc92"
"ghc94"
"ghc96"
"ghc98"
"ghc99"] (short-name: rec {
"ghc98"] (short-name: rec {
inherit pkgs self toolsModule;
compiler-nix-name = pkgs.haskell-nix.resolve-compiler-name short-name;
compiler = pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name};
Expand Down Expand Up @@ -154,10 +142,18 @@
pkgs.lib.nameValuePair "${short-name}-static-iog" (
import ./static.nix (args // { withIOG = true; })
)) (compilers static-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static-iog-full" (
import ./static.nix (args // { withIOG = true; withIOGFull = true;})
)) (compilers static-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static-minimal-iog" (
import ./static.nix (args // { withHLS = false; withHlint = false; withIOG = true; })
)) (compilers static-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static-minimal-iog-full" (
import ./static.nix (args // { withHLS = false; withHlint = false; withIOG = true; withIOGFull = true; })
)) (compilers static-pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-js-iog" (
import ./cross-js.nix (args // { pkgs = js-pkgs.buildPackages; withIOG = true; })
Expand Down

0 comments on commit c79eecf

Please sign in to comment.