Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
17a524b
Matching list of tools
keith Mar 14, 2026
042907b
strip tool
keith Mar 14, 2026
6e6e8a0
fix header parsing tool
keith Mar 14, 2026
d85fcec
match more action's tools
keith Mar 14, 2026
ad9cb21
read the stuff from env
keith Mar 15, 2026
94f97d1
checkpoint
keith Mar 15, 2026
7e68c14
checkpoint
keith Mar 20, 2026
944f8bc
checkpoint
keith Mar 23, 2026
a768b61
checkpoint
keith Mar 23, 2026
b9bd5ca
Add golden test files
keith Mar 23, 2026
263e0b6
Add diff test and updating
keith Mar 23, 2026
c894545
checkpoint golden
keith Mar 23, 2026
94986a2
checkpoint
keith Mar 23, 2026
94aa943
note
keith Mar 23, 2026
1863a4e
sidestep visibility error
keith Mar 23, 2026
3d5e8d3
sidestep vis
keith Mar 23, 2026
5ffe4ca
change to fixme
keith Mar 24, 2026
1baa1b2
vis workaround
keith Mar 24, 2026
7347a26
drop rules_cc # 643
keith Mar 24, 2026
9555cc8
include dirs
keith Mar 24, 2026
47c7832
move xcode env to args
keith Mar 24, 2026
1a7d26f
layering_check support
keith Mar 24, 2026
6f4661b
Add coverage support
keith Mar 24, 2026
be8ee82
cleanup
keith Mar 24, 2026
a5256a9
Set target_system_name
keith Mar 24, 2026
cb1bd5b
fix dbg/fastbuild/opt
keith Mar 24, 2026
fd4c82c
order test
keith Mar 24, 2026
3c315c1
layering_check off by default
keith Mar 24, 2026
77e3c0d
cleanup
keith Mar 24, 2026
d051577
Make it opt-in
keith Mar 24, 2026
b7c15d7
just always enable no_warn_duplicate_libraries
keith Mar 24, 2026
fa3a383
set_install_name based on bazel flag
keith Mar 24, 2026
f8d264f
improve naming
keith Mar 24, 2026
99b6e89
cleanup
keith Mar 24, 2026
e541c8f
comment
keith Mar 24, 2026
3dbc49a
patch in rules_cc for testing
keith Mar 24, 2026
118b7ab
patch in enable for testing
keith Mar 24, 2026
26f9b2e
pr comments
keith Mar 24, 2026
0ade945
rename
keith Mar 25, 2026
cd8f401
sync tests
keith Mar 25, 2026
aae1f31
vis
keith Mar 25, 2026
118bcde
rename foo
keith Mar 25, 2026
3fc3a89
disable on 8.x and lower
keith Mar 25, 2026
997cc16
fix triple version
keith Mar 25, 2026
2b7bb3f
Split the mono BUILD file a bit
keith Mar 25, 2026
59bbffa
Join sanitizer features
keith Mar 25, 2026
5a8f462
Cleanup
keith Mar 25, 2026
c4b536e
cleanup
keith Mar 25, 2026
675d6e4
simplify feature
keith Mar 25, 2026
36a97be
rewrap text
keith Mar 25, 2026
0a10312
cleanup
keith Mar 25, 2026
c4ff4b5
add missing gcc_quoting_for_param_files
keith Mar 25, 2026
b1f7901
Fix gcov
keith Mar 26, 2026
954df91
fixtures
keith Mar 26, 2026
8943003
lint
keith Mar 26, 2026
3651d39
TODO
keith Mar 26, 2026
0fdce24
head fix
keith Mar 29, 2026
baa8a92
https://github.com/bazelbuild/apple_support/commit/39a4707b9aea0e9d7e…
keith Mar 29, 2026
24eec1c
ecc1a519647d4aa19e92142bb3034e431c6a4c71
keith Mar 29, 2026
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: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
common --enable_platform_specific_config

common --repo_env=APPLE_SUPPORT_RULES_BASED_TOOLCHAIN=1

