Skip to content

Update nixpkgs pins #2156

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

Merged
merged 196 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
393293a
Update nixpkgs pins
hamishmack Feb 3, 2024
92288a7
Remove sphinx override
hamishmack Feb 7, 2024
5d94a90
Boot with ghc 8.10.7
hamishmack Feb 7, 2024
56b38ec
Patch code in case we decide to run sphinx doc generation
hamishmack Feb 7, 2024
fad197b
Bump nixpkgs pins again
hamishmack Feb 7, 2024
7c96a94
Remove reference to old pkg
hamishmack Feb 7, 2024
1402b84
Bump pinned haskellNix in nix-tools subdir
hamishmack Feb 7, 2024
7f98399
Remove sphinx dependency and don't build docs for old GHCs
hamishmack Feb 7, 2024
b5871a9
Add materialized files
hamishmack Feb 7, 2024
6d2ecea
Remove broken assert
hamishmack Feb 7, 2024
0ffc199
ifdLevel 1
hamishmack Feb 7, 2024
a4b3ae7
Fix patch
hamishmack Feb 7, 2024
43709b5
ifdLevel 0
hamishmack Feb 7, 2024
130497c
ifdLevel 1
hamishmack Feb 7, 2024
eac4a55
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Feb 8, 2024
8da9453
ifdLevel 0
hamishmack Feb 8, 2024
df1f0ea
bump pins (including ghc99)
hamishmack Feb 10, 2024
86a8472
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Feb 10, 2024
679f09e
Fix disabling docs
hamishmack Feb 10, 2024
b3da2ae
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Feb 11, 2024
f77b1f7
ifdLevel 1
hamishmack Feb 12, 2024
e97780e
Try building ghc 9.2.8 with 9.2.8
hamishmack Feb 12, 2024
72b5e60
ifdLevel 0
hamishmack Feb 12, 2024
d4be16d
Try ghc902 to boot native ghc928
hamishmack Feb 12, 2024
8d051f4
Try haskell.nix ghc902 to boot native ghc928
hamishmack Feb 12, 2024
cde42db
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Feb 14, 2024
7dd05cb
ifdLevel 1
hamishmack Feb 14, 2024
6eb8d87
Stick with haskell.nix ghc 8.10.7 for building 9.2.8
hamishmack Feb 14, 2024
bf74d61
Bump ghc99
hamishmack Feb 14, 2024
2e53c72
Fix hash for linux
hamishmack Feb 14, 2024
2fb4ac3
Use ghc 9.6.4 to build git ghc commits
hamishmack Feb 14, 2024
44edaa8
Disable ghc-iserv-prof for ghc HEAD for now
hamishmack Feb 14, 2024
4801cee
Fix logic
hamishmack Feb 14, 2024
e41ac87
ifdLevel 2
hamishmack Feb 15, 2024
4c67ab2
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Feb 25, 2024
441e22c
Bump pins
hamishmack Feb 25, 2024
25bad1a
Fix for libsodium 1.0.19
hamishmack Feb 25, 2024
bac2ac5
Fix hash
hamishmack Feb 25, 2024
47e030d
ifdLevel 1
hamishmack Feb 25, 2024
ec488d8
ifdLevel 2
hamishmack Feb 25, 2024
c48497f
ifdLevel 3
hamishmack Feb 25, 2024
ad6263d
Bump iserv-proxy
hamishmack Feb 25, 2024
e7e815d
Let's try using it directly.
angerman Nov 29, 2023
f16c672
Add os-string package for ghc head
hamishmack Feb 26, 2024
2d10ee1
Fix winePackage.minimal
hamishmack Feb 26, 2024
8fbb35f
Update hackage-head
hamishmack Feb 26, 2024
10ce7fc
Disable plugin test for ghc head
hamishmack Feb 26, 2024
b14df42
Fix for emscripten in nixpkgs-unstable
hamishmack Feb 26, 2024
4d963ee
Fix for ghc 9.8.1
hamishmack Feb 26, 2024
87f01b2
Keep haddock but not sphinx docs
hamishmack Feb 26, 2024
b8312de
ifdLevel 0
hamishmack Feb 26, 2024
3382eab
ifdLevel 1
hamishmack Feb 26, 2024
cca7f1f
Fix for musl
hamishmack Feb 27, 2024
5a7fa23
ifdLevel 2
hamishmack Feb 27, 2024
13c0f58
ifdLevel 0
hamishmack Feb 27, 2024
be17603
ifdLevel 1
hamishmack Feb 27, 2024
dcb0f5e
ifdLevel 2
hamishmack Feb 27, 2024
768b298
ifdLevel 3
hamishmack Feb 28, 2024
9b8207d
Update hackage head
hamishmack Feb 28, 2024
da12e7f
Fix for ghc head
hamishmack Feb 28, 2024
5ce18d0
Better fix for `os-string`
hamishmack Feb 29, 2024
efb0e30
Workaround for https://github.com/haskell/cabal/issues/5444
hamishmack Feb 29, 2024
9e9c0a8
Conditional source-repository-package support
hamishmack Mar 1, 2024
996f79e
Add missing \n
hamishmack Mar 2, 2024
b036650
Avoid libsodium on ghcjs and update hackage head
hamishmack Mar 2, 2024
db3ef95
Updte head.hackage sha256
hamishmack Mar 3, 2024
cb91f3d
Updte head.hackage sha256
hamishmack Mar 3, 2024
a89252d
Fix code coverage for ghc HEAD
hamishmack Mar 4, 2024
9568cd5
Fix code coverage for ghc HEAD
hamishmack Mar 4, 2024
a723c75
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Mar 4, 2024
155adfa
Fix code coverage for ghc HEAD
hamishmack Mar 4, 2024
f4e23a5
Updte head.hackage sha256
hamishmack Mar 5, 2024
ace89d9
Fixes for latest ghc 9.9
hamishmack Mar 5, 2024
beb1ab5
ifdLevel 0
hamishmack Mar 5, 2024
9553926
Bump ghc99 pin
hamishmack Mar 5, 2024
f008b9a
ifdLevel 1
hamishmack Mar 5, 2024
f92cb16
ifdLevel 2
hamishmack Mar 5, 2024
4fb329c
ifdLevel 3
hamishmack Mar 5, 2024
0c5033a
Fix paths
hamishmack Mar 5, 2024
b5bfdac
ifdLevel 1
hamishmack Mar 5, 2024
b80eaa2
Fix paths
hamishmack Mar 5, 2024
670dc85
ifdLevel 2
hamishmack Mar 5, 2024
e1276c8
ifdLevel 3
hamishmack Mar 5, 2024
82a2c7f
Fix for ghc 8.10
hamishmack Mar 6, 2024
dd6360d
Exclude plugin test
hamishmack Mar 6, 2024
b44465e
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Mar 17, 2024
60cfcfe
ifdLevel 0
hamishmack Mar 17, 2024
65e6c43
ifdLevel 1
hamishmack Mar 17, 2024
4ff5abc
ifdLevel 2
hamishmack Mar 17, 2024
8782e4b
ifdLevel 3
hamishmack Mar 17, 2024
95e49b6
Remove patch replaced by ghc source patch
hamishmack Mar 17, 2024
c66cbd3
Always build mingwW64
angerman Mar 23, 2024
95a4a74
Drop bad hack
angerman Mar 23, 2024
52d807d
Try to fix windows ASLR.
angerman Mar 24, 2024
365d39b
Merge branch 'master' into hkm/nixpkgs-update
angerman Apr 5, 2024
7a3a9ff
Update pkgconf-nixpkgs-map.nix
angerman Apr 5, 2024
e7fec91
Fixup throw catch
angerman Apr 5, 2024
969b300
Add back in libsodium.
angerman Apr 5, 2024
d59efcb
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
angerman Apr 8, 2024
c9b9ab5
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
angerman Apr 9, 2024
d9dc867
[win] fix Error: CFI instruction used without previous .cfi_startproc
angerman Apr 9, 2024
0cca66e
Fixup windows relocs
angerman Apr 13, 2024
b864fe0
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
angerman Apr 13, 2024
60a8c4e
Fix spelling mistake
angerman Apr 13, 2024
36565bc
Update lock files
angerman Apr 13, 2024
a951839
Add BUGLOG
angerman Apr 13, 2024
c1b966c
Bump LLVM. There is no 9 left in nixpkgs.
angerman Apr 13, 2024
4d2710e
ifdLevel 1
angerman Apr 14, 2024
f5a8eb3
Make libcxxabi mapping work across multiple nixpkgs
angerman Apr 14, 2024
987ae45
fix if
angerman Apr 14, 2024
40a6da8
fix parens
angerman Apr 15, 2024
448ca1b
ifdLevel 2
angerman Apr 15, 2024
6239a5b
ifdLevel 3
angerman Apr 15, 2024
15ade65
head.hackage still needed for text-short
hamishmack Apr 15, 2024
2340b3c
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Apr 15, 2024
531a9e5
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Apr 15, 2024
5e82728
disable c++ as one breaking issue
angerman Apr 16, 2024
9b8ec56
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack May 15, 2024
47fa8ea
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack May 17, 2024
d667a88
ifdLevel 1
hamishmack May 17, 2024
839db49
ifdLevel 2
hamishmack May 20, 2024
973d748
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack May 23, 2024
7b4e8cc
Use nixpkgs ghc964 to build hadrian when possible
hamishmack May 24, 2024
738b031
Update hadrian materialization
hamishmack May 24, 2024
7e50b15
ifdLevel 3
hamishmack May 24, 2024
14c2abb
Update pins
hamishmack May 24, 2024
c662677
ifdLevel 2
hamishmack May 24, 2024
8fcbd4d
ifdLevel 0
hamishmack May 24, 2024
0987168
ifdLevel 1
hamishmack May 24, 2024
67a4439
ifdLevel 2
hamishmack May 24, 2024
b351e51
ifdLevel 1
hamishmack May 24, 2024
2fa57da
Fix for new git
hamishmack May 24, 2024
6fd1917
ifdLevel 2
hamishmack May 24, 2024
c75c2da
ifdLevel 3
hamishmack May 25, 2024
89e1f8c
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack May 25, 2024
d8516cc
Use the old nixpkgs-unstable for now
hamishmack May 26, 2024
c297c30
ifdLevel 1
hamishmack May 26, 2024
dad728c
ifdLevel 2
hamishmack May 26, 2024
cc4339e
Remove updated libsodium
hamishmack May 26, 2024
a3e0c17
Use the old nixpkgs pins for now
hamishmack May 27, 2024
49a2b56
ifdLevel 3
hamishmack May 27, 2024
d0e33ae
Put nixpkgs updates back in
hamishmack May 29, 2024
4df8eef
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Jun 4, 2024
16a2598
ifdLevel 0
hamishmack Jun 4, 2024
1aae841
Bump nixpkgs pins
hamishmack Jun 4, 2024
46f5aa5
ifdLevel 1
hamishmack Jun 5, 2024
142ecc1
ifdLevel 2
hamishmack Jun 5, 2024
72ae3a3
Fix for TH test
hamishmack Jun 5, 2024
6d52411
ifdLevel 3
hamishmack Jun 5, 2024
f04507c
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Jun 5, 2024
2c7db01
Use .dll.a file in th-dlls-minimal
hamishmack Jun 12, 2024
db61e2b
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Jun 12, 2024
c7714a9
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Jun 18, 2024
56d2296
Add fix for DLL loading using a `.dll.a` file
hamishmack Jun 18, 2024
903e118
Fix typo
hamishmack Jun 19, 2024
1748a4f
Apply fix to more ghc versions
hamishmack Jun 19, 2024
d7b153f
Patch remaining GHC versions
hamishmack Jun 19, 2024
76c178d
Update BUGLOG
angerman Jun 19, 2024
769b731
Revert "Patch remaining GHC versions"
hamishmack Jun 20, 2024
7e244cb
Update hackage repo hashes in cabal.project.local
hamishmack Jun 20, 2024
49a869f
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Jun 30, 2024
977a984
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Jul 2, 2024
43ea3db
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Jul 4, 2024
f7fc6f4
ifdLevel 1
hamishmack Jul 4, 2024
d5e28de
Bump nixpkgs pins and add 24.05
hamishmack Jul 5, 2024
5198ff3
Pin libsodium to nixpkgs 23.11 version for ci
hamishmack Jul 5, 2024
42a2f00
ifdLevel 2
hamishmack Jul 7, 2024
08b3156
Fix libsodium pin
hamishmack Jul 7, 2024
14dbbef
Pin libsodium for GHA as well
hamishmack Jul 7, 2024
c963671
Update test/default.nix
hamishmack Jul 7, 2024
b901e01
ifdLevel 1
hamishmack Jul 7, 2024
0e5c94e
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Jul 7, 2024
b6c30c2
Only pin libsodium for haskell code in tests
hamishmack Jul 7, 2024
b98ce23
Update nixpkgs-unstable pin
hamishmack Jul 7, 2024
b900af9
ifdLevel 1
hamishmack Jul 7, 2024
628c2d9
ifdLevel 2
hamishmack Jul 7, 2024
7feb3d6
ifdLevel 3
hamishmack Jul 8, 2024
4fd7e26
Fix musl libsodium tests
hamishmack Jul 8, 2024
3ec62f3
Add 9.6 linker to 8.10 windows
angerman Jul 8, 2024
9d01ee1
ifdLevel 0
hamishmack Jul 9, 2024
e3b3084
Disable darwin for now
hamishmack Jul 9, 2024
2234e7e
ifdLevel 1
hamishmack Jul 9, 2024
8451398
ifdLevel 2
hamishmack Jul 9, 2024
b283764
ifdLevel 3
hamishmack Jul 9, 2024
8ee876b
Disable darwin for now
hamishmack Jul 9, 2024
a191d75
Revert "Add 9.6 linker to 8.10 windows"
hamishmack Jul 11, 2024
cbf3ebe
Use stable-haskell/iserv-proxy?ref=iserv-syms for ghc <9.4
hamishmack Jul 11, 2024
0160869
Enable macOS and ifdLevel 0
hamishmack Jul 11, 2024
ed634ee
ifdLevel 1
hamishmack Jul 11, 2024
45b7df8
ifdLevel 2
hamishmack Jul 11, 2024
dc365a2
Disable failing test
hamishmack Jul 11, 2024
ac1db72
ifdLevel 3
hamishmack Jul 11, 2024
7857c32
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
hamishmack Jul 11, 2024
1d484a8
Add macOS back
hamishmack Jul 11, 2024
cfc0aa4
We only need iserv-proxy for cross compilation (so leave it out of na…
hamishmack Jul 12, 2024
e35688d
Add materialized spdx file
hamishmack Jul 12, 2024
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
86 changes: 86 additions & 0 deletions BUGLOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
This file contains bugs we find while working on haskell.nix. The format is as
follow:
<separator: 80 * '-'>
YYYY-MM-DD: nix-job name

<error>

<discussion>

--------------------------------------------------------------------------------
2024-04-09 x86_64-linux.R2305.ghc8107.mingwW64.ghc

/build/ghc62733_0/ghc_1.s:50:0: error:
Error: CFI instruction used without previous .cfi_startproc
|
50 | .cfi_escape 0x16, 0x07, 0x04, 0x77, 152, 65
| ^
`x86_64-w64-mingw32-cc' failed in phase `Assembler'. (Exit code: 1)
make[1]: *** [rts/ghc.mk:325: rts/dist/build/StgCRun.o] Error 1

The source for this is
> https://github.com/ghc/ghc/blob/1f02b7430b2fbab403d7ffdde9cfd006e884678e/rts/StgCRun.c#L433

It appears that GCC C17 12.2.0 does _not_ emit .cfi_startproc / .cfi_endprocs
whereas GCC C17 13.2.0 _does_. Specificall x86_64-w64-mingw32-cc. So this might
be a cross compilation issue.

The -g is hardcoded in
https://github.com/ghc/ghc/blob/1f02b7430b2fbab403d7ffdde9cfd006e884678e/mk/config.mk.in#L361

Turns out, this was disabled for anything but linux in https://github.com/ghc/ghc/commit/5b08e0c06e038448a63aa9bd7f163b23d824ba4b,
hence we backport that patch to GHC-8.10 when targeting windows (to prevent mass rebuilds for
other archs).

--------------------------------------------------------------------------------
2024-04-10 x86_64-linux.R2305.ghc902.mingwW64.ghc

make[1]: *** [utils/hsc2hs/ghc.mk:22: utils/hsc2hs/dist-install/build/tmp/hsc2hs.exe] Error 1
utils/runghc/dist-install/build/Main.o:fake:(.text+0x2a): relocation truncated to fit: R_X86_64_32S against `.text'
utils/runghc/dist-install/build/Main.o:fake:(.text+0x46): relocation truncated to fit: IMAGE_REL_AMD64_ADDR32 against `.data'
utils/runghc/dist-install/build/Main.o:fake:(.text+0x8b): relocation truncated to fit: R_X86_64_32S against symbol `stg_bh_upd_frame_info' defined in .text section in /build/ghc-9.0.2/rts/dist/build/libHSrts.a(Updates.o)
utils/runghc/dist-install/build/Main.o:fake:(.text+0x95): relocation truncated to fit: IMAGE_REL_AMD64_ADDR32 against `.rdata'
utils/runghc/dist-install/build/Main.o:fake:(.text+0xe3): relocation truncated to fit: R_X86_64_32S against symbol `stg_bh_upd_frame_info' defined in .text section in /build/ghc-9.0.2/rts/dist/build/libHSrts.a(Updates.o)
utils/runghc/dist-install/build/Main.o:fake:(.text+0xed): relocation truncated to fit: IMAGE_REL_AMD64_ADDR32 against `.rdata'
utils/runghc/dist-install/build/Main.o:fake:(.text+0x13b): relocation truncated to fit: R_X86_64_32S against symbol `stg_bh_upd_frame_info' defined in .text section in /build/ghc-9.0.2/rts/dist/build/libHSrts.a(Updates.o)
utils/runghc/dist-install/build/Main.o:fake:(.text+0x145): relocation truncated to fit: IMAGE_REL_AMD64_ADDR32 against `.rdata'
utils/runghc/dist-install/build/Main.o:fake:(.text+0x193): relocation truncated to fit: R_X86_64_32S against symbol `stg_bh_upd_frame_info' defined in .text section in /build/ghc-9.0.2/rts/dist/build/libHSrts.a(Updates.o)
utils/runghc/dist-install/build/Main.o:fake:(.text+0x19d): relocation truncated to fit: IMAGE_REL_AMD64_ADDR32 against `.rdata'
utils/runghc/dist-install/build/Main.o:fake:(.text+0x1eb): additional relocation overflows omitted from the output

We notice `fake`, which is GHC failing to provide .file identifier in the source.
We also see lots of R_X64_64_32S relocations, which are signed 32bit relocations.
These fall with ASLR and high entropy base images from later binutils.

The underlying issue is that GHC emits _absolute_ label loads (mov $... reg), instead
of %rpi or other relative loads. This then leads to the linker emitting 32bit
absolute relocation. With the final image being potentially loaded into high memory
(e.g. dynamic base, and the base image being set to some high address), the linker
starts falling over itself, because it simply can't resolve those absolute addresses
in the 32bit slots.

This was fixed in GHC upstream in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7449,
while the patch in haskell.nix is a bit more pedestrian and just sets PIC on windows to
always be on, and then uses the PIC pipeline.

--------------------------------------------------------------------------------
2024-06-18 x86_64-linux.unstable.ghc9101.ucrt64.tests.th-dlls-minimal.build

0024:err:seh:call_stack_handlers invalid frame 00007FFFFF68EF18 (0000000000022000-0000000000220000)
0024:err:seh:NtRaiseException Exception frame is not in stack limits => unable to dispatch exception.
iserv-proxy: {handle: <socket: 11>}: GHCi.Message.remoteCall: end of file

This is due to GHC mislinking GNU import libraries (dll.a). What happens is that
GHC ends up creating GOT entries for function calls instead of PLT entries. The
loader/linker in GHC for Windows has logic to lazy load .dll's as referenced. For
this symbols get a dependency symbol attached, this could be a symbol indicating
the DLL that needs to be loaded. While walking the dependencies to find the dll to
load (or in some cases just the dependent symbol, not the dll), we override the
symbol type with the one of the dependent symbol. This however means we'll
override the type of a symbol with the DATA type each time the symbol leads to a
dllInstance to be loaded. Subsequently we end up creating a GOT entry instead of
a PLT entry for the symbol, irrepsective of the original symbol being a code or
data symbol. If code symbols end up getting GOT stubs, we see the above crash as
the control flow jumps to the location of the stub, and instead of a PLT/jump
island just lands in the address of the target symbol, which is in most cases
non-sensical machine code.
11 changes: 7 additions & 4 deletions ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@
"R2211" = inputs.nixpkgs-2211;
"R2305" = inputs.nixpkgs-2305;
"R2311" = inputs.nixpkgs-2311;
"R2405" = inputs.nixpkgs-2405;
"unstable" = inputs.nixpkgs-unstable;
};

