Bug: define_build_option function has logic error in native.alias
Summary
The define_build_option function in ynnpack/build_defs.bzl has a logic error in the native.alias definition (around line 33-41).
Issue
When the explicit_false condition is selected, the alias incorrectly points to ":" + explicit_true instead of ":" + explicit_false:
native.alias(
name = name,
actual = select({
explicit_true: ":" + explicit_true,
explicit_false: ":" + explicit_true, # ← BUG: should be explicit_false
"//conditions:default": ":" + default,
}),
)
Hi! I would like to work on this issue- I'll just replace explicit_true with explicit_false in the alias and check if it works; I'll get a PR open for this fix shortly.
I have submitted a PR to fix this! The alias mapping for explicit_false has been corrected. Pls review and let me know if any changes are required! :)
Sorry I didn't notice this issue. I think this is correct, bazel is just weird. See discussion on https://github.com/google/XNNPACK/pull/10189 for an explanation.