on iko/ghcjs-patch-master help sign in
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

commit6dc93ce1d4472d8e0f9bf0c38d7195899c44c3df authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateFri 5 Jun 2020, 12:54 (6 years ago) parentdb409cf
6 files changed+18−11
builder/comp-builder.nix+12−5 lib/materialize.nix+2−2 materialized/dummy-ghc/ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global+1−1 materialized/dummy-ghc/ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global+1−1 materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global+1−1 materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global+1−1
builder/comp-builder.nix+12−5
@@ -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
39lib.makeOverridable (
410let 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+2−2
@@ -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+1−1
@@ -1001,7 +1001,7 @@ maintainer: glasgow-haskell-users@haskell.org
10011001exposed: True
10021002hs-libraries: HSrts
10031003extra-libraries:
1004− m rt dl ffi pthread
1004+ m rt dl ffi numa pthread
10051005includes:
10061006 Stg.h
10071007ld-options: "-Wl,-u,base_GHCziTopHandler_runIO_closure"
materialized/dummy-ghc/ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global+1−1
@@ -1526,7 +1526,7 @@ maintainer: glasgow-haskell-users@haskell.org
15261526exposed: True
15271527library-dirs:
15281528hs-libraries: HSrts
1529−extra-libraries: m rt dl ffi pthread
1529+extra-libraries: m rt dl ffi numa pthread
15301530include-dirs:
15311531includes: Stg.h
15321532ld-options:
materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global+1−1
@@ -1000,7 +1000,7 @@ maintainer: glasgow-haskell-users@haskell.org
10001000exposed: True
10011001hs-libraries: HSrts
10021002extra-libraries:
1003− m rt dl ffi
1003+ m rt dl ffi numa
10041004includes:
10051005 Stg.h
10061006ld-options: "-Wl,-u,base_GHCziTopHandler_runIO_closure"
materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global+1−1
@@ -1491,7 +1491,7 @@ maintainer: glasgow-haskell-users@haskell.org
14911491exposed: True
14921492library-dirs:
14931493hs-libraries: HSrts
1494−extra-libraries: m rt dl ffi
1494+extra-libraries: m rt dl ffi numa
14951495include-dirs:
14961496includes: Stg.h
14971497ld-options: