Skip to content

Commit 49cbd34

Browse files
hamishmackRichard Wallace
andauthored
remove creation of relative links in package db (#569)
Changing from absolute links to relative links increases the length of the parameters passed during linking by half. For things that have many dependencies, this results in linking failing with an "argument list too long" error. Fixes #562 This change also updates the CI configuration files to help make it easier for CI to cope with this sort of change. Co-authored-by: Richard Wallace <[email protected]>
1 parent 49750aa commit 49cbd34

File tree

4 files changed

+38
-23
lines changed

4 files changed

+38
-23
lines changed

build.nix

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ let
1616
in rec {
1717
tests = import ./test/default.nix { inherit pkgs ifdLevel; };
1818

19-
tools = pkgs.recurseIntoAttrs
20-
(pkgs.lib.mapAttrs (_: ghc:
21-
let
22-
tool = name: version: pkgs.buildPackages.haskell-nix.tool name { inherit version ghc; };
23-
in pkgs.recurseIntoAttrs {
24-
cabal-32 = tool "cabal" "3.2.0.0";
25-
ghcide = tool "ghcide" "object-code";
26-
} // pkgs.lib.optionalAttrs (ghc.version == "8.6.5") {
27-
cabal-30 = tool "cabal" "3.0.0.0";
28-
}) { inherit (pkgs.buildPackages.haskell-nix.compiler) ghc865 ghc883; });
19+
tools = pkgs.lib.optionalAttrs (ifdLevel >= 3)
20+
(pkgs.recurseIntoAttrs
21+
(pkgs.lib.mapAttrs (_: ghc:
22+
let
23+
tool = name: version: pkgs.buildPackages.haskell-nix.tool name { inherit version ghc; };
24+
in pkgs.recurseIntoAttrs {
25+
cabal-32 = tool "cabal" "3.2.0.0";
26+
ghcide = tool "ghcide" "object-code";
27+
} // pkgs.lib.optionalAttrs (ghc.version == "8.6.5") {
28+
cabal-30 = tool "cabal" "3.0.0.0";
29+
}) { inherit (pkgs.buildPackages.haskell-nix.compiler) ghc865 ghc883; }));
2930

3031
# Scripts for keeping Hackage and Stackage up to date, and CI tasks.
3132
# The dontRecurseIntoAttrs prevents these from building on hydra

builder/make-config-files.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,5 @@ in { identifier, component, fullName, flags ? {} }:
179179
sed -i -E "/^ ./{H;$!d} ; x ; s,^dynamic-library-dirs:.*,dynamic-library-dirs: $dynamicLinksDir," $f
180180
done
181181
'' + ''
182-
# Use ''${pkgroot} relative paths so that we can relocate the package database
183-
# along with referenced packages and still have it work on systems with
184-
# or without nix installed.
185-
sed -i 's|/nix/store/|''${pkgroot}/../../../|' $out/${packageCfgDir}/*.conf
186182
${target-pkg} -v0 --package-db $out/${packageCfgDir} recache
187183
'')

ci.nix

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,50 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
3737
let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
3838
build = import ./build.nix { inherit pkgs ifdLevel; };
3939
platformFilter = platformFilterGeneric pkgs system;
40+
compilers = {
41+
inherit (pkgs.haskell-nix.compiler) ghc865 ghc883;
42+
};
4043
in filterAttrsOnlyRecursive (_: v: platformFilter v) {
4144
# Native builds
4245
# TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
43-
native = pkgs.recurseIntoAttrs {
46+
native = pkgs.recurseIntoAttrs ({
4447
inherit (build) tests tools maintainer-scripts maintainer-script-cache;
48+
ghc = pkgs.recurseIntoAttrs compilers;
49+
} // pkgs.lib.optionalAttrs (ifdLevel >= 1) {
50+
iserv-proxy = pkgs.recurseIntoAttrs (
51+
pkgs.lib.mapAttrs (ghcName: _:
52+
pkgs.ghc-extra-packages."${ghcName}".iserv-proxy.components.exes.iserv-proxy
53+
) compilers);
54+
} // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
4555
hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; }).components.exes.hello;
46-
iserv-proxy = pkgs.ghc-extra-packages.ghc865.iserv-proxy.components.exes.iserv-proxy;
47-
ghc = pkgs.recurseIntoAttrs pkgs.haskell-nix.compiler;
48-
};
56+
});
4957
}
5058
//
5159
dimension "Cross system" (crossSystems nixpkgsName genericPkgs system) (crossSystemName: crossSystem:
5260
# Cross builds
5361
let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
5462
build = import ./build.nix { inherit pkgs ifdLevel; };
55-
in pkgs.recurseIntoAttrs {
63+
in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) {
64+
ghc = pkgs.recurseIntoAttrs compilers;
5665
# TODO: look into making tools work when cross compiling
5766
# inherit (build) tools;
67+
} // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
68+
remote-iserv = pkgs.recurseIntoAttrs (
69+
pkgs.lib.mapAttrs (ghcName: _:
70+
pkgs.ghc-extra-packages."${ghcName}".remote-iserv.components.exes.remote-iserv
71+
) compilers);
72+
iserv-proxy = pkgs.recurseIntoAttrs (
73+
pkgs.lib.mapAttrs (ghcName: _:
74+
pkgs.ghc-extra-packages."${ghcName}".iserv-proxy.components.exes.iserv-proxy
75+
) compilers);
76+
} // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
5877
hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; }).components.exes.hello;
59-
iserv-proxy = pkgs.ghc-extra-packages.ghc865.iserv-proxy.components.exes.iserv-proxy;
60-
remote-iserv = pkgs.ghc-extra-packages.ghc865.remote-iserv.components.exes.remote-iserv;
6178
}
6279
//
6380
# Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
64-
pkgs.lib.optionalAttrs (crossSystemName != "aarch64-multiplatform") { inherit (build) tests; }
81+
pkgs.lib.optionalAttrs (crossSystemName != "aarch64-multiplatform") {
82+
inherit (build) tests;
83+
})
6584
)
6685
)
6786
)

overlays/haskell.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ self: super: {
501501
happy = self.buildPackages.haskell-nix.bootstrap.packages.happy;
502502
hscolour = self.buildPackages.haskell-nix.bootstrap.packages.hscolour;
503503
ghc865 = self.buildPackages.haskell-nix.compiler.ghc865;
504-
ghc882 = self.buildPackages.haskell-nix.compiler.ghc882;
505504
ghc883 = self.buildPackages.haskell-nix.compiler.ghc883;
506505
ghc-boot-packages-nix = self.recurseIntoAttrs
507506
(builtins.mapAttrs (_: self.recurseIntoAttrs)

0 commit comments

Comments
 (0)