Stop transitioning on `--use_target_platform_for_tests` on Bazel 10+ (#4404)

Bazel 10 moved `--use_target_platform_for_tests` to the command line
graveyard, so it is no longer a valid Starlark transition output and
`collector_platform_test` fails analysis on rolling:
```
transition outputs [//command_line_option:use_target_platform_for_tests] do not correspond to valid settings
```

This change only sets the flag on Bazel versions without the default
test toolchain. From Bazel 9 the test already enables
`incompatible_use_default_test_toolchain`, which selects the test
execution platform on its own, and `False` was the default everywhere,
so 7.4.1 and 8.x are unchanged.

Verified with `bazel test //test/unit/coverage/...` on 9.3.2 and rolling
(`11.0.0-pre.20261028.2`).

https://github.com/bazelbuild/bazel/commit/32f9cf1893
1 file changed
tree: 96acb38e1846f16f3f105378fb576b4e79415c7b
  1. .bazelci/
  2. .bcr/
  3. .github/
  4. cargo/
  5. crate_universe/
  6. docs/
  7. examples/
  8. extensions/
  9. ffi/
  10. nix/
  11. rust/
  12. test/
  13. tools/
  14. util/
  15. .bazelignore
  16. .bazelrc
  17. .clang-format
  18. .clippy.toml
  19. .envrc
  20. .gitattributes
  21. .gitignore
  22. .pre-commit-config.yaml
  23. .prettierrc.toml
  24. .rustfmt.toml
  25. .typos.toml
  26. ARCHITECTURE.md
  27. AUTHORS
  28. BUILD.bazel
  29. CODEOWNERS
  30. COMPATIBILITY.md
  31. CONTRIBUTING.md
  32. CONTRIBUTORS
  33. LICENSE.txt
  34. MODULE.bazel
  35. README.md
  36. version.bzl
  37. WORKSPACE.bazel
README.md

Rust Rules

  • Postsubmit Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Starter repo

The fastest way to try this in an empty project is to click the green “Use this template” button on https://github.com/bazel-starters/rust.

Community

General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust.

Documentation

Please refer to the full documentation.