From 455c32550d9acf55c3302e96104f4754221d8b43 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Fri, 27 Mar 2026 16:49:47 -0700 Subject: [PATCH 1/4] Create lipo toolchain This allows users to provide a custom lipo_toolchain that is automatically used by universal_binary. This is useful if you want to separate lipo-ing from requiring Xcode by using llvm's lipo (or any other target). This registers a default lipo with Xcode's implementation --- BUILD | 1 + MODULE.bazel | 1 + lib/lipo.bzl | 77 +++++++++++++++++++++++------------ lipo/BUILD | 49 ++++++++++++++++++++++ lipo/lipo.sh | 5 +++ lipo/lipo_toolchain.bzl | 63 ++++++++++++++++++++++++++++ lipo/xcode_lipo_toolchain.bzl | 67 ++++++++++++++++++++++++++++++ rules/universal_binary.bzl | 29 +++++++------ 8 files changed, 252 insertions(+), 40 deletions(-) create mode 100644 lipo/BUILD create mode 100755 lipo/lipo.sh create mode 100644 lipo/lipo_toolchain.bzl create mode 100644 lipo/xcode_lipo_toolchain.bzl diff --git a/BUILD b/BUILD index 18eeda3f..f692c462 100644 --- a/BUILD +++ b/BUILD @@ -29,6 +29,7 @@ filegroup( "//constraints:for_bazel_tests", "//crosstool:for_bazel_tests", "//lib:for_bazel_tests", + "//lipo:for_bazel_tests", "//platforms:for_bazel_tests", "//rules:for_bazel_tests", "//tools:for_bazel_tests", diff --git a/MODULE.bazel b/MODULE.bazel index e9ae7a86..8ae56929 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -16,6 +16,7 @@ apple_cc_configure = use_extension("//crosstool:setup.bzl", "apple_cc_configure_ use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_toolchains") register_toolchains("@local_config_apple_cc_toolchains//:all") +register_toolchains("//lipo:default_lipo_toolchain") bazel_dep(name = "rules_shell", version = "0.3.0", dev_dependency = True) bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True) diff --git a/lib/lipo.bzl b/lib/lipo.bzl index 8bf6b546..a6ee9f61 100644 --- a/lib/lipo.bzl +++ b/lib/lipo.bzl @@ -25,8 +25,9 @@ def _create( actions, inputs, output, - apple_fragment, - xcode_config): + apple_fragment = None, + xcode_config = None, + toolchain = None): """Creates a universal binary by combining other binaries. Args: @@ -39,35 +40,61 @@ def _create( output: A `File` representing the universal binary that will be the output of the action. apple_fragment: The `apple` configuration fragment used to configure - the action environment. + the action environment. Required when `toolchain` is not provided. xcode_config: The `apple_common.XcodeVersionConfig` provider used to - configure the action environment. + configure the action environment. Required when `toolchain` is not + provided. + toolchain: An optional `LipoToolchainInfo` provider. When provided, + the action is registered via `ctx.actions.run` using the tool, + env, and execution requirements from the toolchain. """ if not inputs: fail("lipo.create requires at least one input file.") - # Explicitly create the containing directory to avoid an occasional error - # from lipo; "can't create temporary output file [...] (Permission denied)" - command = [ - "mkdir -p {} &&".format(shell.quote(output.dirname)), - "/usr/bin/lipo", - "-create", - ] - command.extend([ - shell.quote(input_file.path) - for input_file in inputs - ]) - command.extend(["-output", shell.quote(output.path)]) + if toolchain: + args = actions.args() + args.add("-create") + args.add_all(inputs) + args.add("-output") + args.add(output) + actions.run( + executable = toolchain.lipo, + arguments = [args], + mnemonic = "AppleLipo", + inputs = inputs, + outputs = [output], + env = toolchain.env, + execution_requirements = toolchain.execution_requirements, + use_default_shell_env = True, + ) + elif apple_fragment and xcode_config: + # Explicitly create the containing directory to avoid an occasional error + # from lipo; "can't create temporary output file [...] (Permission denied)" + command = [ + "mkdir -p {} &&".format(shell.quote(output.dirname)), + "/usr/bin/lipo", + "-create", + ] + command.extend([ + shell.quote(input_file.path) + for input_file in inputs + ]) + command.extend(["-output", shell.quote(output.path)]) - apple_support.run_shell( - actions = actions, - command = " ".join(command), - mnemonic = "AppleLipo", - inputs = inputs, - outputs = [output], - apple_fragment = apple_fragment, - xcode_config = xcode_config, - ) + apple_support.run_shell( + actions = actions, + command = " ".join(command), + mnemonic = "AppleLipo", + inputs = inputs, + outputs = [output], + apple_fragment = apple_fragment, + xcode_config = xcode_config, + use_default_shell_env = True, + ) + else: + fail("""\ +lipo.create requires either a `toolchain` or both `apple_fragment` and `xcode_config` to be provided. +""") def _extract_or_thin( *, diff --git a/lipo/BUILD b/lipo/BUILD new file mode 100644 index 00000000..b99a04ec --- /dev/null +++ b/lipo/BUILD @@ -0,0 +1,49 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_shell//shell:sh_binary.bzl", "sh_binary") +load(":xcode_lipo_toolchain.bzl", "xcode_lipo_toolchain") + +licenses(["notice"]) + +package( + default_visibility = ["//visibility:public"], +) + +toolchain_type( + name = "toolchain_type", +) + +sh_binary( + name = "lipo", + srcs = ["lipo.sh"], +) + +xcode_lipo_toolchain( + name = "lipo_toolchain", + lipo = ":lipo", +) + +toolchain( + name = "default_lipo_toolchain", + exec_compatible_with = ["@platforms//os:macos"], + toolchain = ":lipo_toolchain", + toolchain_type = ":toolchain_type", +) + +bzl_library( + name = "lipo_toolchain_lib", + srcs = ["lipo_toolchain.bzl"], +) + +bzl_library( + name = "xcode_lipo_toolchain_lib", + srcs = ["xcode_lipo_toolchain.bzl"], + deps = [":lipo_toolchain_lib"], +) + +# Consumed by bazel tests. +filegroup( + name = "for_bazel_tests", + testonly = 1, + srcs = glob(["**"]), + visibility = ["//:__pkg__"], +) diff --git a/lipo/lipo.sh b/lipo/lipo.sh new file mode 100755 index 00000000..46869c7c --- /dev/null +++ b/lipo/lipo.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euo pipefail + +exec /usr/bin/lipo "$@" diff --git a/lipo/lipo_toolchain.bzl b/lipo/lipo_toolchain.bzl new file mode 100644 index 00000000..49548f75 --- /dev/null +++ b/lipo/lipo_toolchain.bzl @@ -0,0 +1,63 @@ +# Copyright 2026 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Toolchain rule for providing a custom `lipo` tool.""" + +LipoToolchainInfo = provider( + doc = "Provides a `lipo` tool for creating and manipulating universal binaries.", + fields = { + "lipo": "A `FilesToRunProvider` for the `lipo` tool.", + "env": "A `dict` of environment variables to set when running the tool.", + "execution_requirements": """\ +A `dict` of execution requirements for the action (e.g. `requires-darwin`). +""", + }, +) + +def _lipo_toolchain_impl(ctx): + return [ + platform_common.ToolchainInfo( + lipo_info = LipoToolchainInfo( + lipo = ctx.attr.lipo[DefaultInfo].files_to_run, + env = ctx.attr.env, + execution_requirements = ctx.attr.execution_requirements, + ), + ), + ] + +lipo_toolchain = rule( + attrs = { + "lipo": attr.label( + doc = "The `lipo` tool binary.", + mandatory = True, + allow_files = True, + executable = True, + cfg = "exec", + ), + "env": attr.string_dict( + doc = "Additional environment variables to set when running lipo.", + default = {}, + ), + "execution_requirements": attr.string_dict( + doc = "Additional execution requirements for the action.", + default = {}, + ), + }, + doc = """\ +Defines a toolchain for the `lipo` tool used to create and manipulate universal +binaries. Use this to provide a custom `lipo` implementation by defining a +`lipo_toolchain` target and registering it as a toolchain. +""", + implementation = _lipo_toolchain_impl, +) diff --git a/lipo/xcode_lipo_toolchain.bzl b/lipo/xcode_lipo_toolchain.bzl new file mode 100644 index 00000000..c3ab6009 --- /dev/null +++ b/lipo/xcode_lipo_toolchain.bzl @@ -0,0 +1,67 @@ +# Copyright 2026 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Xcode-aware toolchain rule for providing a `lipo` tool.""" + +load("//lib:apple_support.bzl", "apple_support") +load(":lipo_toolchain.bzl", "LipoToolchainInfo") + +def _xcode_lipo_toolchain_impl(ctx): + env = dict(ctx.attr.env) + execution_requirements = dict(ctx.attr.execution_requirements) + + xcode_config = ctx.attr._xcode_config[apple_common.XcodeVersionConfig] + if xcode_config: + env.update(apple_common.apple_host_system_env(xcode_config)) + env.update( + apple_common.target_apple_env(xcode_config, ctx.fragments.apple.single_arch_platform), + ) + execution_requirements.update(xcode_config.execution_info()) + + return [ + platform_common.ToolchainInfo( + lipo_info = LipoToolchainInfo( + lipo = ctx.attr.lipo[DefaultInfo].files_to_run, + env = env, + execution_requirements = execution_requirements, + ), + ), + ] + +xcode_lipo_toolchain = rule( + attrs = apple_support.action_required_attrs() | { + "lipo": attr.label( + doc = "The `lipo` tool binary.", + mandatory = True, + allow_files = True, + executable = True, + cfg = "exec", + ), + "env": attr.string_dict( + doc = "Additional environment variables to set when running lipo.", + default = {}, + ), + "execution_requirements": attr.string_dict( + doc = "Additional execution requirements for the action.", + default = {}, + ), + }, + doc = """\ +Defines a toolchain for the `lipo` tool used to create and manipulate universal +binaries. This toolchain automatically sets environment variables and execution +requirements required to run Xcode's lipo hermetically. +""", + fragments = ["apple"], + implementation = _xcode_lipo_toolchain_impl, +) diff --git a/rules/universal_binary.bzl b/rules/universal_binary.bzl index b1ba8e36..0ceb8726 100644 --- a/rules/universal_binary.bzl +++ b/rules/universal_binary.bzl @@ -14,10 +14,11 @@ """Implementation for macOS universal binary rule.""" -load("//lib:apple_support.bzl", "apple_support") load("//lib:lipo.bzl", "lipo") load("//lib:transitions.bzl", "macos_universal_transition") +_LIPO_TOOLCHAIN_TYPE = "//lipo:toolchain_type" + def _universal_binary_impl(ctx): inputs = [ binary[DefaultInfo].files.to_list()[0] @@ -33,10 +34,9 @@ def _universal_binary_impl(ctx): if len(inputs) > 1: lipo.create( actions = ctx.actions, - apple_fragment = ctx.fragments.apple, inputs = inputs, output = output, - xcode_config = ctx.attr._xcode_config[apple_common.XcodeVersionConfig], + toolchain = ctx.toolchains[_LIPO_TOOLCHAIN_TYPE].lipo_info, ) else: @@ -60,17 +60,16 @@ def _universal_binary_impl(ctx): ] universal_binary = rule( - attrs = apple_support.action_required_attrs() | - { - "binary": attr.label( - cfg = macos_universal_transition, - doc = "Target to generate a 'fat' binary from.", - mandatory = True, - ), - "_allowlist_function_transition": attr.label( - default = "@bazel_tools//tools/allowlists/function_transition_allowlist", - ), - }, + attrs = { + "binary": attr.label( + cfg = macos_universal_transition, + doc = "Target to generate a 'fat' binary from.", + mandatory = True, + ), + "_allowlist_function_transition": attr.label( + default = "@bazel_tools//tools/allowlists/function_transition_allowlist", + ), + }, doc = """ This rule produces a multi-architecture ("fat") binary targeting Apple macOS platforms *regardless* of the architecture of the macOS host platform. The @@ -79,6 +78,6 @@ non-macOS platforms, this simply just creates a symbolic link of the input binary. """, executable = True, - fragments = ["apple"], implementation = _universal_binary_impl, + toolchains = [_LIPO_TOOLCHAIN_TYPE], ) From 7ac674041d404f354eb8ae835b158fe60baba8b6 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Fri, 27 Mar 2026 17:02:11 -0700 Subject: [PATCH 2/4] fix --- MODULE.bazel | 3 ++- doc/rules.md | 4 +--- lipo/BUILD | 1 + rules/universal_binary.bzl | 4 +--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 8ae56929..cc1c4b19 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -11,14 +11,15 @@ bazel_dep(name = "bazel_features", version = "1.27.0") bazel_dep(name = "bazel_skylib", version = "1.3.0") bazel_dep(name = "platforms", version = "0.0.9") bazel_dep(name = "rules_cc", version = "0.2.15") +bazel_dep(name = "rules_shell", version = "0.3.0") apple_cc_configure = use_extension("//crosstool:setup.bzl", "apple_cc_configure_extension") use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_toolchains") register_toolchains("@local_config_apple_cc_toolchains//:all") + register_toolchains("//lipo:default_lipo_toolchain") -bazel_dep(name = "rules_shell", version = "0.3.0", dev_dependency = True) bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True) # TODO: Remove when transitives bump past this diff --git a/doc/rules.md b/doc/rules.md index 3b9fc105..6d402dd1 100644 --- a/doc/rules.md +++ b/doc/rules.md @@ -128,9 +128,7 @@ universal_binary(name, Date: Mon, 30 Mar 2026 13:54:18 -0700 Subject: [PATCH 3/4] optional --- rules/universal_binary.bzl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rules/universal_binary.bzl b/rules/universal_binary.bzl index 765577f0..0b01a092 100644 --- a/rules/universal_binary.bzl +++ b/rules/universal_binary.bzl @@ -32,11 +32,15 @@ def _universal_binary_impl(ctx): output = ctx.actions.declare_file(ctx.label.name) if len(inputs) > 1: + lipo_toolchain = ctx.toolchains[_LIPO_TOOLCHAIN_TYPE] + if not lipo_toolchain: + fail("{} requires a lipo toolchain to build a universal binary but no lipo toolchain was found.".format(ctx.attr.name)) + lipo.create( actions = ctx.actions, inputs = inputs, output = output, - toolchain = ctx.toolchains[_LIPO_TOOLCHAIN_TYPE].lipo_info, + toolchain = lipo_toolchain.lipo_info, ) else: @@ -77,5 +81,5 @@ platforms *regardless* of the architecture of the macOS host platform. The """, executable = True, implementation = _universal_binary_impl, - toolchains = [_LIPO_TOOLCHAIN_TYPE], + toolchains = [config_common.toolchain_type(_LIPO_TOOLCHAIN_TYPE, mandatory = False)], ) From fd43ed63f4db4c39062d1073c5cc16e2db0a5c9a Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 30 Mar 2026 15:31:49 -0700 Subject: [PATCH 4/4] move --- BUILD | 1 - MODULE.bazel | 2 +- lib/lipo.bzl | 6 ++-- rules/BUILD | 1 + {lipo => rules/lipo}/BUILD | 29 +++++++++---------- {lipo => rules/lipo}/lipo.sh | 0 .../lipo/toolchain.bzl | 10 +++---- .../lipo/xcode_toolchain.bzl | 8 ++--- rules/universal_binary.bzl | 2 +- 9 files changed, 29 insertions(+), 30 deletions(-) rename {lipo => rules/lipo}/BUILD (56%) rename {lipo => rules/lipo}/lipo.sh (100%) rename lipo/lipo_toolchain.bzl => rules/lipo/toolchain.bzl (89%) rename lipo/xcode_lipo_toolchain.bzl => rules/lipo/xcode_toolchain.bzl (92%) diff --git a/BUILD b/BUILD index f692c462..18eeda3f 100644 --- a/BUILD +++ b/BUILD @@ -29,7 +29,6 @@ filegroup( "//constraints:for_bazel_tests", "//crosstool:for_bazel_tests", "//lib:for_bazel_tests", - "//lipo:for_bazel_tests", "//platforms:for_bazel_tests", "//rules:for_bazel_tests", "//tools:for_bazel_tests", diff --git a/MODULE.bazel b/MODULE.bazel index cc1c4b19..99d74060 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -18,7 +18,7 @@ use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_too register_toolchains("@local_config_apple_cc_toolchains//:all") -register_toolchains("//lipo:default_lipo_toolchain") +register_toolchains("//rules/lipo:default_lipo_toolchain") bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True) diff --git a/lib/lipo.bzl b/lib/lipo.bzl index a6ee9f61..b1ceffd0 100644 --- a/lib/lipo.bzl +++ b/lib/lipo.bzl @@ -44,8 +44,8 @@ def _create( xcode_config: The `apple_common.XcodeVersionConfig` provider used to configure the action environment. Required when `toolchain` is not provided. - toolchain: An optional `LipoToolchainInfo` provider. When provided, - the action is registered via `ctx.actions.run` using the tool, + toolchain: An optional `LipoInfo` provider. When provided, the + action is registered via `ctx.actions.run` using the tool, env, and execution requirements from the toolchain. """ if not inputs: @@ -58,7 +58,7 @@ def _create( args.add("-output") args.add(output) actions.run( - executable = toolchain.lipo, + executable = toolchain.tool, arguments = [args], mnemonic = "AppleLipo", inputs = inputs, diff --git a/rules/BUILD b/rules/BUILD index da46d314..d55ec9aa 100644 --- a/rules/BUILD +++ b/rules/BUILD @@ -47,6 +47,7 @@ filegroup( name = "for_bazel_tests", testonly = 1, srcs = glob(["**"]) + [ + "//rules/lipo:for_bazel_tests", "//rules/private:for_bazel_tests", ], visibility = ["//:__pkg__"], diff --git a/lipo/BUILD b/rules/lipo/BUILD similarity index 56% rename from lipo/BUILD rename to rules/lipo/BUILD index 29255a31..793f3976 100644 --- a/lipo/BUILD +++ b/rules/lipo/BUILD @@ -1,25 +1,22 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@rules_shell//shell:sh_binary.bzl", "sh_binary") -load(":xcode_lipo_toolchain.bzl", "xcode_lipo_toolchain") +load(":xcode_toolchain.bzl", "xcode_lipo_toolchain") licenses(["notice"]) -package( - default_visibility = ["//visibility:public"], -) +package(default_visibility = ["//visibility:public"]) -toolchain_type( - name = "toolchain_type", -) +toolchain_type(name = "toolchain_type") sh_binary( name = "lipo", srcs = ["lipo.sh"], + visibility = ["//visibility:private"], ) xcode_lipo_toolchain( name = "lipo_toolchain", - lipo = ":lipo", + tool = ":lipo", ) toolchain( @@ -31,20 +28,22 @@ toolchain( ) bzl_library( - name = "lipo_toolchain_lib", - srcs = ["lipo_toolchain.bzl"], + name = "toolchain_bzl", + srcs = ["toolchain.bzl"], ) bzl_library( - name = "xcode_lipo_toolchain_lib", - srcs = ["xcode_lipo_toolchain.bzl"], - deps = [":lipo_toolchain_lib"], + name = "xcode_toolchain_bzl", + srcs = ["xcode_toolchain.bzl"], + deps = [ + ":toolchain_bzl", + "//lib:apple_support", + ], ) -# Consumed by bazel tests. filegroup( name = "for_bazel_tests", testonly = 1, srcs = glob(["**"]), - visibility = ["//:__pkg__"], + visibility = ["//:__subpackages__"], ) diff --git a/lipo/lipo.sh b/rules/lipo/lipo.sh similarity index 100% rename from lipo/lipo.sh rename to rules/lipo/lipo.sh diff --git a/lipo/lipo_toolchain.bzl b/rules/lipo/toolchain.bzl similarity index 89% rename from lipo/lipo_toolchain.bzl rename to rules/lipo/toolchain.bzl index 49548f75..3d7b05b9 100644 --- a/lipo/lipo_toolchain.bzl +++ b/rules/lipo/toolchain.bzl @@ -14,10 +14,10 @@ """Toolchain rule for providing a custom `lipo` tool.""" -LipoToolchainInfo = provider( +LipoInfo = provider( doc = "Provides a `lipo` tool for creating and manipulating universal binaries.", fields = { - "lipo": "A `FilesToRunProvider` for the `lipo` tool.", + "tool": "A `FilesToRunProvider` for the `lipo` tool.", "env": "A `dict` of environment variables to set when running the tool.", "execution_requirements": """\ A `dict` of execution requirements for the action (e.g. `requires-darwin`). @@ -28,8 +28,8 @@ A `dict` of execution requirements for the action (e.g. `requires-darwin`). def _lipo_toolchain_impl(ctx): return [ platform_common.ToolchainInfo( - lipo_info = LipoToolchainInfo( - lipo = ctx.attr.lipo[DefaultInfo].files_to_run, + lipo_info = LipoInfo( + tool = ctx.attr.tool[DefaultInfo].files_to_run, env = ctx.attr.env, execution_requirements = ctx.attr.execution_requirements, ), @@ -38,7 +38,7 @@ def _lipo_toolchain_impl(ctx): lipo_toolchain = rule( attrs = { - "lipo": attr.label( + "tool": attr.label( doc = "The `lipo` tool binary.", mandatory = True, allow_files = True, diff --git a/lipo/xcode_lipo_toolchain.bzl b/rules/lipo/xcode_toolchain.bzl similarity index 92% rename from lipo/xcode_lipo_toolchain.bzl rename to rules/lipo/xcode_toolchain.bzl index c3ab6009..558878d9 100644 --- a/lipo/xcode_lipo_toolchain.bzl +++ b/rules/lipo/xcode_toolchain.bzl @@ -15,7 +15,7 @@ """Xcode-aware toolchain rule for providing a `lipo` tool.""" load("//lib:apple_support.bzl", "apple_support") -load(":lipo_toolchain.bzl", "LipoToolchainInfo") +load(":toolchain.bzl", "LipoInfo") def _xcode_lipo_toolchain_impl(ctx): env = dict(ctx.attr.env) @@ -31,8 +31,8 @@ def _xcode_lipo_toolchain_impl(ctx): return [ platform_common.ToolchainInfo( - lipo_info = LipoToolchainInfo( - lipo = ctx.attr.lipo[DefaultInfo].files_to_run, + lipo_info = LipoInfo( + tool = ctx.attr.tool[DefaultInfo].files_to_run, env = env, execution_requirements = execution_requirements, ), @@ -41,7 +41,7 @@ def _xcode_lipo_toolchain_impl(ctx): xcode_lipo_toolchain = rule( attrs = apple_support.action_required_attrs() | { - "lipo": attr.label( + "tool": attr.label( doc = "The `lipo` tool binary.", mandatory = True, allow_files = True, diff --git a/rules/universal_binary.bzl b/rules/universal_binary.bzl index 0b01a092..58974685 100644 --- a/rules/universal_binary.bzl +++ b/rules/universal_binary.bzl @@ -17,7 +17,7 @@ load("//lib:lipo.bzl", "lipo") load("//lib:transitions.bzl", "macos_universal_transition") -_LIPO_TOOLCHAIN_TYPE = "//lipo:toolchain_type" +_LIPO_TOOLCHAIN_TYPE = "//rules/lipo:toolchain_type" def _universal_binary_impl(ctx): inputs = [