diff --git a/builder/comp-builder.nix b/builder/comp-builder.nix index dce42bb9ec..7d8d7c02e2 100644 --- a/builder/comp-builder.nix +++ b/builder/comp-builder.nix @@ -1,5 +1,11 @@ -{ stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, ghcForComponent, hsPkgs, runCommand, libffi, gmp, zlib, ncurses, nodejs }: - +{ stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, ghcForComponent, hsPkgs, runCommand, libffi, gmp, zlib, ncurses, numactl, nodejs }: +let + # These are here to avoid multiple calls to override + gmpStatic = gmp.override { withStatic = true; }; + zlibStatic = zlib.static; + ncursesStatic = ncurses.override { enableStatic = true; }; + numactlStatic = numactl.overrideAttrs (_: { configureFlags = "--enable-static"; }); +in lib.makeOverridable ( let self = { componentId @@ -120,9 +126,10 @@ let "--disable-executable-dynamic" "--ghc-option=-optl=-pthread" "--ghc-option=-optl=-static" - "--ghc-option=-optl=-L${gmp.override { withStatic = true; }}/lib" - "--ghc-option=-optl=-L${zlib.static}/lib" - "--ghc-option=-optl=-L${ncurses.override { enableStatic = true; }}/lib" + "--ghc-option=-optl=-L${gmpStatic}/lib" + "--ghc-option=-optl=-L${zlibStatic}/lib" + "--ghc-option=-optl=-L${ncursesStatic}/lib" + "--ghc-option=-optl=-L${numactlStatic}/lib" ] ++ lib.optional enableSeparateDataOutput "--datadir=$data/share/${ghc.name}" ++ lib.optional doHaddock' "--docdir=${docdir "$doc"}" ++ lib.optional (enableLibraryProfiling || enableExecutableProfiling) "--profiling-detail=${profilingDetail}" diff --git a/lib/materialize.nix b/lib/materialize.nix index e9e752f23c..c1f7bc625e 100644 --- a/lib/materialize.nix +++ b/lib/materialize.nix @@ -77,7 +77,7 @@ let if materialized != null && !__pathExists materialized then '' echo "Materialized nix used for ${name} is missing. To fix run :" >> $ERR - echo " cp -Lr ${calculateNoHash} ${toString materialized}" >> $ERR + echo " cp -r ${calculateNoHash} ${toString materialized}" >> $ERR echo " chmod -R +w ${toString materialized}" >> $ERR cat $ERR false @@ -91,7 +91,7 @@ let diff -ru ${materialized} ${calculateNoHash} || true echo "Materialized nix used for ${name} incorrect. To fix run :" >> $ERR echo " rm -rf ${toString materialized}" >> $ERR - echo " cp -Lr ${calculateNoHash} ${toString materialized}" >> $ERR + echo " cp -r ${calculateNoHash} ${toString materialized}" >> $ERR echo " chmod -R +w ${toString materialized}" >> $ERR fi '') diff --git a/materialized/dummy-ghc/ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global b/materialized/dummy-ghc/ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global index b5942cc13d..5219af3d74 100644 --- a/materialized/dummy-ghc/ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global +++ b/materialized/dummy-ghc/ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global @@ -1001,7 +1001,7 @@ maintainer: glasgow-haskell-users@haskell.org exposed: True hs-libraries: HSrts extra-libraries: - m rt dl ffi pthread + m rt dl ffi numa pthread includes: Stg.h ld-options: "-Wl,-u,base_GHCziTopHandler_runIO_closure" diff --git a/materialized/dummy-ghc/ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global b/materialized/dummy-ghc/ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global index 85039b0929..fb295bb748 100644 --- a/materialized/dummy-ghc/ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global +++ b/materialized/dummy-ghc/ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global @@ -1526,7 +1526,7 @@ maintainer: glasgow-haskell-users@haskell.org exposed: True library-dirs: hs-libraries: HSrts -extra-libraries: m rt dl ffi pthread +extra-libraries: m rt dl ffi numa pthread include-dirs: includes: Stg.h ld-options: diff --git a/materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global b/materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global index f0c317f2a5..80da1ee210 100644 --- a/materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global +++ b/materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global @@ -1000,7 +1000,7 @@ maintainer: glasgow-haskell-users@haskell.org exposed: True hs-libraries: HSrts extra-libraries: - m rt dl ffi + m rt dl ffi numa includes: Stg.h ld-options: "-Wl,-u,base_GHCziTopHandler_runIO_closure" diff --git a/materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global b/materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global index 5a411450ad..31c5b9a4e4 100644 --- a/materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global +++ b/materialized/dummy-ghc/x86_64-unknown-linux-musl-x86_64-unknown-linux-musl-ghc-8.8.3-x86_64-linux/ghc-pkg/dump-global @@ -1491,7 +1491,7 @@ maintainer: glasgow-haskell-users@haskell.org exposed: True library-dirs: hs-libraries: HSrts -extra-libraries: m rt dl ffi +extra-libraries: m rt dl ffi numa include-dirs: includes: Stg.h ld-options: