summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-05-12 14:29:54 -0400
committerMoritz Angermann <moritz.angermann@gmail.com>2021-05-13 15:27:00 +0800
commit2f4fdee16c3bd993c8cfce349d2087a5a956f7c5 (patch)
tree24d767ce4d7af5d8f40010c4806d90c24f9e3589
parente0ded198e9ec1c8bb7253506569e7ae47818e791 (diff)
downloadhaskell-wip/simplify-ci.tar.gz
gitlab-ci: Drop nix-shell logic from ci.shwip/simplify-ci
There is no reason why ci.sh should need to know about the shell.nix environment used on Darwin. Shell.nix should rather export the environment needed by ci.sh.
-rwxr-xr-x.gitlab/ci.sh8
-rw-r--r--.gitlab/shell.nix9
2 files changed, 8 insertions, 9 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index 99c7e8bfa5..2e0118bf2f 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -176,13 +176,7 @@ function set_toolchain_paths() {
*) ;;
esac
- if [[ -n "${IN_NIX_SHELL:-}" ]]; then
- needs_toolchain=""
- GHC="$(which ghc)"
- CABAL="$(which cabal)"
- HAPPY="$(which happy)"
- ALEX="$(which alex)"
- elif [[ -n "$needs_toolchain" ]]; then
+ if [[ -n "$needs_toolchain" ]]; then
# These are populated by setup_toolchain
GHC="$toolchain/bin/ghc$exe"
CABAL="$toolchain/bin/cabal$exe"
diff --git a/.gitlab/shell.nix b/.gitlab/shell.nix
index 5e32847735..37e6585879 100644
--- a/.gitlab/shell.nix
+++ b/.gitlab/shell.nix
@@ -18,11 +18,16 @@
#
# nix has the ugly habbit of duplicating ld flags more than necessary. This
# somewhat consolidates this.
- shellHook = ''
+ shellHook = (with pkgs.haskell; ''
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))
- '';
+
+ export GHC=${compiler.${compiler}}/bin/ghc
+ export ALEX=${packages.${compiler}.alex}/bin/alex
+ export HAPPY=${packages.${compiler}.happy}/bin/happy
+ export CABAL=${packages.${compiler}.cabal-install}/bin/cabal
+ '');
nativeBuildInputs = (with pkgs; [
haskell.compiler.${compiler}