[libcxx-commits] [libcxx] 2408fc2 - [libc++] Avoid relying on `realpath` being installed on the system
Shoaib Meenai via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Oct 16 11:39:30 PDT 2020
realpath also resolves symlinks, so your replacement function isn't exactly equivalent. I don't know if that matters for your use case though.
On 10/16/20, 10:08 AM, "libcxx-commits on behalf of Louis Dionne via libcxx-commits" <libcxx-commits-bounces at lists.llvm.org on behalf of libcxx-commits at lists.llvm.org> wrote:
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}\""
_______________________________________________
libcxx-commits mailing list
libcxx-commits at lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits
More information about the libcxx-commits
mailing list