daml/build.sh
Andreas Herrmann 559c78003e
Update rules_haskell (#4751)
* Update rules_haskell

The workaround for linking against `Cffi` in the REPL has been
upstreamed in a more generalized form.

CHANGELOG_BEGIN
CHANGELOG_END

* ghcide: Use rules_haskell's hie-bios support

* Document `ghcide` Bazel integration

* Rename files to match module names

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-03-13 16:49:34 +01:00

44 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2020 The DAML Authors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
eval "$($(dirname "$0")/dev-env/bin/dade-assist)"
execution_log_postfix=${1:-}
export LC_ALL=en_US.UTF-8
ARTIFACT_DIRS="${BUILD_ARTIFACTSTAGINGDIRECTORY:-$PWD}"
tag_filter=""
if [[ "$execution_log_postfix" == "_Darwin" ]]; then
tag_filter="-dont-run-on-darwin,-scaladoc,-pdfdocs"
fi
# Bazel test only builds targets that are dependencies of a test suite
# so do a full build first.
(
cd compiler
bazel build //... --build_tag_filters "$tag_filter"
)
bazel test //... --build_tag_filters "$tag_filter" --test_tag_filters "$tag_filter" --experimental_execution_log_file "$ARTIFACT_DIRS/test_execution${execution_log_postfix}.log"
# Make sure that Bazel query works.
bazel query 'deps(//...)' > /dev/null
# Check that we can load damlc in ghci
GHCI_SCRIPT=$(mktemp)
function cleanup {
rm -rf "$GHCI_SCRIPT"
}
trap cleanup EXIT
# Disabled on darwin since it sometimes seem to hang and this only
# tests our dev setup rather than our code so issues are not critical.
if [[ "$(uname)" != "Darwin" ]]; then
da-ghci --data yes //compiler/damlc:damlc -e ':main --help'
fi
# Check that our IDE works on our codebase
ghcide compiler/damlc/exe/Main.hs 2>&1 | tee ide-log
grep -q "1 file worked, 0 files failed" ide-log