You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR: /home/tbirch/.cache/bazel/_bazel_tbirch/5dac0c5eac9fcd76e48829b4e488238f/external/proj/BUILD.bazel:12:10: in cmake rule @@proj//:proj_/proj:
Traceback (most recent call last):
File "/home/tbirch/.cache/bazel/_bazel_tbirch/5dac0c5eac9fcd76e48829b4e488238f/external/rules_foreign_cc/foreign_cc/cmake.bzl", line 190, column 33, in _cmake_impl
return cc_external_rule_impl(ctx, attrs)
File "/home/tbirch/.cache/bazel/_bazel_tbirch/5dac0c5eac9fcd76e48829b4e488238f/external/rules_foreign_cc/foreign_cc/private/framework.bzl", line 392, column 30, in cc_external_rule_impl
outputs = _define_outputs(ctx, attrs, lib_name)
File "/home/tbirch/.cache/bazel/_bazel_tbirch/5dac0c5eac9fcd76e48829b4e488238f/external/rules_foreign_cc/foreign_cc/private/framework.bzl", line 738, column 21, in _define_outputs
_check_file_name(lib_name)
File "/home/tbirch/.cache/bazel/_bazel_tbirch/5dac0c5eac9fcd76e48829b4e488238f/external/rules_foreign_cc/foreign_cc/private/framework.bzl", line 710, column 17, in _check_file_name
fail("Symbol '%s' is forbidden in library name '%s'." % (letter, var))
Error in fail: Symbol '/' is forbidden in library name 'proj_/proj'.
ERROR: /home/tbirch/.cache/bazel/_bazel_tbirch/5dac0c5eac9fcd76e48829b4e488238f/external/proj/BUILD.bazel:12:10: Analysis of target '@@proj//:proj_/proj' failed
If I apply this diff to with_cfg.bzl, then everything builds fine:
That workaround is probably fine for your use case, but it would break other rules: with_cfg uses a subdirectory to have the original target use the same basename as the transitioned target, which can play a role for e.g. shared library names.
Since rules should generally support subdirs in name, the best solution would be to fix this in rules_foreign_cc. I will see whether I can send a PR.
I defined
cmake_opt, _cmake_opt_internal = with_cfg(cmake).set("compilation_mode", "opt").build()
and then declared a rule for proj like so:but that gives the following error:
If I apply this diff to with_cfg.bzl, then everything builds fine:
The text was updated successfully, but these errors were encountered: