Skip to content

Commit

Permalink
Prepare for minimum supported version to be 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthab committed Mar 11, 2024
1 parent b05a15b commit f570530
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 38 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/release_notes_template.txt
Original file line number Diff line number Diff line change
@@ -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`:

Expand Down Expand Up @@ -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
```
8 changes: 1 addition & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion tests/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
build --incompatible_enable_cc_toolchain_resolution
build --features=layering_check
11 changes: 1 addition & 10 deletions tests/scripts/bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/scripts/run_xcompile_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=/
Expand Down
1 change: 0 additions & 1 deletion tests/transitions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,4 @@ dwp_file = rule(
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
),
},
incompatible_use_toolchain_transition = True,
)

0 comments on commit f570530

Please sign in to comment.