Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle authored Dec 11, 2024
2 parents ad6d72d + 1549b1f commit 57780e6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions .aspect/bazelrc/bazel8.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# No Bazel 8 specific flag presets yet.
5 changes: 4 additions & 1 deletion .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ bcr_test_module:
module_path: "e2e/smoke"
matrix:
platform: ["debian10", "macos", "ubuntu2004", "windows"]
bazel: ["7.x", "6.x"]
bazel:
- 6.x
- 7.x
- 8.x
tasks:
run_tests:
name: "Run test module"
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
v=$(head -n 1 .bazelversion)
m=${v::1}
a=(
"major:8, version:\"last_rc\""
"major:$m, version:\"$v\""
"major:6, version:\"6.5.0\""
)
Expand Down Expand Up @@ -71,6 +72,10 @@ jobs:
# Root workspace is bzlmod-only
- folder: .
bzlmod: 0
# FIXME: root workspace not compatible with Bazel 8
- folder: .
bazel-version:
major: 8
# Don't test MacOS and Windows against secondary bazel version to minimize minutes (billed at 10X and 2X respectively)
# https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
- os: macos
Expand All @@ -79,7 +84,12 @@ jobs:
- os: windows
bazel-version:
major: 6
# Don't run bzlmod tests with Bazel 6 to reduce the size of the test matrix
# Reduce size of the test matrix:
# Don't run workspace tests with Bazel 8
# Don't run bzlmod tests with Bazel 6
- bazel-version:
major: 8
bzlmod: 0
- bazel-version:
major: 6
bzlmod: 1
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ default_stages: [commit]
repos:
# Check formatting and lint for starlark code
- repo: https://github.com/keith/pre-commit-buildifier
rev: 6.4.0
rev: 7.3.1
hooks:
- id: buildifier
- id: buildifier-lint
# Enforce that commit messages allow for later changelog generation
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.24.0
rev: v4.1.0
hooks:
# Requires that commitizen is already installed
- id: commitizen
Expand All @@ -24,7 +24,7 @@ repos:
hooks:
- id: prettier
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
Expand All @@ -36,7 +36,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/crate-ci/typos
rev: v1.23.2
rev: v1.28.2
hooks:
- id: typos
exclude: |
Expand Down
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ assert_contains(
name = "bazel_version_test",
actual = ".bazelversion",
expected = str(host.bazel_version),
target_compatible_with = [] if host.bazel_version.startswith("7") else ["@platforms//:incompatible"],
)

bzl_library(
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module(
)

# Lower-bounds (minimum) versions for direct runtime dependencies
bazel_dep(name = "bazel_features", version = "1.9.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "platforms", version = "0.0.10")

Expand Down Expand Up @@ -79,4 +80,3 @@ use_repo(host_platform, "host_platform")
bazel_dep(name = "aspect_rules_lint", version = "1.0.0-rc10", dev_dependency = True)
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
bazel_dep(name = "bazel_features", version = "0.2.0", dev_dependency = True)
6 changes: 6 additions & 0 deletions lib/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ load(
"register_yq_toolchains",
"register_zstd_toolchains",
)
load("@bazel_features//:features.bzl", "bazel_features")
load("//lib/private:extension_utils.bzl", "extension_utils")
load("//lib/private:host_repo.bzl", "host_repo")

Expand Down Expand Up @@ -117,6 +118,11 @@ def _toolchains_extension_impl(mctx):
get_version_fn = lambda attr: attr.core_version,
)

if bazel_features.external_deps.extension_metadata_has_reproducible:
return mctx.extension_metadata(reproducible = True)

return mctx.extension_metadata()

toolchains = module_extension(
implementation = _toolchains_extension_impl,
tag_classes = {
Expand Down

0 comments on commit 57780e6

Please sign in to comment.