nixpkgsArgs = {
# set checkMaterialization as per top-level argument
overlays = [
haskellNix.overlay
(_final: prev: {
(final: prev: {
haskell-nix = prev.haskell-nix // {
inherit checkMaterialization;
extraPkgconfigMappings = prev.haskell-nix.extraPkgconfigMappings or {} // {
"libsodium" = [ "libsodium-18" ];
};
};
libsodium-18 = (final.callPackage (inputs.nixpkgs-2311 + "/pkgs/development/libraries/libsodium") {}).overrideAttrs (_: { dontDisableStatic = true; });
})
];
# Needed for dwarf tests
Expand All @@ -56,7 +61,7 @@
# cabal-install and nix-tools plans. When removing a ghc version
# from here (so that is no longer cached) also remove ./materialized/ghcXXX.
# Update supported-ghc-versions.md to reflect any changes made here.
nixpkgs.lib.optionalAttrs (nixpkgsName == "R2311") {
nixpkgs.lib.optionalAttrs (nixpkgsName == "R2405") {
ghc94 = false;
ghc96 = false;
ghc98 = false;
Expand Down Expand Up @@ -120,8 +125,6 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: pinnedNixpkgsSrc:
ghc = pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name};
} // pkgs.lib.optionalAttrs runTests {
inherit (build) tests tools maintainer-scripts maintainer-script-cache;
} // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
inherit (pkgs.haskell-nix.iserv-proxy-exes.${compiler-nix-name}) iserv-proxy;
} // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; inherit evalPackages compiler-nix-name; }).getComponent "exe:hello";
});
Expand Down
30 changes: 25 additions & 5 deletions compiler/ghc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ let
compiler-nix-name =
if builtins.compareVersions ghc-version "9.4.7" < 0
then "ghc928"
else "ghc962";
else if buildPackages.haskell.compiler ? ghc964
then "ghc964"
else "ghc962";
in
buildPackages.haskell-nix.tool compiler-nix-name "hadrian" {
compilerSelection = p: p.haskell.compiler;
Expand All @@ -272,7 +274,9 @@ let
then ../../materialized/${compiler-nix-name}/hadrian-ghc981
else if builtins.compareVersions ghc-version "9.9" < 0
then ../../materialized/${compiler-nix-name}/hadrian-ghc98
else ../../materialized/${compiler-nix-name}/hadrian-ghc99;
else if builtins.compareVersions ghc-version "9.11" < 0
then ../../materialized/${compiler-nix-name}/hadrian-ghc910
else null;
modules = [{
reinstallableLibGhc = false;
# Apply the patches in a way that does not require using something
Expand Down Expand Up @@ -701,11 +705,16 @@ stdenv.mkDerivation (rec {
${hadrian}/bin/hadrian ${hadrianArgs} _build/stage0/compiler/build/$a
cp _build/stage0/compiler/build/$a compiler/GHC/Builtin/$a
done
'' + lib.optionalString stdenv.isDarwin ''
'' + lib.optionalString (stdenv.isDarwin && (__tryEval libcxxabi).success) ''
substituteInPlace mk/system-cxx-std-lib-1.0.conf \
--replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib ${libcxxabi}/lib'
find . -name 'system*.conf*'
cat mk/system-cxx-std-lib-1.0.conf
'' + lib.optionalString (stdenv.isDarwin && !(__tryEval libcxxabi).success) ''
substituteInPlace mk/system-cxx-std-lib-1.0.conf \
--replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib'
find . -name 'system*.conf*'
cat mk/system-cxx-std-lib-1.0.conf
'' + lib.optionalString (installStage1 && stdenv.targetPlatform.isMusl) ''
substituteInPlace hadrian/cfg/system.config \
--replace 'cross-compiling = YES' \
Expand Down Expand Up @@ -786,11 +795,16 @@ stdenv.mkDerivation (rec {
export XATTR=$(mktemp -d)/nothing
'';
} // lib.optionalAttrs useHadrian {
postConfigure = lib.optionalString stdenv.isDarwin ''
postConfigure = lib.optionalString (stdenv.isDarwin && (__tryEval libcxxabi).success) ''
substituteInPlace mk/system-cxx-std-lib-1.0.conf \
--replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib ${libcxxabi}/lib'
find . -name 'system*.conf*'
cat mk/system-cxx-std-lib-1.0.conf
'' + lib.optionalString (stdenv.isDarwin && !(__tryEval libcxxabi).success) ''
substituteInPlace mk/system-cxx-std-lib-1.0.conf \
--replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib'
find . -name 'system*.conf*'
cat mk/system-cxx-std-lib-1.0.conf
'' + lib.optionalString (installStage1 && !haskell-nix.haskellLib.isCrossTarget && stdenv.targetPlatform.isMusl) ''
substituteInPlace hadrian/cfg/system.config \
--replace 'cross-compiling = YES' \
Expand Down Expand Up @@ -850,12 +864,18 @@ stdenv.mkDerivation (rec {
${hadrian}/bin/hadrian ${hadrianArgs} binary-dist-dir
cd _build/bindist/ghc-*
./configure --prefix=$out ${lib.concatStringsSep " " configureFlags}
${lib.optionalString stdenv.isDarwin ''
${lib.optionalString (stdenv.isDarwin && (__tryEval libcxxabi).success) ''
substituteInPlace mk/system-cxx-std-lib-1.0.conf \
--replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib ${libcxxabi}/lib'
substituteInPlace lib/package.conf.d/system-cxx-std-lib-1.0.conf \
--replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib ${libcxxabi}/lib'
''}
${lib.optionalString (stdenv.isDarwin && !(__tryEval libcxxabi).success) ''
substituteInPlace mk/system-cxx-std-lib-1.0.conf \
--replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib'
substituteInPlace lib/package.conf.d/system-cxx-std-lib-1.0.conf \
--replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib'
''}
mkdir -p utils
cp -r ../../../utils/completion utils
make install
Expand Down
6 changes: 6 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ self // {
pkgs-2305 = import self.inputs.nixpkgs-2305 (nixpkgsArgs // {
localSystem = { inherit system; };
});
pkgs-2311 = import self.inputs.nixpkgs-2311 (nixpkgsArgs // {
localSystem = { inherit system; };
});
pkgs-2405 = import self.inputs.nixpkgs-2405 (nixpkgsArgs // {
localSystem = { inherit system; };
});
pkgs-unstable = import self.inputs.nixpkgs-unstable (nixpkgsArgs // {
localSystem = { inherit system; };
});
Expand Down
37 changes: 27 additions & 10 deletions flake.lock

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

7 changes: 3 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
nixpkgs-2211 = { url = "github:NixOS/nixpkgs/nixpkgs-22.11-darwin"; };
nixpkgs-2305 = { url = "github:NixOS/nixpkgs/nixpkgs-23.05-darwin"; };
nixpkgs-2311 = { url = "github:NixOS/nixpkgs/nixpkgs-23.11-darwin"; };
# The libsodium bump in 85c6e70b555fe892a049fa3d9dce000dc23a9562 breaks th-dll tests.
# And later it breaks in th-dll due to some change in the windows libs. We should probably
# drop unsable.
nixpkgs-unstable = { url = "github:NixOS/nixpkgs?rev=47585496bcb13fb72e4a90daeea2f434e2501998"; }; # nixpkgs-unstable };
nixpkgs-2405 = { url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin"; };
nixpkgs-unstable = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; };
flake-compat = { url = "github:input-output-hk/flake-compat/hkm/gitlab-fix"; flake = false; };
"hls-1.10" = { url = "github:haskell/haskell-language-server/1.10.0.0"; flake = false; };
"hls-2.0" = { url = "github:haskell/haskell-language-server/2.0.0.1"; flake = false; };
Expand Down Expand Up @@ -85,6 +83,7 @@
, nixpkgs-2211
, nixpkgs-2305
, nixpkgs-2311
, nixpkgs-2405
, flake-compat
, ...
}@inputs:
Expand Down
7 changes: 6 additions & 1 deletion lib/call-cabal-project-to-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,14 @@ let
sourceRepos = sourceReposBuild;
inherit (repoResult) repos extra-hackages;
makeFixedProjectFile = ''
HOME=$(mktemp -d)
cp -f ${evalPackages.writeText "cabal.project" sourceRepoFixedProjectFile} ./cabal.project
chmod +w -R ./cabal.project
'';
'' + pkgs.lib.strings.concatStrings (
map (f: ''
git config --global --add safe.directory ${f.location}/.git
'') sourceReposEval
);
# This will be used to replace refernces to the minimal git repos with just the index
# of the repo. The index will be used in lib/import-and-filter-project.nix to
# lookup the correct repository in `sourceReposBuild`. This avoids having
Expand Down
16 changes: 8 additions & 8 deletions lib/pkgconf-nixpkgs-map.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ pkgs:

# Only include derivations that exist in the current pkgs.
# This allows us to use this mapping to be used in allPkgConfigWrapper.
# See ./overlas
# See ./overlays
lookupAttrsIn = x: __mapAttrs (_pname: names:
# The first entry is should be used for the version by allPkgConfigWrapper
# so we need it to be present.
if __length names != 0 && x ? ${__head names}
then
pkgs.lib.concatMap (
name: if x ? ${name} then [ x.${name} ] else []) names
else []);
# The first entry is should be used for the version by allPkgConfigWrapper
# so we need it to be present.
with lib; optionals (__length names != 0 && x ? ${__head names})
(concatMap
(name: optionals (x ? ${name})
(let p = __tryEval (x.${name}); in optional p.success p.value))
names));
in lookupAttrsIn pkgs ({
# Based on https://github.com/NixOS/cabal2nix/blob/11c68fdc79461fb74fa1dfe2217c3709168ad752/src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs#L23

Expand Down
6 changes: 5 additions & 1 deletion lib/system-nixpkgs-map.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ in
# -- linux
{ crypto = [ openssl ];
"c++" = [ libcxx ];
"c++abi" = [ libcxxabi ];
# at some point this happened:
#
# error: 'libcxxabi' was merged into 'libcxx'
#
"c++abi" = if (__tryEval libcxxabi).success then [ libcxxabi ] else [ libcxx ];
system-cxx-std-lib = [];
"stdc++" = gcclibs;
"stdc++-6" = gcclibs;
Expand Down
Loading
Loading