From f5705302432b9ee0fe0a6b76708d80a0a242e351 Mon Sep 17 00:00:00 2001 From: Siddhartha Bagaria Date: Sun, 10 Mar 2024 23:20:06 -0700 Subject: [PATCH] Prepare for minimum supported version to be 7.0.0 --- .github/workflows/release_notes_template.txt | 16 +--------------- .github/workflows/tests.yml | 8 +------- MODULE.bazel | 1 + README.md | 3 --- tests/.bazelrc | 1 - tests/scripts/bazel.sh | 11 +---------- tests/scripts/run_xcompile_tests.sh | 1 - tests/transitions.bzl | 1 - 8 files changed, 4 insertions(+), 38 deletions(-) diff --git a/.github/workflows/release_notes_template.txt b/.github/workflows/release_notes_template.txt index 5498f3d7..2367dcd7 100644 --- a/.github/workflows/release_notes_template.txt +++ b/.github/workflows/release_notes_template.txt @@ -1,4 +1,4 @@ -Minimum bazel version: **6.0.0** (6.1.0 if using blzmod) +Minimum bazel version: **7.0.0** If you're using `bzlmod`, add the following to `MODULE.bazel`: @@ -53,17 +53,3 @@ load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains") llvm_register_toolchains() ``` - -And add the following section to your .bazelrc file: - -```sh -# Not needed after https://github.com/bazelbuild/bazel/issues/7260 is closed -build --incompatible_enable_cc_toolchain_resolution - -# For macOS only: - -# Needed for Bazel versions before 7. -# Without this, one can use `--linkopt='-undefined dynamic_lookup'`. -# This feature is intentionally not supported on macOS. -build --features=-supports_dynamic_linker -``` diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c1bcfcf1..aecd0e0b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,14 +28,8 @@ jobs: fail-fast: false matrix: os: [macos-latest, ubuntu-latest] - bazel_version: [6.0.0, 6.1.0, latest] + bazel_version: [7.0.0, latest] # Minimum supported Bazel version is 7.0.0. bzlmod: [true, false] - # bzlmod needs 6.1.0 (issue unrelated to this project) - exclude: - - bazel_version: 6.0.0 - bzlmod: true - - bazel_version: 6.1.0 - bzlmod: false runs-on: ${{ matrix.os }} steps: - if: startsWith(matrix.os, 'ubuntu') diff --git a/MODULE.bazel b/MODULE.bazel index 4030a220..47b2880b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -16,6 +16,7 @@ module( name = "toolchains_llvm", version = "0.0.0", compatibility_level = 0, + bazel_compatibility = [">=7.0.0"], ) bazel_dep(name = "bazel_skylib", version = "1.4.2") diff --git a/README.md b/README.md index 274abe3d..9787ffcd 100644 --- a/README.md +++ b/README.md @@ -113,9 +113,6 @@ For specifying unregistered toolchains on the command line, please use the `--extra_toolchains` flag. For example, `--extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux`. -We no longer support the `--crosstool_top=@llvm_toolchain//:toolchain` flag, -and instead rely on the `--incompatible_enable_cc_toolchain_resolution` flag. - ### Bring Your Own LLVM The following mechanisms are available for using an LLVM toolchain: diff --git a/tests/.bazelrc b/tests/.bazelrc index 5c87221d..e2f73a47 100644 --- a/tests/.bazelrc +++ b/tests/.bazelrc @@ -1,2 +1 @@ -build --incompatible_enable_cc_toolchain_resolution build --features=layering_check diff --git a/tests/scripts/bazel.sh b/tests/scripts/bazel.sh index d2834137..b9639cca 100644 --- a/tests/scripts/bazel.sh +++ b/tests/scripts/bazel.sh @@ -40,25 +40,16 @@ common_args=( "--enable_bzlmod=${USE_BZLMOD:-false}" ) +# shellcheck disable=SC2034 common_test_args=( "${common_args[@]}" "--symlink_prefix=/" - "--incompatible_enable_cc_toolchain_resolution" "--color=yes" "--show_progress_rate_limit=30" "--keep_going" "--test_output=errors" ) -if [[ ${short_uname} == 'Darwin' ]]; then - common_test_args+=( - # Needed for Bazel versions before 7. - # Without this, one can use `--linkopt='-undefined dynamic_lookup'`. - # This feature is intentionally not supported on macOS. - --features=-supports_dynamic_linker - ) -fi - # Do not run autoconf to configure local CC toolchains. export BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 diff --git a/tests/scripts/run_xcompile_tests.sh b/tests/scripts/run_xcompile_tests.sh index 10cb8275..c76dc432 100755 --- a/tests/scripts/run_xcompile_tests.sh +++ b/tests/scripts/run_xcompile_tests.sh @@ -36,7 +36,6 @@ check_with_image() { echo "" echo "Testing static linked user libraries and dynamic linked system libraries" build_args=( - --incompatible_enable_cc_toolchain_resolution --platforms=@toolchains_llvm//platforms:linux-x86_64 --extra_toolchains=@llvm_toolchain_with_sysroot//:cc-toolchain-x86_64-linux --symlink_prefix=/ diff --git a/tests/transitions.bzl b/tests/transitions.bzl index 8d3a0196..23db8d31 100644 --- a/tests/transitions.bzl +++ b/tests/transitions.bzl @@ -95,5 +95,4 @@ dwp_file = rule( default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ), }, - incompatible_use_toolchain_transition = True, )