Skip to content

Commit e1c2f74

Browse files
committed
First cov with clang20 on linux
1 parent ec8075f commit e1c2f74

File tree

4 files changed

+78
-10
lines changed

4 files changed

+78
-10
lines changed

cc/toolchains/llvm20/llvm.BUILD.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ filegroup(
6666
"lib/libclang*.a",
6767
"lib/liblld*.a",
6868
],
69+
allow_empty = True,
6970
),
7071
# Do not include the .dylib files in the linker sandbox because they will
7172
# not be available at runtime. Any library linked from the toolchain should

test/small_world/.bazelrc

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,67 @@
11
common --@rules_swiftnav//cc:enable_bzlmod=true
2+
3+
# # build:use_llvm20 --platforms=@rules_swiftnav//platforms:x86_64_darwin_llvm20
4+
# # build:use_llvm20 --platforms=@rules_swiftnav//platforms:aarch64_darwin_llvm20
5+
# build:use_llvm20 --platforms=@rules_swiftnav//platforms:x86_64_linux_llvm20
6+
# # build:use_llvm20 --platforms=@rules_swiftnav//platforms:aarch64_linux_llvm20
7+
8+
build:coverage_x86_64_linux --platforms=@rules_swiftnav//platforms:x86_64_linux_llvm20
9+
10+
build:coverage_aarch64_darwin --platforms=@rules_swiftnav//platforms:aarch64_darwin_llvm20
11+
12+
# # Overrides our custom toolchain and uses the system
13+
# build:system --noincompatible_enable_cc_toolchain_resolution
14+
15+
# build:system --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN="0"
16+
17+
# build:system --platform_suffix=system
18+
19+
# # build --config=system
20+
# build --nojava_deps
21+
# build --define=BAZEL_USE_SYSTEM_ZLIB=1
22+
# build --spawn_strategy=local
23+
# build --strategy=Genrule=local
24+
# build --strategy=CppCompile=local
25+
# build --strategy=TestRunner=local
26+
# build --strategy=Javac=local
27+
# build --strategy=Closure=local
28+
# build --strategy=GoCompile=local
29+
# build --strategy=GoLink=local
30+
# build --strategy=GoTest=local
31+
# build --strategy=GoVet=local
32+
# build --strategy=ObjcCompile=local
33+
# build --strategy=ObjcLink=local
34+
# build --strategy=SwiftCompile=local
35+
# build --strategy=Dart=local
36+
# build --strategy=Worker=local
37+
# build --strategy=ProtoCompile=local
38+
# build --strategy=PyCompile=local
39+
# build --strategy=PyTest=local
40+
# build --strategy=TypeScriptCompile=local
41+
# build --strategy=TypeScriptTest=local
42+
43+
# test --spawn_strategy=local
44+
# test --strategy=TestRunner=local
45+
46+
coverage --spawn_strategy=local
47+
coverage --strategy=TestRunner=local
48+
coverage --action_env=COVERAGE_GCOV_PATH="/opt/homebrew/opt/llvm/bin/llvm-profdata"
49+
coverage --action_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1
50+
coverage --action_env=GCOV_PREFIX_STRIP=10
51+
coverage --cxxopt=-mllvm
52+
coverage --copt=-mllvm
53+
coverage --cxxopt=-system-headers-coverage
54+
coverage --copt=-system-headers-coverage
55+
56+
57+
58+
# bazel coverage --config=coverage_aarch64_darwin //src/base_math:base_math_test --subcommands
59+
60+
61+
# on ubuntu!
62+
# 1.
63+
# bazel coverage --config=coverage_x86_64_linux //src/base_math:base_math_test --subcommands --experimental_generate_llvm_lcov --combined_report=lcov
64+
# 2.
65+
# /home/jenkins/.cache/bazel/_bazel_jenkins/5a7b992760bae9ecbea2fa12e457bcb7/execroot/_main/bazel-out/_coverage/_coverage_report.dat
66+
# copy
67+
# 3. genhtml --output html cov.dat

test/small_world/MODULE.bazel

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ local_path_override(
1010
swift_cc_toolchain_ext = use_extension("@rules_swiftnav//cc:extensions.bzl", "swift_cc_toolchain_extension")
1111
use_repo(
1212
swift_cc_toolchain_ext,
13-
"aarch64-darwin-llvm",
14-
"aarch64-linux-llvm",
13+
"aarch64-darwin-llvm20",
14+
"aarch64-linux-llvm20",
1515
"aarch64-sysroot",
16-
"x86_64-darwin-llvm",
17-
"x86_64-linux-llvm",
16+
"x86_64-darwin-llvm20",
17+
"x86_64-linux-llvm20",
1818
"x86_64-sysroot",
1919
)
2020

2121
register_toolchains(
22-
"@rules_swiftnav//cc/toolchains/llvm/aarch64-darwin:cc-toolchain-aarch64-darwin",
23-
"@rules_swiftnav//cc/toolchains/llvm/x86_64-darwin:cc-toolchain-x86_64-darwin",
24-
"@rules_swiftnav//cc/toolchains/llvm/aarch64-linux:cc-toolchain-aarch64-linux",
25-
"@rules_swiftnav//cc/toolchains/llvm/x86_64-linux:cc-toolchain-x86_64-linux",
22+
"@rules_swiftnav//cc/toolchains/llvm20/aarch64-darwin:cc-toolchain-aarch64-darwin",
23+
"@rules_swiftnav//cc/toolchains/llvm20/x86_64-darwin:cc-toolchain-x86_64-darwin",
24+
"@rules_swiftnav//cc/toolchains/llvm20/aarch64-linux:cc-toolchain-aarch64-linux",
25+
"@rules_swiftnav//cc/toolchains/llvm20/x86_64-linux:cc-toolchain-x86_64-linux",
2626
)
2727

2828
bazel_dep(name = "googletest", version = "1.16.0")

test/small_world/MODULE.bazel.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)