Skip to content

Commit 2ef42f3

Browse files
committed
Call compilers directly rather than use wrapper scripts
1 parent 90c2d82 commit 2ef42f3

File tree

5 files changed

+17
-93
lines changed

5 files changed

+17
-93
lines changed

bazel/detail/args/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ cc_args(
9090
'-D__DATE__="redacted"',
9191
'-D__TIMESTAMP__="redacted"',
9292
'-D__TIME__="redacted"',
93-
"-ffile-prefix-map=__BAZEL_EXECUTION_ROOT__=.",
93+
"-ffile-compilation-dir=.",
9494
],
9595
)
9696

9797
cc_args(
9898
name = "reproducible_link_args_apple",
9999
actions = ["@rules_cc//cc/toolchains/actions:link_actions"],
100-
args = ["-Wl,-oso_prefix,__BAZEL_EXECUTION_ROOT__/"],
100+
args = ["-Wl,-oso_prefix,."],
101101
)
102102

103103
cc_args_list(

bazel/detail/tools/BUILD

Lines changed: 15 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -46,69 +46,29 @@ TOOL = [
4646
"llvm-cov",
4747
"llvm-strip",
4848
"clang-tidy",
49+
"clang",
50+
"clang++",
51+
"clang-cl",
4952
]
5053

54+
EXE_EXT = ".exe" if "windows" in HOST_TARGET else ""
55+
5156
[
5257
cc_tool(
5358
name = tool,
54-
src = select({
55-
"@platforms//os:windows": "@llvm-{}//:bin/{}.exe".format(HOST_TARGET, tool),
56-
"//conditions:default": "@llvm-{}//:bin/{}".format(HOST_TARGET, tool),
59+
src = "@llvm-{}//:bin/{}{}".format(HOST_TARGET, tool, EXE_EXT),
60+
capabilities = select({
61+
"@platforms//os:windows": [
62+
# "@rules_cc//cc/toolchains/capabilities:supports_dynamic_linker",
63+
# "@rules_cc//cc/toolchains/capabilities:supports_interface_shared_libraries",
64+
# "@rules_cc//cc/toolchains/capabilities:targets_windows",
65+
# "@rules_cc//cc/toolchains/capabilities:has_configured_linker_path",
66+
# "@rules_cc//cc/toolchains/capabilities:copy_dynamic_libraries_to_binary",
67+
],
68+
"//conditions:default": [],
5769
}),
5870
data = ["@llvm-{}//:data".format(HOST_TARGET)],
5971
visibility = ["//visibility:private"],
6072
)
6173
for tool in TOOL
6274
]
63-
64-
SCRIPT_EXT = ".ps1" if "windows" in HOST_TARGET else ".sh"
65-
66-
CALL_SCRIPT_EXT = ".bat" if "windows" in HOST_TARGET else ".sh"
67-
68-
EXE_EXT = ".exe" if "windows" in HOST_TARGET else ""
69-
70-
[
71-
(
72-
expand_template(
73-
name = tool + "_wrapper",
74-
out = tool + SCRIPT_EXT,
75-
data = ["@llvm-{}//:bin/{}{}".format(HOST_TARGET, tool, EXE_EXT)],
76-
substitutions = {
77-
"{{TOOL}}": "$(execpath @llvm-{}//:bin/{}{})".format(HOST_TARGET, tool, EXE_EXT),
78-
},
79-
template = "wrapper" + SCRIPT_EXT,
80-
),
81-
expand_template(
82-
name = tool + "_bat",
83-
out = tool + ".bat",
84-
substitutions = {
85-
"{{TOOL}}": tool,
86-
},
87-
template = "wrapper.bat",
88-
),
89-
cc_tool(
90-
name = tool,
91-
src = tool + CALL_SCRIPT_EXT,
92-
capabilities = select({
93-
"@platforms//os:windows": [
94-
# "@rules_cc//cc/toolchains/capabilities:supports_dynamic_linker",
95-
# "@rules_cc//cc/toolchains/capabilities:supports_interface_shared_libraries",
96-
# "@rules_cc//cc/toolchains/capabilities:targets_windows",
97-
# "@rules_cc//cc/toolchains/capabilities:has_configured_linker_path",
98-
# "@rules_cc//cc/toolchains/capabilities:copy_dynamic_libraries_to_binary",
99-
],
100-
"//conditions:default": [],
101-
}),
102-
data = [
103-
"@llvm-{}//:data".format(HOST_TARGET),
104-
tool + "_wrapper",
105-
],
106-
visibility = ["//visibility:private"],
107-
),
108-
)
109-
for tool in [
110-
"clang",
111-
"clang++",
112-
"clang-cl",
113-
]
114-
]

bazel/detail/tools/wrapper.bat

Lines changed: 0 additions & 4 deletions
This file was deleted.

bazel/detail/tools/wrapper.ps1

Lines changed: 0 additions & 19 deletions
This file was deleted.

bazel/detail/tools/wrapper.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)