diff --git a/cross-windows.nix b/cross-windows.nix index 656c391..4d22647 100644 --- a/cross-windows.nix +++ b/cross-windows.nix @@ -4,7 +4,12 @@ let tool-version-map = import ./tool-map.nix; cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal; # add a trace helper. This will trace a message about disabling a component despite requesting it, if it's not supported in that compiler. compiler-not-in = compiler-list: name: (if __elem compiler-nix-name compiler-list then __trace "No ${name}. Not yet compatible with ${compiler-nix-name}" false else true); - + # Exclude zstd support for now, since it's currently broken on mingw32W64: + # https://github.com/NixOS/nixpkgs/issues/333338 + curl = pkgs.curl.override ({ + zstdSupport = false; + pslSupport = false; + }); inherit (pkgs.haskell-nix.iserv-proxy-exes.${compiler-nix-name}) iserv-proxy iserv-proxy-interpreter; dllPkgs = [ @@ -56,7 +61,7 @@ let tool-version-map = import ./tool-map.nix; # A cabal-install wrapper that sets the appropriate static flags wrapped-cabal = pkgs.pkgsBuildBuild.writeShellApplication { name = "cabal"; - runtimeInputs = [ cabal-install pkgs.curl ]; + runtimeInputs = [ cabal-install curl ]; text = '' # We do not want to quote NIX_CABAL_FLAGS # it will leave an empty argument, if they are empty. diff --git a/flake.lock b/flake.lock index dd7d8af..0d9a17b 100644 --- a/flake.lock +++ b/flake.lock @@ -122,11 +122,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -152,51 +152,14 @@ "type": "github" } }, - "ghc910X": { - "flake": false, - "locked": { - "lastModified": 1714520650, - "narHash": "sha256-4uz6RA1hRr0RheGNDM49a/B3jszqNNU8iHIow4mSyso=", - "ref": "ghc-9.10", - "rev": "2c6375b9a804ac7fca1e82eb6fcfc8594c67c5f5", - "revCount": 62663, - "submodules": true, - "type": "git", - "url": "https://gitlab.haskell.org/ghc/ghc" - }, - "original": { - "ref": "ghc-9.10", - "submodules": true, - "type": "git", - "url": "https://gitlab.haskell.org/ghc/ghc" - } - }, - "ghc911": { - "flake": false, - "locked": { - "lastModified": 1714817013, - "narHash": "sha256-m2je4UvWfkgepMeUIiXHMwE6W+iVfUY38VDGkMzjCcc=", - "ref": "refs/heads/master", - "rev": "fc24c5cf6c62ca9e3c8d236656e139676df65034", - "revCount": 62816, - "submodules": true, - "type": "git", - "url": "https://gitlab.haskell.org/ghc/ghc" - }, - "original": { - "submodules": true, - "type": "git", - "url": "https://gitlab.haskell.org/ghc/ghc" - } - }, "hackage": { "flake": false, "locked": { - "lastModified": 1717807055, - "narHash": "sha256-CCqRhadPKQUkB/ncLBGHHt7XT8VbSR532sfpjbPNcZI=", + "lastModified": 1728865757, + "narHash": "sha256-DzxFSTuiXPEDB59v4sS0K57UhR70cxYtj8F52y9Mi4k=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "edb78b8087db9d494ee3eeb9105c7650e44d009f", + "rev": "8f2ba6cde8ee8f8eac0593284c3465e39c51a50a", "type": "github" }, "original": { @@ -214,8 +177,6 @@ "cardano-shell": "cardano-shell", "flake-compat": "flake-compat", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", - "ghc910X": "ghc910X", - "ghc911": "ghc911", "hackage": "hackage", "hls-1.10": "hls-1.10", "hls-2.0": "hls-2.0", @@ -226,6 +187,7 @@ "hls-2.6": "hls-2.6", "hls-2.7": "hls-2.7", "hls-2.8": "hls-2.8", + "hls-2.9": "hls-2.9", "hpc-coveralls": "hpc-coveralls", "hydra": "hydra", "iserv-proxy": "iserv-proxy", @@ -240,16 +202,17 @@ "nixpkgs-2211": "nixpkgs-2211", "nixpkgs-2305": "nixpkgs-2305", "nixpkgs-2311": "nixpkgs-2311", + "nixpkgs-2405": "nixpkgs-2405", "nixpkgs-unstable": "nixpkgs-unstable", "old-ghc-nix": "old-ghc-nix", "stackage": "stackage" }, "locked": { - "lastModified": 1717846179, - "narHash": "sha256-iSGepzdSLyvYafn+OvXCGN50ZsWQiGcJIKq4s+sg4nY=", + "lastModified": 1728867069, + "narHash": "sha256-acQ+3ZTHDKhujhiaCmKJstJlJsRaFgglP3W5FFvZjy8=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "8f50d10aa7ce71f2dcb6c8eb25c2352294ddc854", + "rev": "5de65a1fb68cae2a7503eac9f1c314568227d764", "type": "github" }, "original": { @@ -411,6 +374,23 @@ "type": "github" } }, + "hls-2.9": { + "flake": false, + "locked": { + "lastModified": 1720003792, + "narHash": "sha256-qnDx8Pk0UxtoPr7BimEsAZh9g2WuTuMB/kGqnmdryKs=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "0c1817cb2babef0765e4e72dd297c013e8e3d12b", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.9.0.1", + "repo": "haskell-language-server", + "type": "github" + } + }, "hpc-coveralls": { "flake": false, "locked": { @@ -458,11 +438,11 @@ "sodium": "sodium" }, "locked": { - "lastModified": 1715898223, - "narHash": "sha256-G1LFsvP53twrqaC1FVard/6rjJJ3oitnpJ1E+mTZDGM=", + "lastModified": 1728687575, + "narHash": "sha256-38uD8SqT557eh5yyRYuthKm1yTtiWzAN0FH7L/01QKM=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "29f19cd41dc593cf17bbc24194e34e7c20889fc9", + "rev": "86c2bd46e8a08f62ea38ffe77cb4e9c337b42217", "type": "github" }, "original": { @@ -623,11 +603,11 @@ }, "nixpkgs-2305": { "locked": { - "lastModified": 1701362232, - "narHash": "sha256-GVdzxL0lhEadqs3hfRLuj+L1OJFGiL/L7gCcelgBlsw=", + "lastModified": 1705033721, + "narHash": "sha256-K5eJHmL1/kev6WuqyqqbS1cdNnSidIZ3jeqJ7GbrYnQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d2332963662edffacfddfad59ff4f709dde80ffe", + "rev": "a1982c92d8980a0114372973cbdfe0a307f1bdea", "type": "github" }, "original": { @@ -639,11 +619,11 @@ }, "nixpkgs-2311": { "locked": { - "lastModified": 1701386440, - "narHash": "sha256-xI0uQ9E7JbmEy/v8kR9ZQan6389rHug+zOtZeZFiDJk=", + "lastModified": 1719957072, + "narHash": "sha256-gvFhEf5nszouwLAkT9nWsDzocUTqLWHuL++dvNjMp9I=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "293822e55ec1872f715a66d0eda9e592dc14419f", + "rev": "7144d6241f02d171d25fba3edeaf15e0f2592105", "type": "github" }, "original": { @@ -653,6 +633,22 @@ "type": "github" } }, + "nixpkgs-2405": { + "locked": { + "lastModified": 1726447378, + "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-24.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-regression": { "locked": { "lastModified": 1643052045, @@ -671,17 +667,17 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1694822471, - "narHash": "sha256-6fSDCj++lZVMZlyqOe9SIOL8tYSBz1bI8acwovRwoX8=", + "lastModified": 1726583932, + "narHash": "sha256-zACxiQx8knB3F8+Ze+1BpiYrI+CbhxyWpcSID9kVhkQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", + "rev": "658e7223191d2598641d50ee4e898126768fe847", "type": "github" }, "original": { "owner": "NixOS", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", - "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", "type": "github" } }, @@ -766,11 +762,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1717806268, - "narHash": "sha256-QUGjB0OLnmXrS+u4jCdvawfWfngv+R99qmbFvpRaW4I=", + "lastModified": 1728691846, + "narHash": "sha256-WXPaGfa8D64YjKU31HOIx2cLfYkMfZT9yYO2XdYUerA=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "6c6db491b4a4aab289fe0a5ada8bb9bfb842b23c", + "rev": "38e3ccb33364353514117c552b7362295ea5b02e", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 5cd7149..d349d02 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,30 @@ cbor-diag = final.callPackage ./pkgs/cbor-diag { }; cddl = final.callPackage ./pkgs/cddl { }; }); + + musl = (final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl { + # Fix the following Ruby cross build error: + # + # error: output '/nix/store/6hyyk9wnnxpd5rsr6ivc0s8l1lgvsjrb-ruby-x86_64-unknown-linux-musl-3.3.4' + # is not allowed to refer to the following paths: + # /nix/store/c77wdd4fb0llq37bpmfr73m7s7r1j068-ruby-3.3.4 + # + # See https://github.com/NixOS/nixpkgs/issues/347758 + ruby = prev.ruby.overrideAttrs (old: { + postInstall = old.postInstall + '' + find $out/${old.passthru.gemPath} -name exts.mk -delete + ''; + }); + + # Tests on static postgresql are failing with: + # + # FATAL: could not load library "/build/postgresql-16.4/.../lib/dict_snowball.so": + # Error relocating /build/postgresql-16.4/tmp_install/nix/store/.../lib/dict_snowball.so: + # pg_any_to_server: symbol not found + postgresql = prev.postgresql.overrideAttrs (_: { + doCheck = false; + }); + }); }; supportedSystems = [ "x86_64-linux" @@ -187,12 +211,15 @@ } "touch $out"; } // (pkgs.lib.mapAttrs' (name: drv: pkgs.lib.nameValuePair "${name}-env" ( + # We need to use unsafeDiscardOutputDependency here, as it will otherwise + # pull in a bunch of dependenceis we don't care about at all from the .drvPath + # query. let env = pkgs.runCommand "${name}-env.sh" { requiredSystemFeatures = [ "recursive-nix" ]; nativeBuildInputs = [ pkgs.nix ]; } '' nix --offline --extra-experimental-features "nix-command flakes" \ - print-dev-env ${drv.drvPath} >> $out + print-dev-env '${builtins.unsafeDiscardOutputDependency drv.drvPath}^*' >> $out ''; # this needs to be linux. It would be great if we could have this # eval platform agnostic, but flakes don't permit this. A the @@ -221,7 +248,7 @@ license = pkgs.lib.licenses.asl20; platforms = pkgs.lib.platforms.unix; }; - })) devShellsWithEvalOnLinux) // { + })) devShells) // { }; packages.cabalProjectLocal.static = (import ./quirks.nix { pkgs = static-pkgs; static = true; }).template; packages.cabalProjectLocal.cross-js = (import ./quirks.nix { pkgs = js-pkgs; }).template; diff --git a/tool-map.nix b/tool-map.nix index ad52a18..efe43ff 100644 --- a/tool-map.nix +++ b/tool-map.nix @@ -37,19 +37,11 @@ compiler-nix-name: tool: { # Use the github source of HLS that is tested with haskell.nix CI src = { "ghc8107" = pkgs.haskell-nix.sources."hls-2.2"; "ghc902" = pkgs.haskell-nix.sources."hls-2.4"; - }.${compiler-nix-name} or pkgs.haskell-nix.sources."hls-2.6"; + }.${compiler-nix-name} or pkgs.haskell-nix.sources."hls-2.9"; # `tool` normally ignores the `cabal.project` (if there is one in the hackage source). # We need to use the github one (since it has settings to make hls build). cabalProject = __readFile (src + "/cabal.project"); configureArgs = "--disable-benchmarks --disable-tests"; - modules = [{ - packages.ghcide.patches = - (if compiler-nix-name != "ghc8107" && compiler-nix-name != "ghc902" then [ - # The following patch only works with hls-2.6 ... - # https://github.com/haskell/haskell-language-server/issues/4046#issuecomment-1926242056 - ./extra/ghcide-workaround.diff - ] else []); - }]; }; happy = { version = "1.20.1.1"; inherit cabalProjectLocal; }; alex = { version = "3.2.7.3"; inherit cabalProjectLocal; };