daml/bazel_tools/ghci-template.sh
Andreas Herrmann e1727dc033 Update rules_haskell (#3275)
* Use cc_wrapper in ghcide test

The cc_wrapper is needed to find library dependencies.

* Update rules_haskell

* update rules_nixpkgs

Fixes issue with `nixpkgs_local_repository` and Nix `import`.

* Shorten RULES_HASKELL_EXEC_ROOT

Cabal package library paths are longer and overflow the command-line
length when calling `cc` on MacOS for template Haskell dependencies in
the IDE tests. Shortening the `RULES_HASKELL_EXEC_ROOT` prefix for each
`(LD_)LIBRARY_PATH` entry works around the issue.
2019-11-12 12:15:31 +00:00

15 lines
604 B
Bash

#!/usr/bin/env bash
# Copyright (c) 2019 The DAML Authors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
ENV_FILE=$1
ARGS_FILE=$2
RULES_HASKELL_EXEC_ROOT=bazel-$(basename ${BUILD_WORKSPACE_DIRECTORY})/
# Setting -pgm* flags explicitly has the unfortunate side effect
# of resetting any program flags in the GHC settings file. So we
# restore them here. See
# https://ghc.haskell.org/trac/ghc/ticket/7929.
PGM_ARGS="-pgma {CC} -pgmc {CC} -pgml {CC} -pgmP {CC} -optc-fno-stack-protector -optP-E -optP-undef -optP-traditional"
echo "{ENV}" > "$ENV_FILE"
echo $PGM_ARGS "{ARGS}" > "$ARGS_FILE"