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
Currently @rules_cc//cc/toolchains/actions:compile_actions doesn't contain @rules_cc//cc/toolchains/actions:objc_compile. If I want to define a toolchain that supports objc_compile, I would expect to be able to create cc_args like this:
ERROR: /Users/ksmiley/dev/keith/bazel-cc-toolchain-example/toolchain/llvm/BUILD.bazel:276:8: in_cc_argsrule//toolchain/llvm:user_compile_args2:
Traceback (mostrecentcalllast):
File"/private/var/tmp/_bazel_ksmiley/9ab617f34b5a1a9018f0a6157e69be65/external/rules_cc~/cc/toolchains/args.bzl", line46, column29, in_cc_args_implvalidate_nested_args(
File"/private/var/tmp/_bazel_ksmiley/9ab617f34b5a1a9018f0a6157e69be65/external/rules_cc~/cc/toolchains/impl/args_utils.bzl", line63, column28, invalidate_nested_argstype=get_type(
File"/private/var/tmp/_bazel_ksmiley/9ab617f34b5a1a9018f0a6157e69be65/external/rules_cc~/cc/toolchains/impl/variables.bzl", line132, column21, inget_typefail("The variable {var} is inaccessible from the action {action}. This is required because it is referenced in {nested_label}, which is included by {args_label}, which references that action".format(
Errorinfail: Thevariable @@rules_cc~//cc/toolchains/variables:user_compile_flagsisinaccessiblefromtheaction @@rules_cc~//cc/toolchains/actions:objc_compile. Thisisrequiredbecauseitisreferencedin @@//toolchain/llvm:user_compile_args2, whichisincludedby @@//toolchain/llvm:user_compile_args2, whichreferencesthataction
fail("The variable {var} is inaccessible from the action {action}. This is required because it is referenced in {nested_label}, which is included by {args_label}, which references that action".format(
var=variables[outer].label,
nested_label=nested_label,
args_label=args_label,
action=action.label,
))
it does seem to work as I expect, but I assume that would have some unintended side effects eventually?
My first attempt at this was to override the default feature, which suffered from the same issue.
The text was updated successfully, but these errors were encountered:
Actually this example isn't fixed automatically with that change, since the upstream feature also doesn't have objc-compile in that set. But with my fix I can define my custom feature overriding the default to fix it.
Currently
@rules_cc//cc/toolchains/actions:compile_actions
doesn't contain@rules_cc//cc/toolchains/actions:objc_compile
. If I want to define a toolchain that supportsobjc_compile
, I would expect to be able to createcc_args
like this:But when I do this it fails with:
If I remove the fail
rules_cc/cc/toolchains/impl/variables.bzl
Lines 127 to 136 in 848d56a
My first attempt at this was to override the default feature, which suffered from the same issue.
The text was updated successfully, but these errors were encountered: