Skip to content

Build nonReinstallablePkgs from pre-existing packages in plan.json #2207

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 30 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0fedc5e
Add preExistingPkgs to plan-nix based on plan.json
hamishmack May 29, 2024
7083f29
Bump haskellNix used in nix-tools/flake.lock
hamishmack May 29, 2024
8876668
update nix-tools-static.nix
May 29, 2024
1646e38
Update materialization
hamishmack May 29, 2024
eb1eed3
ifdLevel 0
hamishmack May 29, 2024
8396917
ifdLevel 1
hamishmack May 30, 2024
a37dc97
Use preExistingPkgs
hamishmack May 30, 2024
39e7d58
ifdLevel 2
hamishmack May 30, 2024
acd10a2
ifdLevel 3
hamishmack May 30, 2024
bd9df7e
More accurate dummy-ghc for ghcjs
hamishmack May 31, 2024
c93bacb
Fix for ghcjs 8.10
hamishmack May 31, 2024
4c0e1b0
Fix setup-deps test
hamishmack May 31, 2024
76a12cf
ifdLevel 0
hamishmack May 31, 2024
60969df
ifdLevel 1
hamishmack May 31, 2024
b0cd662
ifdLevel 2
hamishmack Jun 2, 2024
94db4cc
ifdLevel 3
hamishmack Jun 2, 2024
1e35eec
Fix js-template-haskell test
hamishmack Jun 2, 2024
af5154e
Better error for unplanned dependencies with overrides
hamishmack Jun 4, 2024
d2713c2
Simplify iserv-proxy project
hamishmack Jun 4, 2024
3a07c3b
Fix for ghcjs 8.10
hamishmack Jun 4, 2024
b849a92
ifdLevel 2
hamishmack Jun 4, 2024
cf29680
Remove iserv-proxy materialization
hamishmack Jun 4, 2024
31abe7d
ifdLevel 3
hamishmack Jun 4, 2024
a5a2bec
Fix for ghcjs 8.10
hamishmack Jun 4, 2024
724013f
Merge remote-tracking branch 'origin/master' into static-nix-tools
hamishmack Jun 4, 2024
7f4ab76
Add materialized file
hamishmack Jun 4, 2024
7549380
Fix for windows profiled TH
hamishmack Jun 4, 2024
2922479
Remove old code
hamishmack Jun 4, 2024
81d2cb8
Revert "Remove old code"
hamishmack Jun 4, 2024
f287646
Add changelog entry
hamishmack Jun 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion builder/make-config-files.nix
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ let
fi
''}
done
for p in ${lib.concatStringsSep " " (lib.remove "ghc" nonReinstallablePkgs')}; do
for p in ${lib.concatStringsSep " " nonReinstallablePkgs'}; do
if [ -e $ghcDeps/envDeps/$p ]; then
cat $ghcDeps/envDeps/$p >> $configFiles/ghc-environment
fi
Expand Down
41 changes: 41 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
This file contains a summary of changes to Haskell.nix and `nix-tools`
that will impact users.

## Jun 5, 2024

Haskell.nix now respects the `pre-existing` packages selected
by the cabal planner. The selection made by the planner
is used to set `nonReinstallablePkgs`.

Instead setting `nonReinstallablePkgs` and `reinstallableLibGhc`
haskell.nix projects should add `constraints` to the cabal project.

For instance to force the use of the `pre-exising` `text`
package add:

```
constraints: text installed
```

To make sure `text` is reinstalled use:

```
constraints: text source
```

The `pre-existing` `ghc` will now be used by default as
that is what `cabal` will choose (haskell.nix used to choose
`reinstallableLibGhc=true` by default).

To allow cabal to choose reinstalling `ghc` add:

```
allow-boot-library-installs: True
```

To force cabal to choose reinstalling:

```
constraints: ghc source
allow-boot-library-installs: True
```

It may also need `allow-newer: ghc:Cabal`

## Mar 27, 2023

Haskell.nix will no longer parse the `cabal.project` file to
Expand Down
6 changes: 6 additions & 0 deletions compiler/ghc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,16 @@ let
materialized =
if builtins.compareVersions ghc-version "9.4" < 0
then ../../materialized/${compiler-nix-name}/hadrian-ghc92
else if builtins.compareVersions ghc-version "9.4.8" < 0
then ../../materialized/${compiler-nix-name}/hadrian-ghc947
else if builtins.compareVersions ghc-version "9.6" < 0
then ../../materialized/${compiler-nix-name}/hadrian-ghc94
else if builtins.compareVersions ghc-version "9.6.5" < 0
then ../../materialized/${compiler-nix-name}/hadrian-ghc964
else if builtins.compareVersions ghc-version "9.8" < 0
then ../../materialized/${compiler-nix-name}/hadrian-ghc96
else if builtins.compareVersions ghc-version "9.8.2" < 0
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;
Expand Down
33 changes: 18 additions & 15 deletions lib/call-cabal-project-to-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -363,46 +363,49 @@ let

ghc-pkgs = [
"Cabal"
"Cabal-syntax"
"array"
"base"
"binary"
"bytestring"
"containers"
"deepseq"
"directory"
"exceptions"
"filepath"
"ghc"
"ghc-bignum"
"ghc-boot"
"ghc-boot-th"
"ghc-compact"
"ghc-experimental"
"ghc-heap"
"ghc-internal"
"ghc-platform"
"ghc-prim"
"ghc-toolchain"
"ghci"
"haskeline"
"hpc"
"integer-gmp"
"libiserv"
"mtl"
"os-string"
"parsec"
"pretty"
"process"
"rts"
"semaphore-compat"
"stm"
"template-haskell"
"terminfo"
"text"
"time"
"transformers"
] ++ pkgs.lib.optionals (!pkgs.stdenv.targetPlatform.isGhcjs || builtins.compareVersions ghc.version "9.0" > 0) [
# GHCJS 8.10 does not have these
"Cabal-syntax"
"exceptions"
"ghc"
"ghc-bignum"
"ghc-experimental"
"ghc-internal"
"ghc-platform"
"ghc-toolchain"
"haskeline"
"hpc"
"libiserv"
"os-string"
"semaphore-compat"
"stm"
"xhtml"
] ++ pkgs.lib.optionals (!pkgs.stdenv.targetPlatform.isGhcjs) [
"terminfo"
] ++ (if pkgs.stdenv.targetPlatform.isWindows
then [ "Win32" ]
else [ "unix" ]
Expand Down
14 changes: 13 additions & 1 deletion lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,19 @@ in {

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

projectOverlays = import ./project-overlays.nix {
inherit lib haskellLib;
Expand Down
16 changes: 16 additions & 0 deletions materialized/alex-3.2.7.1/default.nix

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

10 changes: 5 additions & 5 deletions materialized/ghc-boot-packages-nix/ghc8107-ghcjs/Win32.nix

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

12 changes: 6 additions & 6 deletions materialized/ghc-boot-packages-nix/ghc8107-ghcjs/base.nix

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

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

39 changes: 39 additions & 0 deletions materialized/ghc-boot-packages-nix/ghc8107-ghcjs/ghc-boot.nix

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

8 changes: 4 additions & 4 deletions materialized/ghc-boot-packages-nix/ghc8107-ghcjs/ghc-heap.nix

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

14 changes: 7 additions & 7 deletions materialized/ghc-boot-packages-nix/ghc8107-ghcjs/ghc-prim.nix

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

8 changes: 4 additions & 4 deletions materialized/ghc-boot-packages-nix/ghc8107-ghcjs/ghci.nix

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

8 changes: 4 additions & 4 deletions materialized/ghc-boot-packages-nix/ghc8107-ghcjs/hpc.nix

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

Loading