Update the Apple rules according to the new API because it was deemed better to
put the environment data behind apple_common as opposed to xcode_config.
Progress towards .
RELNOTES: None.
@@ -74,12 +74,13 @@ def xcrun_env(ctx):
"""Returns the environment dictionary necessary to use xcrunwrapper."""
platform = ctx.fragments.apple.single_arch_platform
- environment_supplier = ctx.attr._xcode_config[apple_common.XcodeVersionConfig]
- if not hasattr(environment_supplier, "apple_host_system_env"):
- environment_supplier = ctx.fragments.apple
- action_env = environment_supplier.target_apple_env(platform) + environment_supplier.apple_host_system_env()
-
- return action_env
+ if hasattr(apple_common, "apple_host_system_env"):
+ xcode_config = ctx.attr._xcode_config[apple_common.XcodeVersionConfig]
+ return (apple_common.target_apple_env(xcode_config) +
+ apple_common.apple_host_system_env(xcode_config))
+ else:
+ return (ctx.fragments.apple.target_apple_env(platform) +
+ ctx.fragments.apple.apple_host_system_env())
def xcrun_action(ctx, **kw):
