[libcxx-commits] [libcxx] 2408fc2 - [libc++] Avoid relying on `realpath` being installed on the system

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 16 10:07:29 PDT 2020


Author: Louis Dionne
Date: 2020-10-16T13:07:18-04:00
New Revision: 2408fc2a1e85c0e9e9c6e8b1dd00d2507dda38f4

URL: https://github.com/llvm/llvm-project/commit/2408fc2a1e85c0e9e9c6e8b1dd00d2507dda38f4
DIFF: https://github.com/llvm/llvm-project/commit/2408fc2a1e85c0e9e9c6e8b1dd00d2507dda38f4.diff

LOG: [libc++] Avoid relying on `realpath` being installed on the system

It doesn't appear to be a standard utility.

Added: 
    

Modified: 
    libcxx/utils/ci/apple-install-libcxx.sh

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/ci/apple-install-libcxx.sh b/libcxx/utils/ci/apple-install-libcxx.sh
index 74d7b24ac00d..f5b5d7709b11 100755
--- a/libcxx/utils/ci/apple-install-libcxx.sh
+++ b/libcxx/utils/ci/apple-install-libcxx.sh
@@ -98,6 +98,9 @@ for arg in llvm_root build_dir symbols_dir install_dir sdk architectures version
 done
 
 # Allow using relative paths
+function realpath() {
+    if [[ $1 = /* ]]; then echo "$1"; else echo "$(pwd)/${1#./}"; fi
+}
 for arg in llvm_root build_dir symbols_dir install_dir cache; do
     path="$(realpath "${!arg}")"
     eval "${arg}=\"${path}\""


        


More information about the libcxx-commits mailing list