Skip to content
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

Use bazel 6 in the CI #1911

Merged
merged 6 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ build:ci --incompatible_load_proto_rules_from_bzl
# https://github.com/tweag/rules_haskell/issues/1657
build: --incompatible_override_toolchain_transition

# This flag will become the default in bazel 7
# https://github.com/bazelbuild/bazel/issues/17032
build --incompatible_disable_starlark_host_transitions

coverage --build_tag_filters "coverage-compatible" --test_tag_filters "coverage-compatible" --test_output=all

# To update these lines, execute
Expand Down
1 change: 0 additions & 1 deletion .ci/bazel-5.2.0-darwin-x86_64.sha256

This file was deleted.

1 change: 0 additions & 1 deletion .ci/bazel-5.2.0-linux-x86_64.sha256

This file was deleted.

1 change: 0 additions & 1 deletion .ci/bazel-5.2.0-windows-x86_64.exe.sha256

This file was deleted.

1 change: 1 addition & 0 deletions .ci/bazel-6.2.0-darwin-x86_64.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d2356012843ce3a2fbba89f88191673a6ad2f7716cc46ad43ec1bcee78d36b44 bazel-6.2.0-darwin-x86_64
1 change: 1 addition & 0 deletions .ci/bazel-6.2.0-linux-x86_64.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3d11c26fb9ba12c833844450bb90165b176e8a19cb5cf5923f3cec855837f17c bazel-6.2.0-linux-x86_64
1 change: 1 addition & 0 deletions .ci/bazel-6.2.0-windows-x86_64.exe.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3d119e934ffb26910fcbd44dbc5973761480f58d3a06722cb84a90e16d8c5727 bazel-6.2.0-windows-x86_64.exe
2 changes: 1 addition & 1 deletion .ci/bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.0
6.2.0
11 changes: 4 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ rules_proto_dependencies()
rules_proto_toolchains()

# For buildifier
# starting from 0.29, rules_go requires bazel >= 4.2.0
http_archive(
name = "io_bazel_rules_go",
sha256 = "8e968b5fcea1d2d64071872b12737bbb5514524ee5f0a4f54f5920266c261acb",
sha256 = "6dc2da7ab4cf5d7bfc7c949776b1b7c733f05e56edc4bcd9022bb249d2e2a996",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
],
)

Expand Down Expand Up @@ -104,9 +103,7 @@ load(

go_rules_dependencies()

# If in nix-shell, use the Go SDK provided by Nix.
# Otherwise, ask Bazel to download a Go SDK.
go_register_toolchains(version = "1.16.2")
go_register_toolchains(version = "1.20.2")

load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_dependencies")

Expand Down
2 changes: 1 addition & 1 deletion haskell/asterius/asterius_dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _nixpkgs_nodejs(name, nix_repository, nixpkgs_package_rule):
# https://github.com/bazelbuild/bazel/issues/2927.
nix_file_content = """
with import <nixpkgs> {{ config = {{}}; overlays = []; }};
runCommand "nodejs-rules_haskell" {{ buildInputs = [ nodejs-16_x ]; }} ''
runCommand "nodejs-rules_haskell" {{ buildInputs = [ nodejs-18_x ]; }} ''
mkdir -p $out
cd $out
for i in ${{nodejs}}/*; do ln -s $i; done
Expand Down
2 changes: 1 addition & 1 deletion haskell/private/versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
SUPPORTED_BAZEL_VERSIONS = [
"5.0.0",
"5.2.0",
"6.0.0",
"6.2.0",
]

SUPPORTED_NIXPKGS_BAZEL_PACKAGES = [
Expand Down
4 changes: 2 additions & 2 deletions haskell/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ load(
"check_bazel_version_compatible",
)

_rules_nixpkgs_version = "fb0e76e093c6ba7987ea4276027507a0d6dceb06"
_rules_nixpkgs_sha256 = "a8f20854da16156bd4e0d53d13dfb0d3360ee43c5ce764f0dc60703ab2b910e5"
_rules_nixpkgs_version = "0c1f8f5470c7f292b7620762e224f53d837929d3"
_rules_nixpkgs_sha256 = "9e3898a33c5f21f634aa9e2d45620e7c4b6d54d16d473571a891193bbd4725ca"

_rules_sh_version = "v0.3.0"
_rules_sh_sha256 = "d668bb32f112ead69c58bde2cae62f6b8acefe759a8c95a2d80ff6a85af5ac5e"
Expand Down
6 changes: 3 additions & 3 deletions nixpkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ ... }@args:
let
# 2023-01-03
sha256 = "1213j2gvsmzmhpyi2jyn729s9d0gbn56k3d873iknd5ilb2rvpcr";
rev = "73247c5ab2bc2037d7dd0d310f1fb43ed191edad";
# 2023-05-22
sha256 = "1lbr19fbh16n5ikgh9lzpscn83kr3w6hwx6md4k1iyxd7vx7zz0j";
rev = "02df300699f8e4c24b39eeb7e034403880715dc5";
in
import (fetchTarball {
inherit sha256;
Expand Down
11 changes: 4 additions & 7 deletions rules_haskell_tests/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ rules_proto_dependencies()
rules_proto_toolchains()

# For buildifier
# starting from 0.29, rules_go requires bazel >= 4.2.0
http_archive(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ylecornec do you know which Bazel version rules_go 0.39.1 requires? AFAIK, 0.35 requires at least Bazel 5.1, so we might want to note somewhere that we require at least version x.y for developing on this repo? Or just use a .bazelversion file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah indeed, it requires at least Bazel 5.3.

Release 0.38 is the one with the fix for incompatible_disable_starlark_host_transitions and requiring this version.

name = "io_bazel_rules_go",
sha256 = "8e968b5fcea1d2d64071872b12737bbb5514524ee5f0a4f54f5920266c261acb",
sha256 = "6dc2da7ab4cf5d7bfc7c949776b1b7c733f05e56edc4bcd9022bb249d2e2a996",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
],
)

Expand Down Expand Up @@ -165,9 +164,7 @@ load(

go_rules_dependencies()

# If in nix-shell, use the Go SDK provided by Nix.
# Otherwise, ask Bazel to download a Go SDK.
go_register_toolchains(version = "host") if is_nix_shell else go_register_toolchains(version = "1.16.2")
go_register_toolchains(version = "1.20.2")

load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_dependencies")

Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mkShell {
file
] ++ lib.optionals docTools [graphviz python39Packages.sphinx zip unzip];

packages = [ bazel_5 ];
packages = [ bazel_6 ];

shellHook = ''
# Add nix config flags to .bazelrc.local.
Expand Down
2 changes: 1 addition & 1 deletion start
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readonly MIN_BAZEL_MAJOR=5
readonly MIN_BAZEL_MINOR=0

readonly MAX_BAZEL_MAJOR=6
readonly MAX_BAZEL_MINOR=0
readonly MAX_BAZEL_MINOR=2

stderr () {
>&2 echo "$*"
Expand Down