Skip to content

Commit 51e79a0

Browse files
cccclaifacebook-github-bot
authored andcommitted
add command_alias in runtime_wrapper (#5737)
Summary: Pull Request resolved: pytorch/executorch#5737 As title, expand the runtime wrapper to support `command_alias` so we can use it to set env_variable. Test in D63556730 Reviewed By: derekxu, larryliu0820 Differential Revision: D63570326 fbshipit-source-id: 1b66e261e44d1b57407adb6dd73ef08d732d716a
1 parent 944bd67 commit 51e79a0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

shim/xplat/executorch/build/env_interface.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ def _struct_to_json(object):
201201
return native.json.encode(object)
202202

203203
env = struct(
204+
# @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.
205+
command_alias = native.command_alias,
204206
# @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.
205207
cxx_binary = native.cxx_binary,
206208
# @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.

shim/xplat/executorch/build/runtime_wrapper.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ def _filegroup(*args, **kwargs):
301301
_patch_kwargs_common(kwargs)
302302
env.filegroup(*args, **kwargs)
303303

304+
def _command_alias(*args, **kwargs):
305+
_patch_kwargs_common(kwargs)
306+
env.command_alias(*args, **kwargs)
307+
304308
def _genrule(*args, **kwargs):
305309
_patch_kwargs_common(kwargs)
306310
env.patch_platforms(kwargs)
@@ -345,6 +349,7 @@ def get_oss_build_kwargs():
345349
# see the "Build Rules" section in the sidebar of
346350
# https://buck.build/concept/build_rule.html.
347351
runtime = struct(
352+
command_alias = _command_alias,
348353
cxx_binary = _cxx_binary,
349354
cxx_library = _cxx_library,
350355
cxx_python_extension = _cxx_python_extension,

0 commit comments

Comments
 (0)