Skip to content

Commit 6dc93ce

Browse files
authored
Fix missing -lnuma when linking musl test exes (#652)
Also: * Reduce the number of calls to override functions * cp -L is not needed for user to cp calculateNoHash * Update dummy-ghc files
1 parent db409cf commit 6dc93ce

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

builder/comp-builder.nix

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
{ stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, ghcForComponent, hsPkgs, runCommand, libffi, gmp, zlib, ncurses, nodejs }:
2-
1+
{ stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, ghcForComponent, hsPkgs, runCommand, libffi, gmp, zlib, ncurses, numactl, nodejs }:
2+
let
3+
# These are here to avoid multiple calls to override
4+
gmpStatic = gmp.override { withStatic = true; };
5+
zlibStatic = zlib.static;
6+
ncursesStatic = ncurses.override { enableStatic = true; };
7+
numactlStatic = numactl.overrideAttrs (_: { configureFlags = "--enable-static"; });
8+
in
39
lib.makeOverridable (
410
let self =
511
{ componentId
@@ -120,9 +126,10 @@ let
120126
"--disable-executable-dynamic"
121127
"--ghc-option=-optl=-pthread"
122128
"--ghc-option=-optl=-static"
123-
"--ghc-option=-optl=-L${gmp.override { withStatic = true; }}/lib"
124-
"--ghc-option=-optl=-L${zlib.static}/lib"
125-
"--ghc-option=-optl=-L${ncurses.override { enableStatic = true; }}/lib"
129+
"--ghc-option=-optl=-L${gmpStatic}/lib"
130+
"--ghc-option=-optl=-L${zlibStatic}/lib"
131+
"--ghc-option=-optl=-L${ncursesStatic}/lib"
132+
"--ghc-option=-optl=-L${numactlStatic}/lib"
126133
] ++ lib.optional enableSeparateDataOutput "--datadir=$data/share/${ghc.name}"
127134
++ lib.optional doHaddock' "--docdir=${docdir "$doc"}"
128135
++ lib.optional (enableLibraryProfiling || enableExecutableProfiling) "--profiling-detail=${profilingDetail}"

lib/materialize.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ let
7777
if materialized != null && !__pathExists materialized
7878
then ''
7979
echo "Materialized nix used for ${name} is missing. To fix run :" >> $ERR
80-
echo " cp -Lr ${calculateNoHash} ${toString materialized}" >> $ERR
80+
echo " cp -r ${calculateNoHash} ${toString materialized}" >> $ERR
8181
echo " chmod -R +w ${toString materialized}" >> $ERR
8282
cat $ERR
8383
false
@@ -91,7 +91,7 @@ let
9191
diff -ru ${materialized} ${calculateNoHash} || true
9292
echo "Materialized nix used for ${name} incorrect. To fix run :" >> $ERR
9393
echo " rm -rf ${toString materialized}" >> $ERR
94-
echo " cp -Lr ${calculateNoHash} ${toString materialized}" >> $ERR
94+
echo " cp -r ${calculateNoHash} ${toString materialized}" >> $ERR
9595
echo " chmod -R +w ${toString materialized}" >> $ERR
9696
fi
9797
'')

materialized/dummy-ghc/ghc-8.6.5-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.

materialized/dummy-ghc/ghc-8.8.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.

materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.6.5-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.

materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.8.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)