Commit 8e5b772
committed
[feat] clang-tidy: add optional gcc-install-dir arg
Without the argument, clang (clang-tidy) discovers a gcc installation
automatically on the system, for example,
```
% clang -v
Ubuntu clang version 18.1.8 (++20240731024944+3b5b5c1ec4a3-1~exp1~20240731145000.144)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13
```
However, users may want to switch off the discovery and specify a
version, exactly.
```
% clang -v --gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/12
Ubuntu clang version 18.1.8 (++20240731024944+3b5b5c1ec4a3-1~exp1~20240731145000.144)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
```
This is especially relevant for, but not limited to, hermetic
toolchains.
See also
This patch ports erenon/bazel_clang_tidy#88
to rules_lint.1 parent 1e2f794 commit 8e5b772
1 file changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
265 | 274 | | |
266 | 275 | | |
267 | 276 | | |
| |||
409 | 418 | | |
410 | 419 | | |
411 | 420 | | |
412 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
413 | 430 | | |
414 | 431 | | |
415 | 432 | | |
| |||
427 | 444 | | |
428 | 445 | | |
429 | 446 | | |
| 447 | + | |
| 448 | + | |
430 | 449 | | |
431 | 450 | | |
432 | 451 | | |
| |||
455 | 474 | | |
456 | 475 | | |
457 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
458 | 481 | | |
459 | 482 | | |
460 | 483 | | |
| |||
0 commit comments