-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1252 from tweag/bazel-version
Define Bazel version in one shared location
- Loading branch information
Showing
16 changed files
with
77 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3eca4c96cfda97a9d5f8d3d0dec4155a5cc5ff339b10d3f35213c398bf13881e bazel-2.0.0-darwin-x86_64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4df79462c6c3ecdeeee7af99fc269b52ab1aa4828ef3bc359c1837d3fafeeee7 bazel | ||
4df79462c6c3ecdeeee7af99fc269b52ab1aa4828ef3bc359c1837d3fafeeee7 bazel-2.0.0-linux-x86_64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cc7b3ff6f4bfd6bc2121a80656afec66ee57713e8b88e9d2fb58b4eddf271268 bazel-2.0.0-windows-x86_64.exe |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
# Ideally we would place .bazelversion in the top-level so it could be used by | ||
# tools like bazelisk. However, this breaks the nixpkgs provided Bazel | ||
# installation, see https://github.com/NixOS/nixpkgs/issues/80950. | ||
VERSION_EXPECTED="bazel $(cat "$DIR/bazelversion")" | ||
VERSION_ACTUAL=$(bazel version --gnu_format) | ||
# nixpkgs Bazel version ends on '- (@non-git)'. | ||
[[ "$VERSION_ACTUAL" =~ ^"$VERSION_EXPECTED"("- (@non-git)")?$ ]] || { | ||
echo "Expected Bazel version $VERSION_EXPECTED but found $VERSION_ACTUAL." >&2 | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
TOP="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )" | ||
|
||
case "$OSTYPE" in | ||
linux-gnu) OS=linux-x86_64; EXT=;; | ||
darwin) OS=darwin-x86_64; EXT=;; | ||
cygwin|msys|win32) OS=windows-x86_64; EXT=.exe;; | ||
**) echo "Unknown operating system" >&2; exit 1;; | ||
esac | ||
VERSION=$(cat "$TOP/.ci/bazelversion") | ||
INSTALL="$(mktemp -d)" | ||
(cd "$INSTALL" && curl -LO "https://github.com/bazelbuild/bazel/releases/download/$VERSION/bazel-$VERSION-$OS$EXT" >&2) | ||
(cd "$INSTALL" && sha256sum --quiet -c "$TOP/.ci/bazel-$VERSION-$OS$EXT.sha256") >&2 | ||
mv "$INSTALL/bazel-$VERSION-$OS$EXT" "$INSTALL/bazel$EXT" | ||
chmod +x "$INSTALL/bazel$EXT" | ||
echo -n "$INSTALL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
TOP="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )" | ||
|
||
usage() { | ||
cat >&2 <<EOF | ||
USAGE: update-bazel-version VERSION | ||
Updates .ci/bazelversion and .ci/bazel-*.sha256 | ||
EOF | ||
} | ||
trap usage ERR | ||
|
||
if [[ $# -ne 1 ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
VERSION="$1" | ||
echo "$VERSION" >"$TOP/.ci/bazelversion" | ||
mkdir -p "$TOP/.ci" | ||
for OSEXT in windows-x86_64.exe linux-x86_64 darwin-x86_64; do | ||
URL="https://github.com/bazelbuild/bazel/releases/download/$VERSION/bazel-$VERSION-$OSEXT.sha256" | ||
(cd "$TOP/.ci" && curl -LO "$URL") | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Prevent git from automatically introducing \r characters in .sha256 files. | ||
# Otherwise msys sha256sum fails. | ||
*.sha256 binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
#!/bin/sh | ||
|
||
set -eux | ||
|
||
V=2.0.0 | ||
|
||
curl -LO https://github.com/bazelbuild/bazel/releases/download/$V/bazel-$V-installer-linux-x86_64.sh | ||
chmod +x bazel-$V-installer-linux-x86_64.sh | ||
./bazel-$V-installer-linux-x86_64.sh --user | ||
INSTALL="$(.ci/fetch-bazel-bindist)" | ||
mv "$INSTALL" "$HOME/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters