Skip to content

Commit 9c59946

Browse files
[bazel][test] Continue fixing bazel build from 97dee78 (#141336)
this continues the work in 0967a6f by generating a header from clang-tools-extra/unittests/clang-doc/config.h.cmake not clear all the tests pass yet, but fixes this build error at least: ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/6a1efeb401da192d3572f00e2f11245b/external/llvm-project/clang-tools-extra/unittests/BUILD.bazel:57:8: Compiling clang-tools-extra/unittests/clang-doc/HTMLMustacheGeneratorTest.cpp failed: (Exit 1): clang failed: error executing CppCompile command (from target @@llvm-project//clang-tools-extra/unittests:clang_doc_test) /usr/lib/llvm-18/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer ... (remaining 328 arguments skipped) Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging external/llvm-project/clang-tools-extra/unittests/clang-doc/HTMLMustacheGeneratorTest.cpp:12:10: fatal error: 'config.h' file not found 12 | #include "config.h" | ^~~~~~~~~~ 1 error generated.
1 parent a4031db commit 9c59946

File tree

1 file changed

+18
-1
lines changed
  • utils/bazel/llvm-project-overlay/clang-tools-extra/unittests

1 file changed

+18
-1
lines changed

utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# See https://llvm.org/LICENSE.txt for license information.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5+
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
56
load("@rules_cc//cc:defs.bzl", "cc_test")
67

78
package(
@@ -54,6 +55,20 @@ cc_test(
5455
],
5556
)
5657

58+
expand_template(
59+
name = "clang_doc_config_h",
60+
out = "clang-doc/config.h",
61+
substitutions = {
62+
"#define CLANG_DOC_TEST_ASSET_DIR \"${CLANG_DOC_TEST_ASSET_DIR}\"": "#define CLANG_DOC_TEST_ASSET_DIR \"clang-tools-extra/clang-doc/assets\"",
63+
},
64+
template = "clang-doc/config.h.cmake",
65+
)
66+
67+
cc_library(
68+
name = "clang_doc_config",
69+
hdrs = ["clang-doc/config.h"],
70+
)
71+
5772
cc_test(
5873
name = "clang_doc_test",
5974
size = "small",
@@ -63,10 +78,12 @@ cc_test(
6378
"clang-doc/*.h",
6479
],
6580
allow_empty = False,
81+
exclude = ["clang-doc/config.h"],
6682
),
6783
data = ["//clang-tools-extra/clang-doc:assets"],
68-
local_defines = ['CLANG_DOC_TEST_ASSET_DIR=\\"clang-tools-extra/clang-doc/assets\\"'],
84+
includes = ["clang-doc"],
6985
deps = [
86+
":clang_doc_config",
7087
"//clang:ast",
7188
"//clang:basic",
7289
"//clang-tools-extra/clang-doc:generators",

0 commit comments

Comments
 (0)