Skip to content

Commit 2f08d74

Browse files
authored
Avoid spurious warning in system_module_map when no sysroot is configured (#584)
1 parent 61481de commit 2f08d74

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

toolchain/internal/system_module_map.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ def _system_module_map(ctx):
7070
path = paths.normalize(sysroot_files[0].path).replace("//", "/")
7171
template_dict.add("%sysroot%", _umbrella_submodule(execroot_prefix + path))
7272
else:
73-
print("WARNING: Sysroot {} did not resolve to a single (directory) file. Consider using the `sysroot` repository rule in @toolchains_llvm//toolchain:sysroot.bzl for more efficient builds.".format(ctx.attr.sysroot_files.label)) # buildifier: disable=print
73+
if sysroot_files:
74+
# buildifier: disable=print
75+
print("WARNING: Sysroot {} resolved to {} files. Consider using the `sysroot` repository rule in @toolchains_llvm//toolchain:sysroot.bzl which provides a single-file (directory) sysroot for more efficient builds.".format(
76+
ctx.attr.sysroot_files.label,
77+
len(sysroot_files),
78+
))
7479
template_dict.add_joined(
7580
"%sysroot%",
7681
ctx.attr.sysroot_files[DefaultInfo].files,

0 commit comments

Comments
 (0)