Skip to content

Commit 31349a6

Browse files
committed
Depend on xcode_config() coming from apple_support
Right now we always assume that this rule is provided by our builtins. This no longer holds in newer versions of Bazel.
1 parent d021a20 commit 31349a6

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

starlark/bazel_tools/MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module(name = "bazel_tools")
22

3+
bazel_dep(name = "apple_support")
34
bazel_dep(name = "bazel_skylib")
45
bazel_dep(name = "platforms")
56
bazel_dep(name = "protobuf")

starlark/bazel_tools/tools/osx/xcode_configure.bzl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ def _xcode_version_output(repository_ctx, name, version, aliases, developer_dir,
9393
print(error_msg)
9494
return build_contents
9595

96-
VERSION_CONFIG_STUB = "xcode_config(name = 'host_xcodes')"
96+
VERSION_CONFIG_STUB = """
97+
load("@apple_support//xcode:xcode_config.bzl", "xcode_config")
98+
xcode_config(name = 'host_xcodes')
99+
"""
97100

98101
def run_xcode_locator(repository_ctx, xcode_locator_src_label):
99102
"""Generates xcode-locator from source and runs it.
@@ -230,7 +233,11 @@ def _darwin_build_file(repository_ctx):
230233
)
231234
default_xcode_target = ""
232235
target_names = []
233-
buildcontents = ""
236+
buildcontents = """
237+
load("@apple_support//xcode:xcode_config.bzl", "xcode_config")
238+
load("@apple_support//xcode:available_xcodes.bzl", "available_xcodes")
239+
load("@apple_support//xcode:xcode_version.bzl", "xcode_version")
240+
"""
234241

235242
for toolchain in toolchains:
236243
version = toolchain.version

0 commit comments

Comments
 (0)