Commit 5faf36e
authored
Restrict XOR python export targets to fbcode (#19316)
Summary:
`xplat/executorch/extension/training/examples/XOR/BUCK` invokes
`define_common_targets()` for both fbcode (`fbcode_target`) and xplat
(`non_fbcode_target`). The python targets in this example
(`model`, `export_model_lib`, `export_model`) depend on
`//caffe2:torch` and `//executorch/exir:lib`, neither of which is
defined as an xplat target — `xplat/executorch/exir/BUCK` only
declares the `:lib` target via `fbcode_target(...)`. As a result the
xplat configuration of
`fbsource//xplat/executorch/extension/training/examples/XOR:export_model`
fails analysis with:
Unknown target `lib` from package `fbsource//xplat/executorch/exir`.
Did you mean one of the 0 targets in
fbsource//xplat/executorch/exir:BUCK?
This produced 218/218 BUILD_RULE failures on the
`fbsource//xplat/executorch/extension/training/examples/XOR:export_model`
target with no successful run on record (linked to T168807700).
Wrap the three python rules with `if not is_xplat():` so they only
register when called from fbcode, matching the established precedent
in `xplat/executorch/kernels/portable/test/targets.bzl`. The
`train_xor` C++ binary continues to be defined for both cells since
its dependencies are xplat-compatible.
Differential Revision: D1039515551 parent 0f9de6a commit 5faf36e
1 file changed
Lines changed: 30 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
0 commit comments