From 3e9ab962b5aecd2fcd045fd4b08e4a440dcd3ce6 Mon Sep 17 00:00:00 2001 From: Christopher Sauer Date: Fri, 22 Apr 2022 21:36:15 -0700 Subject: [PATCH 1/2] Filter libtool warning about table of contents The warning is unlikely to indicate a real issue, and Bazel already silences parallel warnings with `-no_warning_for_no_symbols`. For more context, see https://github.com/bazelbuild/bazel/issues/4057 --- tools/objc/libtool.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/objc/libtool.sh b/tools/objc/libtool.sh index 0d8f643884e733..a9093a515e62a7 100755 --- a/tools/objc/libtool.sh +++ b/tools/objc/libtool.sh @@ -32,7 +32,14 @@ if [ -z ${MY_LOCATION+x} ]; then fi fi -WRAPPER="${MY_LOCATION}/xcrunwrapper.sh" +function libtool() { + # Just invoke libtool via xcrunwrapper + "${MY_LOCATION}/xcrunwrapper.sh" 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 + # ...and not silencable via a flag. +} if [ ! -f "${MY_LOCATION}"/libtool_check_unique ] ; then echo "libtool_check_unique not found. Please file an issue at github.com/bazelbuild/bazel" @@ -40,7 +47,7 @@ if [ ! -f "${MY_LOCATION}"/libtool_check_unique ] ; then elif "${MY_LOCATION}"/libtool_check_unique "$@"; then # If there are no duplicate .o basenames, # libtool can be invoked with the original arguments. - "${WRAPPER}" libtool "$@" + libtool "$@" exit fi @@ -131,4 +138,4 @@ for arg in "$@"; do done printf '%s\n' "${ARGS[@]}" > "$TEMPDIR/processed.params" -"${WRAPPER}" libtool "@$TEMPDIR/processed.params" +libtool "@$TEMPDIR/processed.params" From a5a8955b90561e48ab80d52e9d18600a06c23fe6 Mon Sep 17 00:00:00 2001 From: Christopher Sauer Date: Fri, 22 Apr 2022 22:02:37 -0700 Subject: [PATCH 2/2] libtool -> invoke_libtool In response to @keith's good feedback. --- tools/objc/libtool.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/objc/libtool.sh b/tools/objc/libtool.sh index a9093a515e62a7..c8bcd183c13517 100755 --- a/tools/objc/libtool.sh +++ b/tools/objc/libtool.sh @@ -32,7 +32,7 @@ if [ -z ${MY_LOCATION+x} ]; then fi fi -function libtool() { +function invoke_libtool() { # Just invoke libtool via xcrunwrapper "${MY_LOCATION}/xcrunwrapper.sh" libtool "$@" \ 2> >(grep -v "the table of contents is empty (no object file members in the"` @@ -47,7 +47,7 @@ if [ ! -f "${MY_LOCATION}"/libtool_check_unique ] ; then elif "${MY_LOCATION}"/libtool_check_unique "$@"; then # If there are no duplicate .o basenames, # libtool can be invoked with the original arguments. - libtool "$@" + invoke_libtool "$@" exit fi @@ -138,4 +138,4 @@ for arg in "$@"; do done printf '%s\n' "${ARGS[@]}" > "$TEMPDIR/processed.params" -libtool "@$TEMPDIR/processed.params" +invoke_libtool "@$TEMPDIR/processed.params"