Skip to content

Commit 4df8eef

Browse files
committed
Merge remote-tracking branch 'origin/master' into hkm/nixpkgs-update
# Conflicts: # compiler/ghc/default.nix # materialized/ghc962/hadrian-ghc99/hadrian/cabal-files/hashable.nix # materialized/ghc962/hadrian-ghc99/hadrian/cabal-files/random.nix # materialized/ghc962/hadrian-ghc99/hadrian/cabal-files/splitmix.nix # materialized/ghc962/hadrian-ghc99/hadrian/cabal-files/unordered-containers.nix
2 parents d0e33ae + adc2e66 commit 4df8eef

File tree

392 files changed

+11244
-11550
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

392 files changed

+11244
-11550
lines changed

builder/make-config-files.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ let
160160
fi
161161
''}
162162
done
163-
for p in ${lib.concatStringsSep " " (lib.remove "ghc" nonReinstallablePkgs')}; do
163+
for p in ${lib.concatStringsSep " " nonReinstallablePkgs'}; do
164164
if [ -e $ghcDeps/envDeps/$p ]; then
165165
cat $ghcDeps/envDeps/$p >> $configFiles/ghc-environment
166166
fi

changelog.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
11
This file contains a summary of changes to Haskell.nix and `nix-tools`
22
that will impact users.
33

4+
## Jun 5, 2024
5+
6+
Haskell.nix now respects the `pre-existing` packages selected
7+
by the cabal planner. The selection made by the planner
8+
is used to set `nonReinstallablePkgs`.
9+
10+
Instead setting `nonReinstallablePkgs` and `reinstallableLibGhc`
11+
haskell.nix projects should add `constraints` to the cabal project.
12+
13+
For instance to force the use of the `pre-exising` `text`
14+
package add:
15+
16+
```
17+
constraints: text installed
18+
```
19+
20+
To make sure `text` is reinstalled use:
21+
22+
```
23+
constraints: text source
24+
```
25+
26+
The `pre-existing` `ghc` will now be used by default as
27+
that is what `cabal` will choose (haskell.nix used to choose
28+
`reinstallableLibGhc=true` by default).
29+
30+
To allow cabal to choose reinstalling `ghc` add:
31+
32+
```
33+
allow-boot-library-installs: True
34+
```
35+
36+
To force cabal to choose reinstalling:
37+
38+
```
39+
constraints: ghc source
40+
allow-boot-library-installs: True
41+
```
42+
43+
It may also need `allow-newer: ghc:Cabal`
44+
445
## Mar 27, 2023
546

647
Haskell.nix will no longer parse the `cabal.project` file to

compiler/ghc/default.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,16 @@ let
262262
materialized =
263263
if builtins.compareVersions ghc-version "9.4" < 0
264264
then ../../materialized/${compiler-nix-name}/hadrian-ghc92
265+
else if builtins.compareVersions ghc-version "9.4.8" < 0
266+
then ../../materialized/${compiler-nix-name}/hadrian-ghc947
265267
else if builtins.compareVersions ghc-version "9.6" < 0
266268
then ../../materialized/${compiler-nix-name}/hadrian-ghc94
267-
else if builtins.compareVersions ghc-version "9.7" < 0
269+
else if builtins.compareVersions ghc-version "9.6.5" < 0
270+
then ../../materialized/${compiler-nix-name}/hadrian-ghc964
271+
else if builtins.compareVersions ghc-version "9.8" < 0
268272
then ../../materialized/${compiler-nix-name}/hadrian-ghc96
273+
else if builtins.compareVersions ghc-version "9.8.2" < 0
274+
then ../../materialized/${compiler-nix-name}/hadrian-ghc981
269275
else if builtins.compareVersions ghc-version "9.9" < 0
270276
then ../../materialized/${compiler-nix-name}/hadrian-ghc98
271277
else if builtins.compareVersions ghc-version "9.11" < 0

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/call-cabal-project-to-nix.nix

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -368,46 +368,49 @@ let
368368

369369
ghc-pkgs = [
370370
"Cabal"
371-
"Cabal-syntax"
372371
"array"
373372
"base"
374373
"binary"
375374
"bytestring"
376375
"containers"
377376
"deepseq"
378377
"directory"
379-
"exceptions"
380378
"filepath"
381-
"ghc"
382-
"ghc-bignum"
383379
"ghc-boot"
384380
"ghc-boot-th"
385381
"ghc-compact"
386-
"ghc-experimental"
387382
"ghc-heap"
388-
"ghc-internal"
389-
"ghc-platform"
390383
"ghc-prim"
391-
"ghc-toolchain"
392384
"ghci"
393-
"haskeline"
394-
"hpc"
395385
"integer-gmp"
396-
"libiserv"
397386
"mtl"
398-
"os-string"
399387
"parsec"
400388
"pretty"
401389
"process"
402390
"rts"
403-
"semaphore-compat"
404-
"stm"
405391
"template-haskell"
406-
"terminfo"
407392
"text"
408393
"time"
409394
"transformers"
395+
] ++ pkgs.lib.optionals (!pkgs.stdenv.targetPlatform.isGhcjs || builtins.compareVersions ghc.version "9.0" > 0) [
396+
# GHCJS 8.10 does not have these
397+
"Cabal-syntax"
398+
"exceptions"
399+
"ghc"
400+
"ghc-bignum"
401+
"ghc-experimental"
402+
"ghc-internal"
403+
"ghc-platform"
404+
"ghc-toolchain"
405+
"haskeline"
406+
"hpc"
407+
"libiserv"
408+
"os-string"
409+
"semaphore-compat"
410+
"stm"
410411
"xhtml"
412+
] ++ pkgs.lib.optionals (!pkgs.stdenv.targetPlatform.isGhcjs) [
413+
"terminfo"
411414
] ++ (if pkgs.stdenv.targetPlatform.isWindows
412415
then [ "Win32" ]
413416
else [ "unix" ]

lib/default.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,19 @@ in {
340340

341341
# Converts from a `compoent.depends` value to a library derivation.
342342
# In the case of sublibs the `depends` value should already be the derivation.
343-
dependToLib = d: d.components.library or d;
343+
dependToLib = d:
344+
# Do simplify this to `d.components.library or d`, as that
345+
# will not give a good error message if the `.library`
346+
# is missing (happens if the package is unplanned,
347+
# but has overrides).
348+
# It would be nice to put an `assert` here, but there is
349+
# currently no good way to get the name of the dependency
350+
# when it is not in the plan. The attribute path of
351+
# `d` in the `nix` error should include the name
352+
# eg. `packages.Cabal.components.library`.
353+
if d ? components
354+
then d.components.library
355+
else d;
344356

345357
projectOverlays = import ./project-overlays.nix {
346358
inherit lib haskellLib;

materialized/alex-3.2.7.1/default.nix

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/ghc-boot-packages-nix/ghc8107-ghcjs/Win32.nix

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/ghc-boot-packages-nix/ghc8107-ghcjs/base.nix

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/ghc-boot-packages-nix/ghc8107-ghcjs/bytestring.nix

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)