Skip to content

Commit

Permalink
Merge pull request #1141 from tweag/pipeline-bazel-version
Browse files Browse the repository at this point in the history
Pipeline defined Bazel version
  • Loading branch information
mergify[bot] authored Nov 14, 2019
2 parents 23c6b64 + 63218cd commit d1ba855
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 6 deletions.
1 change: 1 addition & 0 deletions .buildkite/bazel-sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6564a9ccb2ab4e39696f20254f3c1a900992e849d1307d8abed708bf48acc4ee bazel
1 change: 1 addition & 0 deletions .buildkite/bazel-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.28.0
18 changes: 18 additions & 0 deletions .buildkite/bindists-pipeline
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Calls `fetch-bazel-bindist` to download Bazel, adds it to `$PATH`, configures
# `.bazelrc.local`, and runs the tests.

set -euo pipefail

BAZEL_DIR="$(.buildkite/fetch-bazel-bindist)"
trap "rm -rf '$BAZEL_DIR'" EXIT
export PATH="$BAZEL_DIR:$PATH"
echo "common:ci --build_tag_filters -requires_lz4,-requires_proto,-requires_zlib,-requires_doctest,-requires_c2hs,-requires_threaded_rts,-dont_test_with_bindist" > .bazelrc.local
# XXX: See .bazelrc [backward compatible options] for the the rational behind this flag
echo "build --incompatible_use_python_toolchains=false" >> .bazelrc.local
# XXX: Remove once all rules using `use_default_shell_env = True` have been
# converted to using `rules_sh`'s POSIX toolchain.
echo "build:ci --experimental_strict_action_env" >> .bazelrc.local
./tests/run-start-script.sh --use-bindists
bazel build --config ci //tests/...
11 changes: 11 additions & 0 deletions .buildkite/check-bazel-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# nixpkgs Bazel version ends on '- (@non-git)'.
VERSION_EXPECTED="bazel $(cat "$DIR/bazel-version")- (@non-git)"
VERSION_ACTUAL=$(bazel version --gnu_format)
[[ "$VERSION_ACTUAL" = "$VERSION_EXPECTED" ]] || {
echo "Expected Bazel version $VERSION_EXPECTED but found $VERSION_ACTUAL." >&2
exit 1
}
10 changes: 10 additions & 0 deletions .buildkite/fetch-bazel-bindist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

VERSION=$(cat "$DIR/bazel-version")
INSTALL="$(mktemp -d)"
curl -L "https://github.com/bazelbuild/bazel/releases/download/$VERSION/bazel-$VERSION-linux-x86_64" -o "$INSTALL/bazel" >&2
(cd "$INSTALL" && sha256sum --quiet -c "$DIR/bazel-sha256") >&2
chmod +x "$INSTALL/bazel"
echo -n "$INSTALL"
11 changes: 5 additions & 6 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ steps:
echo "build:ci --host_platform=@rules_haskell//haskell/platforms:linux_x86_64_nixpkgs" > .bazelrc.local
nix-shell --arg docTools false --pure --run '
set -e
# Ensure that the Nixpkgs bazel version matches the one specified in
# `.buildkite/bazel-version` and fetched in
# `.buildkite/bindists-pipeline` for the bindists version.
.buildkite/check-bazel-version
./tests/run-start-script.sh --use-nix
bazel build --config ci //tests:run-tests
./bazel-ci-bin/tests/run-tests
Expand All @@ -13,10 +17,5 @@ steps:
timeout: 30

- label: "Run tests (bindists)"
command: |
echo "common:ci --build_tag_filters -requires_lz4,-requires_proto,-requires_zlib,-requires_doctest,-requires_c2hs,-requires_threaded_rts,-dont_test_with_bindist" > .bazelrc.local
# XXX: See .bazelrc [backward compatible options] for the the rational behind this flag
echo "build --incompatible_use_python_toolchains=false" >> .bazelrc.local
./tests/run-start-script.sh --use-bindists
bazel build --config ci //tests/...
command: ".buildkite/bindists-pipeline"
timeout: 30

0 comments on commit d1ba855

Please sign in to comment.