Skip to content

Commit

Permalink
Remove xcrunwrapper
Browse files Browse the repository at this point in the history
This is no longer required upstream, and we only use it in 1 place bazelbuild/bazel@35ed674
  • Loading branch information
keith committed Jul 27, 2023
1 parent 5551b3f commit 0841b08
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 62 deletions.
1 change: 0 additions & 1 deletion crosstool/BUILD.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ cc_toolchain_suite(
":make_hashed_objlist.py",
":wrapped_clang",
":wrapped_clang_pp",
":xcrunwrapper.sh",
],
)
for arch in _APPLE_ARCHS
Expand Down
14 changes: 9 additions & 5 deletions crosstool/libtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# libtool.sh runs the command passed to it using "xcrunwrapper libtool".
#
# It creates symbolic links for all input files with a path-hash appended
# to their original name (foo.o becomes foo_{md5sum}.o). This is to circumvent
# a bug in the original libtool that arises when two input files have the same
Expand All @@ -33,8 +31,7 @@ if [ -z ${MY_LOCATION+x} ]; then
fi

function invoke_libtool() {
# Just invoke libtool via xcrunwrapper
"${MY_LOCATION}/xcrunwrapper.sh" libtool "$@" \
/usr/bin/xcrun libtool "$@" \
2> >(grep -v "the table of contents is empty (no object file members in the"`
`" library define global symbols)$" >&2)
# ^ Filtering a warning that's unlikely to indicate a real issue
Expand Down Expand Up @@ -137,5 +134,12 @@ for arg in "$@"; do
parse_option "$arg"
done

printf '%s\n' "${ARGS[@]}" > "$TEMPDIR/processed.params"
UPDATEDARGS=()
for ARG in "$@" ; do
ARG="${ARG//__BAZEL_XCODE_DEVELOPER_DIR__/${DEVELOPER_DIR}}"
ARG="${ARG//__BAZEL_XCODE_SDKROOT__/${SDKROOT}}"
UPDATEDARGS+=("${ARG}")
done

printf '%s\n' "${UPDATEDARGS[@]}" > "$TEMPDIR/processed.params"
invoke_libtool "@$TEMPDIR/processed.params"
2 changes: 0 additions & 2 deletions crosstool/osx_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def configure_osx_toolchain(repository_ctx):
# for more info
xcode_locator = Label("@bazel_tools//tools/osx:xcode_locator.m")
osx_cc_wrapper = Label("@bazel_tools//tools/cpp:osx_cc_wrapper.sh.tpl")
xcrunwrapper = Label("@build_bazel_apple_support//crosstool:xcrunwrapper.sh")
libtool = Label("@build_bazel_apple_support//crosstool:libtool.sh")
make_hashed_objlist = Label("@build_bazel_apple_support//crosstool:make_hashed_objlist.py")
cc_toolchain_config = Label("@build_bazel_apple_support//crosstool:cc_toolchain_config.bzl")
Expand Down Expand Up @@ -160,7 +159,6 @@ def configure_osx_toolchain(repository_ctx):
"%{env}": "",
},
)
repository_ctx.symlink(xcrunwrapper, "xcrunwrapper.sh")
repository_ctx.symlink(libtool, "libtool")
repository_ctx.symlink(make_hashed_objlist, "make_hashed_objlist.py")
repository_ctx.symlink(cc_toolchain_config, "cc_toolchain_config.bzl")
Expand Down
44 changes: 0 additions & 44 deletions crosstool/xcrunwrapper.sh

This file was deleted.

5 changes: 0 additions & 5 deletions test/starlark_apple_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ starlark_apple_binary = rule(
name = "xcode_config_label",
),
),
"_xcrunwrapper": attr.label(
cfg = "exec",
default = Label("@bazel_tools//tools/objc:xcrunwrapper"),
executable = True,
),
"binary_type": attr.string(default = "executable"),
"bundle_loader": attr.label(),
"deps": attr.label_list(
Expand Down
5 changes: 0 additions & 5 deletions test/starlark_apple_static_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ starlark_apple_static_library = rule(
name = "xcode_config_label",
),
),
"_xcrunwrapper": attr.label(
executable = True,
cfg = "exec",
default = Label("@bazel_tools//tools/objc:xcrunwrapper"),
),
"additional_linker_inputs": attr.label_list(
allow_files = True,
),
Expand Down

0 comments on commit 0841b08

Please sign in to comment.