Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion backends/cadence/aot/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ load(
"CXX",
)
load("@fbsource//xplat/executorch/codegen:codegen.bzl", "executorch_generated_lib")
load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension")

oncall("odai_jarvis")

Expand Down
6 changes: 3 additions & 3 deletions codegen/tools/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def define_common_targets(is_fbcode = False):
],
deps = [
"//executorch/codegen:gen_lib",
] + select({
] + ([] if runtime.is_oss else select({
"DEFAULT": [],
"ovr_config//os:linux": [] if runtime.is_oss else ["//executorch/codegen/tools:selective_build"], # TODO(larryliu0820) :selective_build doesn't build in OSS yet
}),
"ovr_config//os:linux": ["//executorch/codegen/tools:selective_build"], # TODO(larryliu0820) :selective_build doesn't build in OSS yet
})),
)

runtime.python_binary(
Expand Down
3 changes: 1 addition & 2 deletions exir/_serialize/TARGETS
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

oncall("executorch")

# TODO(T157145817): Update other flatbuffer serializers to use flatc like
# _flatbuffer.py does, and remove this.
cpp_python_extension(
runtime.cxx_python_extension(
name = "_bindings",
srcs = [
"bindings.cpp",
Expand Down
3 changes: 1 addition & 2 deletions exir/verification/TARGETS
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest")

oncall("executorch")

cpp_python_extension(
runtime.cxx_python_extension(
name = "bindings",
srcs = [
"bindings.cpp",
Expand Down
5 changes: 2 additions & 3 deletions extension/pytree/TARGETS
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain fbcode-only targets.

load("@fbcode_macros//build_defs:cpp_python_extension.bzl", "cpp_python_extension")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets()

cpp_python_extension(
runtime.cxx_python_extension(
name = "pybindings",
srcs = [
"pybindings.cpp",
Expand All @@ -21,7 +20,7 @@ cpp_python_extension(
],
)

cpp_python_extension(
runtime.cxx_python_extension(
name = "pybindings_debug",
srcs = [
"pybindings.cpp",
Expand Down
12 changes: 12 additions & 0 deletions shim_et/xplat/executorch/build/runtime_wrapper.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def _cxx_test(*args, **kwargs):

def _cxx_python_extension(*args, **kwargs):
_patch_kwargs_common(kwargs)
_remove_caffe2_deps(kwargs)
kwargs["srcs"] = _patch_executorch_references(kwargs["srcs"])
if "types" in kwargs:
kwargs["types"] = _patch_executorch_references(kwargs["types"])
Expand Down Expand Up @@ -324,8 +325,19 @@ def _genrule(*args, **kwargs):
kwargs["name"] += "_static"
env.genrule(*args, **kwargs)

def _remove_caffe2_deps(kwargs):
if not env.is_oss:
return
# We don't have Buckified PyTorch in OSS. At least let buck query work.
MISSING_BUCK_DIRS = ("//caffe2", "//pytorch", "fbsource//third-party")
for dep_type in ('deps', 'exported_deps'):
if dep_type not in kwargs:
continue
kwargs[dep_type] = [x for x in kwargs[dep_type] if not any([x.startswith(y) for y in MISSING_BUCK_DIRS])]

def _python_library(*args, **kwargs):
_patch_kwargs_common(kwargs)
_remove_caffe2_deps(kwargs)
env.python_library(*args, **kwargs)

def _python_binary(*args, **kwargs):
Expand Down
Loading