Skip to content

Commit f056dd3

Browse files
authored
Fix the way ExeDependency is handled (#1036)
See input-output-hk/nix-tools#101 We should look up hsPkgs.${pkg-name}.components.exe.${component-name} instead of including the package as a dependency. Adding `hsPkgs.${pkg-name}` a tool it is not clear which executable in the package `haskell.nix` should choose. Haskell.nix did not deal with this well and in fact it could lead to `nix-shell` crashing. For instance using `shellFor` to make a shell for building `haskell-language-server` with `cabal build` crashed as a dependency on `ghcide` the executable (by the `ghcide-bench` executable) caused infinite recursion. Allowing `ghcide-bench` to correctly depend just on `components.exes.ghcide` fixes this. This PR also includes: * Updated materialized files built with the new nix-tools and latest index-state * Small update to GHCJS (pins happy) to fix issue that showed up when the materialization was updated * A fix for the infinite recursion issue when updating materialized files (by adding ghc-boot-packages-unchecked). * Performance fix for shellFor (checks just the names of component derivations when filtering).
1 parent 7ea4746 commit f056dd3

File tree

146 files changed

+451
-461
lines changed

Some content is hidden

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

146 files changed

+451
-461
lines changed

builder/shell-for.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ let
5959
# Given a list of derivations, removes those which are components of packages which were selected as part of the shell.
6060
removeSelectedInputs =
6161
# All the components of the selected packages: we shouldn't add any of these as dependencies
62-
let selectedPackageComponents = lib.concatMap haskellLib.getAllComponents selectedPackages;
63-
in lib.filter (input: !(builtins.elem input selectedPackageComponents));
62+
let selectedPackageComponents = map (x: x.name) (lib.concatMap haskellLib.getAllComponents selectedPackages);
63+
in lib.filter (input: !(builtins.elem input.name selectedPackageComponents));
6464

6565
# We need to remove any dependencies which are selected packages (see above).
6666
# `depends` contains packages so we use 'removeSelectedPackages`.

ci.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# We need to use the actual nixpkgs version we're working with here, since the values
4444
# of 'lib.systems.examples' are not understood between all versions
4545
let lib = nixpkgs.lib;
46-
in lib.optionalAttrs (nixpkgsName == "R2009" && (__elem compiler-nix-name ["ghc865" "ghc884"])) {
46+
in lib.optionalAttrs (nixpkgsName == "unstable" && (__elem compiler-nix-name ["ghc865" "ghc884"])) {
4747
inherit (lib.systems.examples) ghcjs;
4848
} // lib.optionalAttrs (system == "x86_64-linux" && (
4949
(nixpkgsName == "R2009" && __elem compiler-nix-name ["ghc8101" "ghc8102" "ghc8103" "ghc8104" "ghc810220201118"])

compiler/ghcjs/ghcjs88-src.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"url": "https://github.com/ghcjs/ghcjs",
3-
"rev": "1193ead2c760bab1e2ab461458ec771237ccf9b5",
4-
"sha256": "1h7gaq1lhf61b5x693phgpm2z0w393b1sbkxrd9mxzz9xxlyrhkl",
3+
"rev": "23e75593937dc15eaee73bed1443450fc68bd277",
4+
"sha256": "1cj4q2rx3xs8zfkpjjwfdfadidg0wgn3qisffiikxmgf41b4a760",
55
"fetchSubmodules": true
66
}

lib/materialize.nix

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ let
5656
builtins.trace sha256message (builtins.trace materializeMessage calculateNoHash);
5757

5858
# Build fully and check the hash and materialized versions
59-
checked = runCommand name {} (''
59+
checked =
60+
# Let the user know what we are checking. This is useful for debugging issues
61+
# where materialization fails to prevent infinite recurstion when:
62+
# checkMaterialization = true;
63+
(if materialized != null
64+
then __trace "Checking materialization in ${toString materialized}"
65+
else x: x)
66+
runCommand name {} (''
6067
ERR=$(mktemp -d)/errors.txt
6168
''
6269
+ (pkgs.lib.optionalString (sha256 != null) ''

materialized/bootstrap/ghc844/alex/.plan.nix/alex.nix

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/bootstrap/ghc844/happy-1.19.11/.plan.nix/happy.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.

materialized/bootstrap/ghc844/happy-1.19.12/.plan.nix/happy.nix

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/bootstrap/ghc844/hscolour/.plan.nix/hscolour.nix

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/dummy-ghc/aarch64-unknown-linux-gnu-aarch64-unknown-linux-gnu-ghc-8.10.3-x86_64-linux/ghc-pkg/dump-global

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)