diff --git a/nix-tools-static-for-default-setup.nix b/nix-tools-static-for-default-setup.nix index 2eb4488c21..56bd0e6d3f 100644 --- a/nix-tools-static-for-default-setup.nix +++ b/nix-tools-static-for-default-setup.nix @@ -1,22 +1,22 @@ -pkgs: let baseurl = "https://github.com/input-output-hk/haskell.nix/releases/download/nix-tools-0.2.1/"; in { +pkgs: let baseurl = "https://github.com/input-output-hk/haskell.nix/releases/download/nix-tools-0.3.8/"; in { aarch64-darwin = pkgs.fetchurl { name = "aarch64-darwin-nix-tools-static"; url = "${baseurl}aarch64-darwin-nix-tools-static.zip"; - sha256 = "sha256-/N2CiakRQHIjLtBbdYfkDyhlHFss9ezWc9WW+HIUOwc="; + sha256 = "sha256-v3lxSxCDjQWtCSwx9T5lzcufByvFErKGLm8374KYsOs="; }; x86_64-darwin = pkgs.fetchurl { name = "x86_64-darwin-nix-tools-static"; url = "${baseurl}x86_64-darwin-nix-tools-static.zip"; - sha256 = "sha256-1Xbxhw7LR6EooiagmRrHg7+UdxddD0RaKjvM75hwsJo="; + sha256 = "sha256-Ltze09JIiUpMuy+jfoSghejmZ3L4NCpgr32LyX5bckU="; }; aarch64-linux = pkgs.fetchurl { name = "aarch64-linux-nix-tools-static"; url = "${baseurl}aarch64-linux-nix-tools-static.zip"; - sha256 = "sha256-1OarDAiwYbet6ol3q2dZdnsWMHcniK4zznbGiDPMrO4="; + sha256 = "sha256-bpjuragBvzuki4CVleXyqTrQfRJshdoTeD3v6xl9sio="; }; x86_64-linux = pkgs.fetchurl { name = "x86_64-linux-nix-tools-static"; url = "${baseurl}x86_64-linux-nix-tools-static.zip"; - sha256 = "sha256-7xckkH+T9uu3fhtTOzqHZ1udNvPJAgkcrvDXEF16qJQ="; + sha256 = "sha256-aZOmrhp+AdCXcBaNVAeJHDobBaGzJDvEhY90mWjGadc="; }; } diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index 13ee8670ec..1c5593f717 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -335,6 +335,8 @@ in { # Fix for `fatal error: 'rts/Types.h' file not found` when building `primitive` ++ onGhcjs (from "9.13" ./patches/ghc/ghc-9.13-ghcjs-rts-types.patch) + + ++ onGhcjs (fromUntil "9.6.7" "9.7" ./patches/ghc/ghc-9.6-js-support-this-unit-id-10819.patch) ; in ({ ghc8107 = traceWarnOld "8.10" (final.callPackage ../compiler/ghc { diff --git a/overlays/default.nix b/overlays/default.nix index bb5a18f655..6231016540 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -45,6 +45,10 @@ let tarball // { exes = final.lib.genAttrs nix-tools-provided-exes (_: tarball); }; static-nix-tools = static-nix-tools' ../nix-tools-static.nix; + # Any change to default-setup requires rebuilding everthing. + # Having a dedicated file for `default-setup` allows us to update + # the other `nix-tools` (like `make-install-plan`), without a + # full rebuild. static-nix-tools-for-default-setup = static-nix-tools' ../nix-tools-static-for-default-setup.nix; # Version of nix-tools built with a pinned version of haskell.nix. diff --git a/overlays/patches/ghc/ghc-9.6-js-support-this-unit-id-10819.patch b/overlays/patches/ghc/ghc-9.6-js-support-this-unit-id-10819.patch new file mode 100644 index 0000000000..15f152eda5 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.6-js-support-this-unit-id-10819.patch @@ -0,0 +1,36 @@ +From 168af9c24581bb550e6f352ebb3dd86c8784cea9 Mon Sep 17 00:00:00 2001 +From: Sylvain Henry +Date: Thu, 6 Jul 2023 15:59:38 +0200 +Subject: [PATCH] JS: support -this-unit-id for programs in the linker (#23613) + +--- + compiler/GHC/StgToJS/Linker/Linker.hs | 2 +- + testsuite/tests/driver/T23613.hs | 4 ++++ + testsuite/tests/driver/all.T | 7 ++++--- + 3 files changed, 9 insertions(+), 4 deletions(-) + create mode 100644 testsuite/tests/driver/T23613.hs + +diff --git a/compiler/GHC/StgToJS/Linker/Linker.hs b/compiler/GHC/StgToJS/Linker/Linker.hs +index 58bcdf2de90..530f8730c6b 100644 +--- a/compiler/GHC/StgToJS/Linker/Linker.hs ++++ b/compiler/GHC/StgToJS/Linker/Linker.hs +@@ -327,7 +327,7 @@ computeLinkDependencies cfg unit_env link_spec finder_opts finder_cache = do + let (rts_wired_units, rts_wired_functions) = rtsDeps units + + -- all the units we want to link together, without their dependencies +- let root_units = filter (/= mainUnitId) ++ let root_units = filter (/= ue_currentUnit unit_env) + $ filter (/= interactiveUnitId) + $ nub + $ rts_wired_units ++ reverse obj_units ++ reverse units +diff --git a/testsuite/tests/driver/T23613.hs b/testsuite/tests/driver/T23613.hs +new file mode 100644 +index 00000000000..d82a4bd93b7 +--- /dev/null ++++ b/testsuite/tests/driver/T23613.hs +@@ -0,0 +1,4 @@ ++module Main where ++ ++main :: IO () ++main = return () + diff --git a/test/sublib-docs/default.nix b/test/sublib-docs/default.nix index 640141f8fd..d4be0d81ee 100644 --- a/test/sublib-docs/default.nix +++ b/test/sublib-docs/default.nix @@ -43,7 +43,7 @@ in recurseIntoAttrs { printf "check that it looks like we have docs..." >& 2 test -f "${packages.sublib-docs.components.library.doc}/share/doc/sublib-docs/html/Lib.html" - test -f "${packages.sublib-docs.components.sublibs.slib.doc}/share/doc/sublib-docs/html/Slib.html" + test -f "${packages.sublib-docs.components.sublibs.slib.doc}/share/doc/sublib-docs/html/slib/Slib.html" touch $out '';