summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2021-03-07 08:04:00 +0800
committerZubin Duggal <zubin.duggal@gmail.com>2021-09-21 11:30:27 +0530
commit090c744a95bc48596afacfe557cdbd2a11cc83a4 (patch)
tree3a1261c1d13b8e234b7cd9e8372dabc23f495adb
parent72e93e4ab9c05bed32f488c012f127853626a772 (diff)
downloadhaskell-090c744a95bc48596afacfe557cdbd2a11cc83a4.tar.gz
[ci/nix-shell] uniquify NIX_LDFLAGS{_FOR_TARGET}
(cherry picked from commit 07b1af0362beaaf221cbee7b17bbe0a5606fd87d) (cherry picked from commit ccea61173679b8e26b09fd2d3d1f35cfb078df6c)
-rw-r--r--.gitlab/shell.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/.gitlab/shell.nix b/.gitlab/shell.nix
index eb79921fce..5e32847735 100644
--- a/.gitlab/shell.nix
+++ b/.gitlab/shell.nix
@@ -14,7 +14,17 @@
# the real fix is to teach terminfo to use libcurses on macOS.
CONFIGURE_ARGS = "--with-intree-gmp --with-curses-libraries=${pkgs.ncurses.out}/lib";
- buildInputs = (with pkgs; [
+ # magic speedup pony :facepalm:
+ #
+ # nix has the ugly habbit of duplicating ld flags more than necessary. This
+ # somewhat consolidates this.
+ shellHook = ''
+ export NIX_LDFLAGS=$(for a in $NIX_LDFLAGS; do echo $a; done |sort|uniq|xargs)
+ export NIX_LDFLAGS_FOR_TARGET=$(for a in $NIX_LDFLAGS_FOR_TARGET; do echo $a; done |sort|uniq|xargs)
+ export NIX_LDFLAGS_FOR_TARGET=$(comm -3 <(for l in $NIX_LDFLAGS_FOR_TARGET; do echo $l; done) <(for l in $NIX_LDFLAGS; do echo $l; done))
+ '';
+
+ nativeBuildInputs = (with pkgs; [
haskell.compiler.${compiler}
haskell.packages.${compiler}.cabal-install
haskell.packages.${compiler}.alex