I'm trying to add some Bazel rules for building pre-processed data for build releases of the ICU library. Currently, I have a very basic set of BUILD files (still work-in-progress) to help complete the gennorm2
target.
icu4c/source/common/BUILD
looks something like:
cc_library(
name = "headers",
hdrs = glob([
"unicode/*.h", # public
"*.h", # internal
]),
includes = [
"icu4c/source",
"icu4c/source/common",
],
local_defines = [
"U_COMMON_IMPLEMENTATION",
],
)
...
cc_library(
name = "normalizer2",
srcs = [
"normalizer2.cpp",
"normalizer2impl.cpp",
],
hdrs = [
"normalizer2impl.h",
],
)
...
icu4c/source/tools/gennorm2/BUILD
contains:
cc_binary(
name = "gennorm2",
srcs = glob([
"*.c",
"*.cpp",
"*.h", # cannot have hdrs section in cc_binary
]),
deps = [
"//icu4c/source/common:hash",
"//icu4c/source/common:normalizer2",
"//icu4c/source/common:umutablecptrie",
"//icu4c/source/common:ucptrie",
"//icu4c/source/common:platform",
"//icu4c/source/common:headers",
],
)
The error that I get from building looks like:
$ bazelisk build //icu4c/source/tools/gennorm2
...
In file included from icu4c/source/tools/gennorm2/gennorm2.cpp:23:
icu4c/source/tools/gennorm2/n2builder.h:29:10: fatal error: normalizer2impl.h: No such file or directory
29 | #include "normalizer2impl.h" // for IX_COUNT
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
Target //icu4c/source/tools/gennorm2:gennorm2 failed to build
...
Querying for the dependencies seems to indicate that the correct files are included:
$ bazel query 'deps(//icu4c/source/tools/gennorm2)' --nohost_deps --noimplicit_deps | grep normalizer
Loading: 0 packages loaded
//icu4c/source/common:normalizer2
Loading: 0 packages loaded
//icu4c/source/common:normalizer2impl.cpp
//icu4c/source/common:normalizer2.cpp
//icu4c/source/common:unicode/normalizer2.h
//icu4c/source/common:normalizer2impl.h
Loading: 0 packages loaded
What am I missing in my configurations? Is it a problem in an includes
key config for a target somewhere?