XNNPACK icon indicating copy to clipboard operation
XNNPACK copied to clipboard

Bug: define_build_option function has logic error in native.alias

Open ELundby45 opened this issue 8 months ago • 3 comments

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,
    }),
)

ELundby45 avatar Mar 12 '26 17:03 ELundby45

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.

RohanMali2003 avatar Jul 20 '26 15:07 RohanMali2003

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! :)

RohanMali2003 avatar Jul 20 '26 15:07 RohanMali2003

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.

dsharlet avatar Jul 20 '26 17:07 dsharlet