From 3726ba295b487a39bf47950a5b0764821d7f7ed7 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 10 Dec 2024 17:59:36 -0800 Subject: [PATCH 1/6] chore: start testing on Bazel 8 (#972) * chore: start testing on Bazel 8 * fix: add missing preset * fix: don't bother with --enable_workspace * green up * chore: exclude another matrix cell * Update presubmit.yml --- .aspect/bazelrc/bazel8.bazelrc | 1 + .bcr/presubmit.yml | 5 ++++- .github/workflows/ci.yaml | 15 +++++++++++---- BUILD.bazel | 1 + 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 .aspect/bazelrc/bazel8.bazelrc diff --git a/.aspect/bazelrc/bazel8.bazelrc b/.aspect/bazelrc/bazel8.bazelrc new file mode 100644 index 000000000..e01f89719 --- /dev/null +++ b/.aspect/bazelrc/bazel8.bazelrc @@ -0,0 +1 @@ +# No Bazel 8 specific flag presets yet. diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index e63a5721c..2d6a29ace 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -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" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4d9f6017f..8c26a3fa5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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\"" ) @@ -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 @@ -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 @@ -138,7 +148,6 @@ jobs: - name: Verify bcr patches if: matrix.folder == '.' && matrix.bzlmod == '1' && matrix.os == 'ubuntu' && matrix.bazel-version.major != '6' run: patch --dry-run -p1 < .bcr/patches/*.patch - # For branch protection settings, this job provides a "stable" name that can be used to gate PR merges # on "all matrix jobs were successful". conclusion: @@ -147,14 +156,12 @@ jobs: if: always() steps: - uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # v3.0.3 - # Note: possible conclusion values: # https://github.com/technote-space/workflow-conclusion-action/blob/main/src/constant.ts - name: report success if: ${{ env.WORKFLOW_CONCLUSION == 'success' }} working-directory: /tmp run: echo ${{ env.WORKFLOW_CONCLUSION }} && exit 0 - - name: report failure if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }} working-directory: /tmp diff --git a/BUILD.bazel b/BUILD.bazel index c697432f6..4c2c58b59 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -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( From 1007047a53607755af10fcc9685b0540c722b668 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:11:34 -0800 Subject: [PATCH 2/6] chore(deps): update pre-commit hook keith/pre-commit-buildifier to v7 (#1000) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8720965d5..e3bf2d3c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ 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 From 60d7cac5cc59a7592a370c6479c158abbb36a5d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:12:15 -0800 Subject: [PATCH 3/6] chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v5 (#1001) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3bf2d3c4..fe1f8a5d2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 From 7f20608df72e56f98e3b45d8013f3895e6d3b173 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:12:34 -0800 Subject: [PATCH 4/6] chore(deps): update pre-commit hook commitizen-tools/commitizen to v4 (#999) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe1f8a5d2..4eb4eb1a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - 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 From 8d07ac3bfd30dcff3e4ee8bfb17535164948291a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:13:17 -0800 Subject: [PATCH 5/6] chore(deps): update pre-commit hook crate-ci/typos to v1.28.2 (#997) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4eb4eb1a5..6e5ca6f3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: | From 1549b1f82b855ac65ae2db2d045b09b151403e57 Mon Sep 17 00:00:00 2001 From: Corentin Kerisit Date: Wed, 11 Dec 2024 03:13:55 +0100 Subject: [PATCH 6/6] feat(bzlmod): mark toolchains extension as reproducible (#970) --- MODULE.bazel | 2 +- lib/extensions.bzl | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index c5135a076..27c7884fd 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -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") @@ -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) diff --git a/lib/extensions.bzl b/lib/extensions.bzl index 635c9226d..f32c882e7 100644 --- a/lib/extensions.bzl +++ b/lib/extensions.bzl @@ -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") @@ -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 = {