Skip to content

Commit

Permalink
chore: update for testing Bazel 7 as primary and Bazel 6 as secondary
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Jan 1, 2024
1 parent 07fefdb commit 6dc9051
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
6.2.1
7.0.0
# The first line of this file is used by Bazelisk and Bazel to be sure
# the right version of Bazel is used to build and test this repo.
# This also defines which version is used on CI.
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:

jobs:
test:
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@b134b73fcae522bc77dcc03533d3de20b45714bf
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@9335e79f9bc9a88891d4c6ea23cdf1aa69610eab
with:
folders: |
[
Expand All @@ -27,7 +27,6 @@ jobs:
exclude: |
[
{"folder": ".", "bzlmodEnabled": false},
{"bazelversion": "5.4.0", "bzlmodEnabled": true},
{"bazelversion": "5.4.0", "os": "macos-latest"},
{"bazelversion": "5.4.0", "os": "windows-latest"},
{"bazelversion": "6.4.0", "os": "macos-latest"},
{"bazelversion": "6.4.0", "os": "windows-latest"},
]
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ default_language_version:
repos:
# Check formatting and lint for starlark code
- repo: https://github.com/keith/pre-commit-buildifier
rev: 6.1.0.1
rev: 6.4.0
hooks:
- id: buildifier
- id: buildifier-lint
Expand Down
14 changes: 7 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ module(
compatibility_level = 1,
)

bazel_dep(name = "bazel_skylib", version = "1.4.1")
bazel_dep(name = "platforms", version = "0.0.5")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "platforms", version = "0.0.8")

bazel_dep(name = "gazelle", version = "0.29.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.4.1", dev_dependency = True)
bazel_dep(name = "aspect_bazel_lib", version = "1.32.1", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "6.1.2", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.35.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "aspect_bazel_lib", version = "2.1.0", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)

mylang = use_extension("//mylang:extensions.bzl", "mylang")
mylang.toolchain(mylang_version = "1.14.2")
mylang.toolchain(mylang_version = "1.2.3")
use_repo(mylang, "mylang_toolchains")

register_toolchains("@mylang_toolchains//:all")
2 changes: 1 addition & 1 deletion mylang/private/versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TODO: generate this file from GitHub API"""
# The integrity hashes can be computed with
# shasum -b -a 384 [downloaded file] | awk '{ print $1 }' | xxd -r -p | base64
TOOL_VERSIONS = {
"1.14.2": {
"1.2.3": {
"x86_64-apple-darwin": "sha384-ws4+rANvv0YxM1SgIBUXSG9jT8dKw83nls6R5qYkEKzPUB+viBIEozSsyq2e6i+f",
"aarch64-apple-darwin": "sha384-HcvJbxoJtGSavkGu0e7CyD00cBlmDb0TBWJ4JSaNa70zuU3N7XlMOYm3bbQcAv2U",
"x86_64-pc-windows-msvc": "sha384-35YN6TKpT0L9qyRBmq48NucvyXEtHnkeC+txf2YZmmJTmOzrAKREA74BA0EZvpar",
Expand Down
6 changes: 3 additions & 3 deletions mylang/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def rules_mylang_dependencies():
# The minimal version of bazel_skylib we require
http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
urls = [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
],
)

Expand Down
2 changes: 1 addition & 1 deletion mylang/tests/versions_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load("//mylang/private:versions.bzl", "TOOL_VERSIONS")

def _smoke_test_impl(ctx):
env = unittest.begin(ctx)
asserts.equals(env, "1.14.2", TOOL_VERSIONS.keys()[0])
asserts.equals(env, "1.2.3", TOOL_VERSIONS.keys()[0])
return unittest.end(env)

# The unittest library requires that we export the test cases as named test rules,
Expand Down

0 comments on commit 6dc9051

Please sign in to comment.