-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define Bazel version in one shared location #1252
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we fix this in nixpkgs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would also fix this issue, so that would be good. Though, I don't think we need to block this PR on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that’s already fixed by the changes in NixOS/nixpkgs#80739 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC that PR changes
bazel-real
forbazel-VERSION...
, so it fixes NixOS/nixpkgs#80950, but doesn't change the- (@non-git)
part. (Unless Bazel 2.1 does that, I haven't checked).