Skip to content

Commit 4b2a8d5

Browse files
authored
Update Default Setup (#2402)
* Update Default Setup * Add comment * Update sublib-docs test * Fix GHC 9.6.7 --this-unit-id problem for GHCJS cross compiles
1 parent 68cca80 commit 4b2a8d5

File tree

5 files changed

+48
-6
lines changed

5 files changed

+48
-6
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
pkgs: let baseurl = "https://github.com/input-output-hk/haskell.nix/releases/download/nix-tools-0.2.1/"; in {
1+
pkgs: let baseurl = "https://github.com/input-output-hk/haskell.nix/releases/download/nix-tools-0.3.8/"; in {
22
aarch64-darwin = pkgs.fetchurl {
33
name = "aarch64-darwin-nix-tools-static";
44
url = "${baseurl}aarch64-darwin-nix-tools-static.zip";
5-
sha256 = "sha256-/N2CiakRQHIjLtBbdYfkDyhlHFss9ezWc9WW+HIUOwc=";
5+
sha256 = "sha256-v3lxSxCDjQWtCSwx9T5lzcufByvFErKGLm8374KYsOs=";
66
};
77
x86_64-darwin = pkgs.fetchurl {
88
name = "x86_64-darwin-nix-tools-static";
99
url = "${baseurl}x86_64-darwin-nix-tools-static.zip";
10-
sha256 = "sha256-1Xbxhw7LR6EooiagmRrHg7+UdxddD0RaKjvM75hwsJo=";
10+
sha256 = "sha256-Ltze09JIiUpMuy+jfoSghejmZ3L4NCpgr32LyX5bckU=";
1111
};
1212
aarch64-linux = pkgs.fetchurl {
1313
name = "aarch64-linux-nix-tools-static";
1414
url = "${baseurl}aarch64-linux-nix-tools-static.zip";
15-
sha256 = "sha256-1OarDAiwYbet6ol3q2dZdnsWMHcniK4zznbGiDPMrO4=";
15+
sha256 = "sha256-bpjuragBvzuki4CVleXyqTrQfRJshdoTeD3v6xl9sio=";
1616
};
1717
x86_64-linux = pkgs.fetchurl {
1818
name = "x86_64-linux-nix-tools-static";
1919
url = "${baseurl}x86_64-linux-nix-tools-static.zip";
20-
sha256 = "sha256-7xckkH+T9uu3fhtTOzqHZ1udNvPJAgkcrvDXEF16qJQ=";
20+
sha256 = "sha256-aZOmrhp+AdCXcBaNVAeJHDobBaGzJDvEhY90mWjGadc=";
2121
};
2222
}

overlays/bootstrap.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ in {
335335

336336
# Fix for `fatal error: 'rts/Types.h' file not found` when building `primitive`
337337
++ onGhcjs (from "9.13" ./patches/ghc/ghc-9.13-ghcjs-rts-types.patch)
338+
339+
++ onGhcjs (fromUntil "9.6.7" "9.7" ./patches/ghc/ghc-9.6-js-support-this-unit-id-10819.patch)
338340
;
339341
in ({
340342
ghc8107 = traceWarnOld "8.10" (final.callPackage ../compiler/ghc {

overlays/default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ let
4545
tarball // { exes = final.lib.genAttrs nix-tools-provided-exes (_: tarball); };
4646

4747
static-nix-tools = static-nix-tools' ../nix-tools-static.nix;
48+
# Any change to default-setup requires rebuilding everthing.
49+
# Having a dedicated file for `default-setup` allows us to update
50+
# the other `nix-tools` (like `make-install-plan`), without a
51+
# full rebuild.
4852
static-nix-tools-for-default-setup = static-nix-tools' ../nix-tools-static-for-default-setup.nix;
4953

5054
# Version of nix-tools built with a pinned version of haskell.nix.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 168af9c24581bb550e6f352ebb3dd86c8784cea9 Mon Sep 17 00:00:00 2001
2+
From: Sylvain Henry <[email protected]>
3+
Date: Thu, 6 Jul 2023 15:59:38 +0200
4+
Subject: [PATCH] JS: support -this-unit-id for programs in the linker (#23613)
5+
6+
---
7+
compiler/GHC/StgToJS/Linker/Linker.hs | 2 +-
8+
testsuite/tests/driver/T23613.hs | 4 ++++
9+
testsuite/tests/driver/all.T | 7 ++++---
10+
3 files changed, 9 insertions(+), 4 deletions(-)
11+
create mode 100644 testsuite/tests/driver/T23613.hs
12+
13+
diff --git a/compiler/GHC/StgToJS/Linker/Linker.hs b/compiler/GHC/StgToJS/Linker/Linker.hs
14+
index 58bcdf2de90..530f8730c6b 100644
15+
--- a/compiler/GHC/StgToJS/Linker/Linker.hs
16+
+++ b/compiler/GHC/StgToJS/Linker/Linker.hs
17+
@@ -327,7 +327,7 @@ computeLinkDependencies cfg unit_env link_spec finder_opts finder_cache = do
18+
let (rts_wired_units, rts_wired_functions) = rtsDeps units
19+
20+
-- all the units we want to link together, without their dependencies
21+
- let root_units = filter (/= mainUnitId)
22+
+ let root_units = filter (/= ue_currentUnit unit_env)
23+
$ filter (/= interactiveUnitId)
24+
$ nub
25+
$ rts_wired_units ++ reverse obj_units ++ reverse units
26+
diff --git a/testsuite/tests/driver/T23613.hs b/testsuite/tests/driver/T23613.hs
27+
new file mode 100644
28+
index 00000000000..d82a4bd93b7
29+
--- /dev/null
30+
+++ b/testsuite/tests/driver/T23613.hs
31+
@@ -0,0 +1,4 @@
32+
+module Main where
33+
+
34+
+main :: IO ()
35+
+main = return ()
36+

test/sublib-docs/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ in recurseIntoAttrs {
4343
4444
printf "check that it looks like we have docs..." >& 2
4545
test -f "${packages.sublib-docs.components.library.doc}/share/doc/sublib-docs/html/Lib.html"
46-
test -f "${packages.sublib-docs.components.sublibs.slib.doc}/share/doc/sublib-docs/html/Slib.html"
46+
test -f "${packages.sublib-docs.components.sublibs.slib.doc}/share/doc/sublib-docs/html/slib/Slib.html"
4747
4848
touch $out
4949
'';

0 commit comments

Comments
 (0)