about summary refs log tree commit diff
path: root/third_party/bazel/rules_haskell/tests/run-start-script.sh
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-07-04T10·18+0100
committerVincent Ambo <tazjin@google.com>2019-07-04T10·18+0100
commitf723b8b878a3c4a4687b9e337a875500bebb39b1 (patch)
treee85204cf042c355e90cff61c111e7d8cd15df311 /third_party/bazel/rules_haskell/tests/run-start-script.sh
parent2eb1dc26e42ffbdc168f05ef744bd4b4f3e4c36f (diff)
feat(third_party/bazel): Check in rules_haskell from Tweag r/17
Diffstat (limited to 'third_party/bazel/rules_haskell/tests/run-start-script.sh')
-rwxr-xr-xthird_party/bazel/rules_haskell/tests/run-start-script.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/third_party/bazel/rules_haskell/tests/run-start-script.sh b/third_party/bazel/rules_haskell/tests/run-start-script.sh
new file mode 100755
index 000000000000..6803581f0010
--- /dev/null
+++ b/third_party/bazel/rules_haskell/tests/run-start-script.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Run the start script in its own workspace
+# and build the example binary target.
+
+set -e
+
+pwd=$(pwd)
+cd $(mktemp -d)
+$pwd/start
+
+# Copy the bazel configuration, this is only useful for CI
+mkdir tools
+cp $pwd/.bazelrc .bazelrc
+
+# Set Nixpkgs in environment variable to avoid hardcoding it in
+# start script itself.
+
+# overrides the used rules_haskell, because
+# when we're testing the start on a feature branch (CI),
+# the latest rules_haskell version doesn't always work.
+# If on the branch we update Bazel to a version with breaking
+# changes, then we need to adapt to those changes in the branch.
+# Which in turn means the start script should pull in those changes too.
+
+NIX_PATH=nixpkgs=$pwd/nixpkgs/default.nix \
+  bazel build \
+  --config=ci \
+  --override_repository=io_tweag_rules_haskell=$pwd \
+  //:example