Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bazel/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module(
version = "0.0.0",
)

bazel_dep(name = "rules_cc", version = "0.1.4")
bazel_dep(name = "rules_cc", version = "0.2.8")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "aspect_bazel_lib", version = "2.20.0")
Expand Down
4 changes: 2 additions & 2 deletions bazel/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions bazel/detail/xcode/find.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ def _find_xcode_sdk(rctx):
fail("could not find sdk `{}`, do you have xcode installed?\n{}".format(rctx.attr.sdk, result.stderr))
sdk_path = str(rctx.path(result.stdout.strip()).realpath)

# Copy the SDK to this repository, but exclude the Ruby framework, which has recursive symlinks that break Bazel glob
ruby_framework = "System/Library/Frameworks/Ruby.framework"
result = rctx.execute(["rsync", "-a", "--exclude", ruby_framework, sdk_path + "/", "."])
if result.return_code != 0:
fail("could not copy sdk:\n{}".format(result.stderr))
rctx.file("BUILD", rctx.read(Label("sdk.BUILD")))
rctx.file("BUILD", rctx.read(Label("sdk.BUILD")).replace("{{XCODE_PATH}}", sdk_path))

find_xcode_sdk = repository_rule(
implementation = _find_xcode_sdk,
Expand Down
26 changes: 10 additions & 16 deletions bazel/detail/xcode/sdk.BUILD
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
load("@bazel_skylib//rules/directory:directory.bzl", "directory")
load("@rules_cc//cc/toolchains/args:sysroot.bzl", "cc_sysroot")
load("@rules_cc//cc/toolchains:args.bzl", "cc_args")

directory(
name = "sdk_link",
srcs = glob(
[
"usr/include/**/*",
"usr/lib/**/*",
"System/Library/Frameworks/**/*",
],
),
)

cc_sysroot(
cc_args(
name = "sdk",
data = ["sdk_link"],
sysroot = "sdk_link",
actions = [
"@rules_cc//cc/toolchains/actions:assembly_actions",
"@rules_cc//cc/toolchains/actions:c_compile",
"@rules_cc//cc/toolchains/actions:cpp_compile_actions",
"@rules_cc//cc/toolchains/actions:link_actions",
],
allowlist_absolute_include_directories = ["{{XCODE_PATH}}"],
args = ["--sysroot={{XCODE_PATH}}"],
visibility = ["//visibility:public"],
)
6 changes: 3 additions & 3 deletions bazel/test/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading