[libcxx-commits] [libcxx] fee0026 - [libc++abi] Fix remote execution of .sh.cpp tests
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Apr 1 07:09:17 PDT 2020
Author: Sergej Jaskiewicz
Date: 2020-04-01T10:09:07-04:00
New Revision: fee0026fc7eb077d7808915fd30693883db2fd1d
URL: https://github.com/llvm/llvm-project/commit/fee0026fc7eb077d7808915fd30693883db2fd1d
DIFF: https://github.com/llvm/llvm-project/commit/fee0026fc7eb077d7808915fd30693883db2fd1d.diff
LOG: [libc++abi] Fix remote execution of .sh.cpp tests
This aims to fix test failures on the following buildbots:
- http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l
- http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64
Differential Revision: https://reviews.llvm.org/D77190
Added:
Modified:
libcxx/utils/libcxx/compiler.py
libcxx/utils/libcxx/test/config.py
libcxx/utils/libcxx/test/format.py
libcxx/utils/ssh.py
libcxxabi/test/incomplete_type.sh.cpp
Removed:
################################################################################
diff --git a/libcxx/utils/libcxx/compiler.py b/libcxx/utils/libcxx/compiler.py
index dd334cdbcff9..248b5ba8a98c 100644
--- a/libcxx/utils/libcxx/compiler.py
+++ b/libcxx/utils/libcxx/compiler.py
@@ -29,6 +29,7 @@ def __init__(self, config, path, flags=None, compile_flags=None, link_flags=None
self.flags = list(flags or [])
self.compile_flags = list(compile_flags or [])
self.link_flags = list(link_flags or [])
+ self.link_libcxxabi_flag = '-lc++abi'
self.warning_flags = list(warning_flags or [])
self.verify_supported = verify_supported
self.use_verify = use_verify
diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index 9c154bafa808..3e983e1b4d4a 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -822,6 +822,7 @@ def configure_link_flags_abi_library(self):
if cxxabi_library_root:
libname = self.make_static_lib_name('c++abi')
abs_path = os.path.join(cxxabi_library_root, libname)
+ self.cxx.link_libcxxabi_flag = abs_path
self.cxx.link_flags += [abs_path]
else:
self.cxx.link_flags += ['-lc++abi']
@@ -1025,6 +1026,7 @@ def configure_substitutions(self):
sub.append(('%{flags}', ' '.join(map(pipes.quote, self.cxx.flags))))
sub.append(('%{compile_flags}', ' '.join(map(pipes.quote, self.cxx.compile_flags))))
sub.append(('%{link_flags}', ' '.join(map(pipes.quote, self.cxx.link_flags))))
+ sub.append(('%{link_libcxxabi}', pipes.quote(self.cxx.link_libcxxabi_flag)))
if self.cxx.isVerifySupported():
sub.append(('%{verify}', ' '.join(self.cxx.verify_flags)))
# Add compile and build shortcuts
diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index ff23273ab9a6..a026c4f1ba02 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -125,8 +125,8 @@ def _execute(self, test, lit_config):
lit_config.fatal('Unsupported RUN line found in test %s' % name)
tmpDir, tmpBase = lit.TestRunner.getTempPaths(test)
- substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir,
- tmpBase)
+ substitutions = lit.TestRunner.getDefaultSubstitutions(
+ test, tmpDir, tmpBase, normalize_slashes=self.execute_external)
# Apply substitutions in FILE_DEPENDENCIES markup
data_files = lit.TestRunner.applySubstitutions(test.file_dependencies, substitutions,
diff --git a/libcxx/utils/ssh.py b/libcxx/utils/ssh.py
index 02e1e3bddc85..86ef5cf40f3a 100644
--- a/libcxx/utils/ssh.py
+++ b/libcxx/utils/ssh.py
@@ -15,6 +15,7 @@
import argparse
import os
+import posixpath
import subprocess
import sys
@@ -53,7 +54,7 @@ def main():
scp = lambda src, dst: ['scp', '-oBatchMode=yes', '-r', src, '{}:{}'.format(args.host, dst)]
# Create a temporary directory where the test will be run
- tmp = subprocess.check_output(ssh('mktemp -d /tmp/libcxx.XXXXXXXXXX')).strip()
+ tmp = subprocess.check_output(ssh('mktemp -d /tmp/libcxx.XXXXXXXXXX'), universal_newlines=True).strip()
# Ensure the test dependencies exist and scp them to the temporary directory.
# Test dependencies can be either files or directories, so the `scp` command
@@ -68,7 +69,7 @@ def main():
# We know it has been copied to the remote host when we handled the test
# dependencies above.
if exe:
- exe = os.path.join(tmp, os.path.basename(exe))
+ exe = posixpath.join(tmp, os.path.basename(exe))
# If there's an executable, make sure it has 'execute' permissions on the
# remote host. The host that compiled the executable might not have a notion
diff --git a/libcxxabi/test/incomplete_type.sh.cpp b/libcxxabi/test/incomplete_type.sh.cpp
index 71147241b760..a762d2f9c60e 100644
--- a/libcxxabi/test/incomplete_type.sh.cpp
+++ b/libcxxabi/test/incomplete_type.sh.cpp
@@ -15,14 +15,15 @@
// UNSUPPORTED: libcxxabi-no-exceptions
-// NOTE: Pass -lc++abi explicitly and before -lc++ so that -lc++ doesn't drag
+// NOTE: Link libc++abi explicitly and before libc++ so that libc++ doesn't drag
// in the system libc++abi installation on OS X. (DYLD_LIBRARY_PATH is ignored
// for shell tests because of Apple security features).
+// FILE_DEPENDENCIES: %t.exe
// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %t.one.o
// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %t.two.o -DTU_ONE
-// RUN: %{cxx} %{flags} %t.one.o %t.two.o -lc++abi %{link_flags} -o %t.exe
-// RUN: %t.exe
+// RUN: %{cxx} %{flags} %t.one.o %t.two.o %{link_libcxxabi} %{link_flags} -o %t.exe
+// RUN: %{exec} %t.exe
#include <stdio.h>
#include <cstring>
More information about the libcxx-commits
mailing list