Skip to content

Commit 65e700a

Browse files
committed
Fix buildifier
1 parent 85f4edf commit 65e700a

File tree

2 files changed

+9
-51
lines changed

2 files changed

+9
-51
lines changed

crosstool/cc_toolchain_config.bzl

+4-46
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def _compare_versions(dv1, v2):
3939
return dv1.compare_to(apple_common.dotted_version(v2))
4040

4141
def _can_use_deterministic_libtool(ctx):
42-
"""Returns `True` if the current version of `libtool` has support for
43-
deterministic mode, and `False` otherwise."""
42+
"""Returns `True` if the current version of `libtool` has support for deterministic mode, and `False` otherwise."""
4443
xcode_config = ctx.attr._xcode_config[apple_common.XcodeVersionConfig]
4544
xcode_version = xcode_config.xcode_version()
4645
if _compare_versions(xcode_version, _SUPPORTS_DETERMINISTIC_MODE) >= 0:
@@ -49,8 +48,7 @@ def _can_use_deterministic_libtool(ctx):
4948
return False
5049

5150
def _deterministic_libtool_flags(ctx):
52-
"""Returns additional `libtool` flags to enable deterministic mode, if they
53-
are available."""
51+
"""Returns additional `libtool` flags to enable deterministic mode, if they are available."""
5452
if _can_use_deterministic_libtool(ctx):
5553
return ["-D"]
5654
return []
@@ -117,48 +115,6 @@ def _impl(ctx):
117115
if ctx.attr.cpu in ["ios_sim_arm64", "tvos_sim_arm64", "watchos_arm64"]:
118116
arch = "arm64"
119117

120-
all_compile_actions = [
121-
ACTION_NAMES.c_compile,
122-
ACTION_NAMES.cpp_compile,
123-
ACTION_NAMES.linkstamp_compile,
124-
ACTION_NAMES.assemble,
125-
ACTION_NAMES.preprocess_assemble,
126-
ACTION_NAMES.cpp_header_parsing,
127-
ACTION_NAMES.cpp_module_compile,
128-
ACTION_NAMES.cpp_module_codegen,
129-
ACTION_NAMES.clif_match,
130-
ACTION_NAMES.lto_backend,
131-
]
132-
133-
all_cpp_compile_actions = [
134-
ACTION_NAMES.cpp_compile,
135-
ACTION_NAMES.linkstamp_compile,
136-
ACTION_NAMES.cpp_header_parsing,
137-
ACTION_NAMES.cpp_module_compile,
138-
ACTION_NAMES.cpp_module_codegen,
139-
ACTION_NAMES.clif_match,
140-
]
141-
142-
preprocessor_compile_actions = [
143-
ACTION_NAMES.c_compile,
144-
ACTION_NAMES.cpp_compile,
145-
ACTION_NAMES.linkstamp_compile,
146-
ACTION_NAMES.preprocess_assemble,
147-
ACTION_NAMES.cpp_header_parsing,
148-
ACTION_NAMES.cpp_module_compile,
149-
ACTION_NAMES.clif_match,
150-
]
151-
152-
codegen_compile_actions = [
153-
ACTION_NAMES.c_compile,
154-
ACTION_NAMES.cpp_compile,
155-
ACTION_NAMES.linkstamp_compile,
156-
ACTION_NAMES.assemble,
157-
ACTION_NAMES.preprocess_assemble,
158-
ACTION_NAMES.cpp_module_codegen,
159-
ACTION_NAMES.lto_backend,
160-
]
161-
162118
all_link_actions = [
163119
ACTION_NAMES.cpp_link_executable,
164120
ACTION_NAMES.cpp_link_dynamic_library,
@@ -2765,6 +2721,7 @@ def _impl(ctx):
27652721
ubsan_feature,
27662722
default_sanitizer_flags_feature,
27672723
archive_param_file_feature,
2724+
supports_pic_feature,
27682725
]
27692726
elif (ctx.attr.cpu == "darwin_x86_64" or
27702727
ctx.attr.cpu == "darwin_arm64" or
@@ -2847,6 +2804,7 @@ def _impl(ctx):
28472804
ubsan_feature,
28482805
default_sanitizer_flags_feature,
28492806
archive_param_file_feature,
2807+
supports_pic_feature,
28502808
]
28512809
else:
28522810
fail("Unreachable")

crosstool/osx_cc_configure.bzl

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ load(
2525
"get_env",
2626
)
2727

28-
def _get_escaped_xcode_cxx_inc_directories(repository_ctx, cc, xcode_toolchains):
28+
def _get_escaped_xcode_cxx_inc_directories(repository_ctx, xcode_toolchains):
2929
"""Compute the list of default C++ include paths on Xcode-enabled darwin.
3030
3131
Args:
3232
repository_ctx: The repository context.
33-
cc: The default C++ compiler on the local system.
3433
xcode_toolchains: A list containing the xcode toolchains available
3534
Returns:
3635
include_paths: A list of builtin include paths.
@@ -139,6 +138,9 @@ def configure_osx_toolchain(repository_ctx):
139138
140139
Args:
141140
repository_ctx: The repository context.
141+
142+
Returns:
143+
Whether or not configuration was successful
142144
"""
143145
paths = resolve_labels(repository_ctx, [
144146
"@bazel_tools//tools/cpp:armeabi_cc_toolchain_config.bzl",
@@ -172,8 +174,6 @@ def configure_osx_toolchain(repository_ctx):
172174
# cc_wrapper.sh script. The wrapped_clang binary is already hardcoded
173175
# into the Objective-C crosstool actions, anyway, so this ensures that
174176
# the C++ actions behave consistently.
175-
cc = repository_ctx.path("wrapped_clang")
176-
177177
cc_path = '"$(/usr/bin/dirname "$0")"/wrapped_clang'
178178
repository_ctx.template(
179179
"cc_wrapper.sh",
@@ -220,7 +220,7 @@ def configure_osx_toolchain(repository_ctx):
220220
gcov_path = repository_ctx.which(gcov_path)
221221
tool_paths["gcov"] = gcov_path
222222

223-
escaped_include_paths = _get_escaped_xcode_cxx_inc_directories(repository_ctx, cc, xcode_toolchains)
223+
escaped_include_paths = _get_escaped_xcode_cxx_inc_directories(repository_ctx, xcode_toolchains)
224224
escaped_cxx_include_directories = []
225225
for path in escaped_include_paths:
226226
escaped_cxx_include_directories.append((" \"%s\"," % path))

0 commit comments

Comments
 (0)