From 475a3539c4cf6370b600a1ca423008bac0a01147 Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Mon, 18 Nov 2024 02:53:31 -0800 Subject: [PATCH] Copybara Merge: https://github.com/bazelbuild/rules_cc/pull/275 BEGIN_PUBLIC Copybara import of the project: -- e4857939bdbcbd9acb2bda5db8716b089f160847 by Yun Peng : Use full path for dirname and basename in osx_cc_wrapper.sh.tpl Context: https://github.com/bazelbuild/rules_rust/pull/2998 END_PUBLIC COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_cc/pull/275 from bazelbuild:meteorcloudy-patch-4 e4857939bdbcbd9acb2bda5db8716b089f160847 PiperOrigin-RevId: 697557587 Change-Id: I6ceb3d5f0fd747acb758926750fa48493edbdf3e --- cc/private/toolchain/osx_cc_wrapper.sh.tpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cc/private/toolchain/osx_cc_wrapper.sh.tpl b/cc/private/toolchain/osx_cc_wrapper.sh.tpl index e40a98bb..4fbd546c 100644 --- a/cc/private/toolchain/osx_cc_wrapper.sh.tpl +++ b/cc/private/toolchain/osx_cc_wrapper.sh.tpl @@ -113,9 +113,9 @@ function call_install_name() { for rpath in ${RPATHS}; do for lib in ${LIBS}; do unset libname - if [ -f "$(dirname ${OUTPUT})/${rpath}/lib${lib}.so" ]; then + if [ -f "$(/usr/bin/dirname ${OUTPUT})/${rpath}/lib${lib}.so" ]; then libname="lib${lib}.so" - elif [ -f "$(dirname ${OUTPUT})/${rpath}/lib${lib}.dylib" ]; then + elif [ -f "$(/usr/bin/dirname ${OUTPUT})/${rpath}/lib${lib}.dylib" ]; then libname="lib${lib}.dylib" fi # ${libname-} --> return $libname if defined, or undefined otherwise. This is to make @@ -129,8 +129,8 @@ for rpath in ${RPATHS}; do done for libpath in ${LIB_PATHS}; do if [ -f "$libpath" ]; then - libname=$(basename "$libpath") - if [ -f "$(dirname ${OUTPUT})/${rpath}/${libname}" ]; then + libname=$(/usr/bin/basename "$libpath") + if [ -f "$(/usr/bin/dirname ${OUTPUT})/${rpath}/${libname}" ]; then call_install_name "${libpath}" "${rpath}" "${libname}" fi fi