common --repo_env=BAZEL_CONLYOPTS=-DCONLY_ENV=1
common --repo_env=BAZEL_COPTS=-DCOPTS_ENV=1
common --repo_env=BAZEL_CXXOPTS="-std=c++17:-DCXXOPTS_ENV=1"
Expand Down
24 changes: 23 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,25 @@ module(
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_cc", version = "0.2.17")
single_version_override(
module_name = "rules_cc",
patch_strip = 1,
patches = [
# https://github.com/bazelbuild/rules_cc/commit/f32fdf585dd07f67d9ef60cd2633960d0d8cb6a2
# https://github.com/bazelbuild/rules_cc/pull/614
# https://github.com/bazelbuild/rules_cc/pull/642
# https://github.com/bazelbuild/rules_cc/pull/645
# https://github.com/bazelbuild/rules_cc/pull/647
# https://github.com/bazelbuild/rules_cc/pull/648
# https://github.com/bazelbuild/rules_cc/pull/658
# https://github.com/bazelbuild/rules_cc/pull/659
# https://github.com/bazelbuild/rules_cc/pull/660
"//:rules_cc.patch",
# https://github.com/bazelbuild/rules_cc/pull/667
"//:rules_cc_legacy_tool.patch",
],
)

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")
Expand All @@ -31,3 +49,7 @@ use_repo(
"http_dmg_test_krita",
"http_dmg_test_krita_strip_prefix",
)

toolchain_env = use_repo_rule("//toolchain:toolchain_env.bzl", "toolchain_env")

toolchain_env(name = "apple_support_toolchain_env")
37 changes: 37 additions & 0 deletions crosstool/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,43 @@ force_exec(
target = ":exec_cc_wrapper.target_config",
)

# TODO: Attempt to remove need for wrapper
genrule(
name = "exec_strip.target_config",
srcs = ["strip.sh"],
outs = ["strip"],
cmd = "cp $(SRCS) $(OUTS)",
)

force_exec(
name = "exec_strip",
target = ":exec_strip.target_config",
)

genrule(
name = "exec_llvm_profdata.target_config",
srcs = ["llvm-profdata.sh"],
outs = ["llvm-profdata"],
cmd = "cp $(SRCS) $(OUTS)",
)

force_exec(
name = "exec_llvm_profdata",
target = ":exec_llvm_profdata.target_config",
)

genrule(
name = "exec_llvm_cov.target_config",
srcs = ["llvm-cov.sh"],
outs = ["llvm-cov"],
cmd = "cp $(SRCS) $(OUTS)",
)

force_exec(
name = "exec_llvm_cov",
target = ":exec_llvm_cov.target_config",
)

# Consumed by bazel tests.
filegroup(
name = "for_bazel_tests",
Expand Down
2 changes: 1 addition & 1 deletion crosstool/BUILD.toolchains
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _OSX_DEVELOPER_PLATFORM_CPUS = [
"@platforms//cpu:" + cpu,
],
target_compatible_with = APPLE_PLATFORMS_CONSTRAINTS[arch],
toolchain = "@local_config_apple_cc//:cc-compiler-" + arch,
toolchain = "%{label}".format(arch),
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
visibility = ["//visibility:public"],
)
Expand Down
5 changes: 5 additions & 0 deletions crosstool/llvm-cov.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -euo pipefail

exec xcrun llvm-cov "$@"
5 changes: 5 additions & 0 deletions crosstool/llvm-profdata.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -euo pipefail

exec xcrun llvm-profdata "$@"
24 changes: 19 additions & 5 deletions crosstool/setup_internal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ visibility("//lib/...")

_DISABLE_ENV_VAR = "BAZEL_NO_APPLE_CPP_TOOLCHAIN"
_OLD_DISABLE_ENV_VAR = "BAZEL_USE_CPP_ONLY_TOOLCHAIN"
_NEW_TOOLCHAIN_VAR = "APPLE_SUPPORT_RULES_BASED_TOOLCHAIN"

def _apple_cc_autoconf_toolchains_impl(repository_ctx):
"""Generate BUILD file with 'toolchain' targets for the local host C++ toolchain.
Expand All @@ -16,23 +17,34 @@ def _apple_cc_autoconf_toolchains_impl(repository_ctx):
env = repository_ctx.os.environ
should_disable = _DISABLE_ENV_VAR in env and env[_DISABLE_ENV_VAR] == "1"
old_should_disable = _OLD_DISABLE_ENV_VAR in env and env[_OLD_DISABLE_ENV_VAR] == "1"
use_new_toolchain = _NEW_TOOLCHAIN_VAR in env and env[_NEW_TOOLCHAIN_VAR] == "1"

if should_disable or old_should_disable:
repository_ctx.file("BUILD", "# Apple CC toolchain autoconfiguration was disabled by {} env variable.".format(
_DISABLE_ENV_VAR if should_disable else _OLD_DISABLE_ENV_VAR,
))
elif use_new_toolchain:
repository_ctx.template(
"BUILD",
Label("@build_bazel_apple_support//crosstool:BUILD.toolchains"),
{
"%{label}": "@build_bazel_apple_support//toolchain",
},
)
else:
repository_ctx.file(
repository_ctx.template(
"BUILD",
content = repository_ctx.read(
Label("@build_bazel_apple_support//crosstool:BUILD.toolchains"),
),
Label("@build_bazel_apple_support//crosstool:BUILD.toolchains"),
{
"%{label}": "@local_config_apple_cc//:cc-compiler-{}",
},
)

apple_cc_autoconf_toolchains = repository_rule(
environ = [
_DISABLE_ENV_VAR,
_OLD_DISABLE_ENV_VAR,
_NEW_TOOLCHAIN_VAR,
],
implementation = _apple_cc_autoconf_toolchains_impl,
configure = True,
Expand All @@ -42,8 +54,9 @@ def _apple_cc_autoconf_impl(repository_ctx):
env = repository_ctx.os.environ
should_disable = _DISABLE_ENV_VAR in env and env[_DISABLE_ENV_VAR] == "1"
old_should_disable = _OLD_DISABLE_ENV_VAR in env and env[_OLD_DISABLE_ENV_VAR] == "1"
use_new_toolchain = _NEW_TOOLCHAIN_VAR in env and env[_NEW_TOOLCHAIN_VAR] == "1"

if should_disable or old_should_disable:
if should_disable or old_should_disable or use_new_toolchain:
repository_ctx.file("BUILD", "# Apple CC autoconfiguration was disabled by {} env variable.".format(
_DISABLE_ENV_VAR if should_disable else _OLD_DISABLE_ENV_VAR,
))
Expand All @@ -54,6 +67,7 @@ def _apple_cc_autoconf_impl(repository_ctx):

apple_cc_autoconf = repository_rule(
environ = [
_NEW_TOOLCHAIN_VAR,
_DISABLE_ENV_VAR,
_OLD_DISABLE_ENV_VAR,
"APPLE_SUPPORT_LAYERING_CHECK_BETA",
Expand Down
5 changes: 5 additions & 0 deletions crosstool/strip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -euo pipefail

exec xcrun strip "$@"
Loading