aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2016-06-29 17:25:27 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-06-30 11:40:58 +0000
commit6adba3ba33ec834b9671d03ab823225639724f99 (patch)
tree33774707a109766815c5211ff1e38bb6a52621c5 /tools
parentd8be627b765429ca6c64a7e930deb624de03e651 (diff)
*** Reason for rollback *** Broke builds that use apple_genrule. *** Original change description *** Move platform environment from xcrun_action to apple_action. This change ensures that scripts that don't need to be wrapped with xcrun_action (like actoolwrapper, ibtoolwrapper, and friends, because they internally invoke xcrunwrapper) also have the Xcode version and platform envvars set. RELNOTES: -- MOS_MIGRATED_REVID=126205606
Diffstat (limited to 'tools')
-rw-r--r--tools/build_defs/apple/shared.bzl18
1 files changed, 6 insertions, 12 deletions
diff --git a/tools/build_defs/apple/shared.bzl b/tools/build_defs/apple/shared.bzl
index 6118fd7926..976911b177 100644
--- a/tools/build_defs/apple/shared.bzl
+++ b/tools/build_defs/apple/shared.bzl
@@ -47,11 +47,6 @@ def module_cache_path(ctx):
def apple_action(ctx, **kw):
"""Creates an action that only runs on MacOS/Darwin.
- This function also passes to the action the necessary environment variables
- that control the Xcode version and platform to build for.
-
- Rules that use this action must require the "apple" configuration fragment.
-
Call it similar to how you would call ctx.action:
apple_action(ctx, outputs=[...], inputs=[...],...)
"""
@@ -59,22 +54,21 @@ def apple_action(ctx, **kw):
execution_requirements += DARWIN_EXECUTION_REQUIREMENTS
kw['execution_requirements'] = execution_requirements
- platform = ctx.fragments.apple.ios_cpu_platform()
- action_env = ctx.fragments.apple.target_apple_env(platform) \
- + ctx.fragments.apple.apple_host_system_env()
- kw['env'] = kw.get('env', {}) + action_env
-
ctx.action(**kw)
def xcrun_action(ctx, **kw):
"""Creates an apple action that executes xcrunwrapper.
- Rules that use this action must require the "apple" configuration fragment.
-
args:
ctx: The context of the rule that owns this action.
This method takes the same keyword arguments as ctx.action, however you don't
need to specify the executable.
"""
+ platform = ctx.fragments.apple.ios_cpu_platform()
+ action_env = ctx.fragments.apple.target_apple_env(platform) \
+ + ctx.fragments.apple.apple_host_system_env()
+ env = kw.get('env', {})
+ kw['env'] = env + action_env
+
apple_action(ctx, executable=ctx.executable._xcrunwrapper, **kw)