Add remaining clang symlinks and test them (#5050)

We only had the single `clang` symlink, but in case its useful to use
the toolchain with some other build system that expects `clang++`, or
even `clang-cl` or `clang-cpp`, fill in the rest of the symlinks.

The different `clang` flavors don't really need anything to support in
the subcommand as there is already an excellent way to get the exact
behavior of these names using Clang's `--driver-mode` flag, so these
just use that. That makes this change really *only* about busybox
behavior.

We don't really have a dedicated test path for things that are only
exposed via the symlinks, so I've added a simple Python integration test
we can use for that. I can backfill some testing of other symlinks if
useful (the `ld.lld` one might be worthwhile), although there is minimal
interesting logic to cover there.
This commit is contained in:
Chandler Carruth
2025-03-05 03:09:45 +00:00
committed by GitHub
parent 659808429a
commit ca2ef22476
4 changed files with 132 additions and 9 deletions
+4 -1
View File
@@ -34,9 +34,12 @@ def log(s: str) -> None:
def filter_targets(bazel: Path, targets: str) -> str:
# Need to quote targets for inclusion in another query.
quoted_targets = "\n".join([f'"{t}"' for t in targets.splitlines()])
with tempfile.NamedTemporaryFile(mode="w+") as tmp:
query = (
f"let t = set({targets}) in "
f"let t = set({quoted_targets}) in "
"kind(rule, $t) except attr(tags, manual, $t)\n"
)
query_lines = query.splitlines()