[libcxx-commits] [libcxx] 2089e76 - [libc++] Try to fix cross-loading of lit.local.cfg on Windows

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 27 13:28:40 PDT 2020


Author: Louis Dionne
Date: 2020-10-27T16:28:29-04:00
New Revision: 2089e762d00cbfdc8db55fd61f55e2f7efa46f67

URL: https://github.com/llvm/llvm-project/commit/2089e762d00cbfdc8db55fd61f55e2f7efa46f67
DIFF: https://github.com/llvm/llvm-project/commit/2089e762d00cbfdc8db55fd61f55e2f7efa46f67.diff

LOG: [libc++] Try to fix cross-loading of lit.local.cfg on Windows

On windows, the previous path replacement using forward slashes wouldn't
work, and so we'd end up including the same file again. We would do that
until we'd hit the recursion limit of the Python interpreter.

Instead, use `os.path` to properly replace without assuming a specific
path separator.

Added: 
    

Modified: 
    libcxx/test/libcxx/input.output/file.streams/lit.local.cfg
    libcxx/test/libcxx/input.output/iostream.format/lit.local.cfg
    libcxx/test/libcxx/input.output/iostream.objects/lit.local.cfg
    libcxx/test/libcxx/input.output/iostreams.base/lit.local.cfg
    libcxx/test/libcxx/input.output/stream.buffers/lit.local.cfg
    libcxx/test/libcxx/input.output/string.streams/lit.local.cfg
    libcxx/test/libcxx/localization/lit.local.cfg

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/input.output/file.streams/lit.local.cfg b/libcxx/test/libcxx/input.output/file.streams/lit.local.cfg
index 1fc6b7941603..b89e35b434da 100644
--- a/libcxx/test/libcxx/input.output/file.streams/lit.local.cfg
+++ b/libcxx/test/libcxx/input.output/file.streams/lit.local.cfg
@@ -1,4 +1,6 @@
 # Load the same local configuration as the corresponding one in libcxx/test/std
 import os
-localConfig = os.path.realpath(__file__).replace('/test/libcxx/', '/test/std/')
+inLibcxx = os.path.join('libcxx', 'test', 'libcxx')
+inStd = os.path.join('libcxx', 'test', 'std')
+localConfig = os.path.normpath(os.path.realpath(__file__)).replace(inLibcxx, inStd)
 config.load_from_path(localConfig, lit_config)

diff  --git a/libcxx/test/libcxx/input.output/iostream.format/lit.local.cfg b/libcxx/test/libcxx/input.output/iostream.format/lit.local.cfg
index 1fc6b7941603..b89e35b434da 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/lit.local.cfg
+++ b/libcxx/test/libcxx/input.output/iostream.format/lit.local.cfg
@@ -1,4 +1,6 @@
 # Load the same local configuration as the corresponding one in libcxx/test/std
 import os
-localConfig = os.path.realpath(__file__).replace('/test/libcxx/', '/test/std/')
+inLibcxx = os.path.join('libcxx', 'test', 'libcxx')
+inStd = os.path.join('libcxx', 'test', 'std')
+localConfig = os.path.normpath(os.path.realpath(__file__)).replace(inLibcxx, inStd)
 config.load_from_path(localConfig, lit_config)

diff  --git a/libcxx/test/libcxx/input.output/iostream.objects/lit.local.cfg b/libcxx/test/libcxx/input.output/iostream.objects/lit.local.cfg
index 1fc6b7941603..b89e35b434da 100644
--- a/libcxx/test/libcxx/input.output/iostream.objects/lit.local.cfg
+++ b/libcxx/test/libcxx/input.output/iostream.objects/lit.local.cfg
@@ -1,4 +1,6 @@
 # Load the same local configuration as the corresponding one in libcxx/test/std
 import os
-localConfig = os.path.realpath(__file__).replace('/test/libcxx/', '/test/std/')
+inLibcxx = os.path.join('libcxx', 'test', 'libcxx')
+inStd = os.path.join('libcxx', 'test', 'std')
+localConfig = os.path.normpath(os.path.realpath(__file__)).replace(inLibcxx, inStd)
 config.load_from_path(localConfig, lit_config)

diff  --git a/libcxx/test/libcxx/input.output/iostreams.base/lit.local.cfg b/libcxx/test/libcxx/input.output/iostreams.base/lit.local.cfg
index 1fc6b7941603..b89e35b434da 100644
--- a/libcxx/test/libcxx/input.output/iostreams.base/lit.local.cfg
+++ b/libcxx/test/libcxx/input.output/iostreams.base/lit.local.cfg
@@ -1,4 +1,6 @@
 # Load the same local configuration as the corresponding one in libcxx/test/std
 import os
-localConfig = os.path.realpath(__file__).replace('/test/libcxx/', '/test/std/')
+inLibcxx = os.path.join('libcxx', 'test', 'libcxx')
+inStd = os.path.join('libcxx', 'test', 'std')
+localConfig = os.path.normpath(os.path.realpath(__file__)).replace(inLibcxx, inStd)
 config.load_from_path(localConfig, lit_config)

diff  --git a/libcxx/test/libcxx/input.output/stream.buffers/lit.local.cfg b/libcxx/test/libcxx/input.output/stream.buffers/lit.local.cfg
index 1fc6b7941603..b89e35b434da 100644
--- a/libcxx/test/libcxx/input.output/stream.buffers/lit.local.cfg
+++ b/libcxx/test/libcxx/input.output/stream.buffers/lit.local.cfg
@@ -1,4 +1,6 @@
 # Load the same local configuration as the corresponding one in libcxx/test/std
 import os
-localConfig = os.path.realpath(__file__).replace('/test/libcxx/', '/test/std/')
+inLibcxx = os.path.join('libcxx', 'test', 'libcxx')
+inStd = os.path.join('libcxx', 'test', 'std')
+localConfig = os.path.normpath(os.path.realpath(__file__)).replace(inLibcxx, inStd)
 config.load_from_path(localConfig, lit_config)

diff  --git a/libcxx/test/libcxx/input.output/string.streams/lit.local.cfg b/libcxx/test/libcxx/input.output/string.streams/lit.local.cfg
index 1fc6b7941603..b89e35b434da 100644
--- a/libcxx/test/libcxx/input.output/string.streams/lit.local.cfg
+++ b/libcxx/test/libcxx/input.output/string.streams/lit.local.cfg
@@ -1,4 +1,6 @@
 # Load the same local configuration as the corresponding one in libcxx/test/std
 import os
-localConfig = os.path.realpath(__file__).replace('/test/libcxx/', '/test/std/')
+inLibcxx = os.path.join('libcxx', 'test', 'libcxx')
+inStd = os.path.join('libcxx', 'test', 'std')
+localConfig = os.path.normpath(os.path.realpath(__file__)).replace(inLibcxx, inStd)
 config.load_from_path(localConfig, lit_config)

diff  --git a/libcxx/test/libcxx/localization/lit.local.cfg b/libcxx/test/libcxx/localization/lit.local.cfg
index 1fc6b7941603..b89e35b434da 100644
--- a/libcxx/test/libcxx/localization/lit.local.cfg
+++ b/libcxx/test/libcxx/localization/lit.local.cfg
@@ -1,4 +1,6 @@
 # Load the same local configuration as the corresponding one in libcxx/test/std
 import os
-localConfig = os.path.realpath(__file__).replace('/test/libcxx/', '/test/std/')
+inLibcxx = os.path.join('libcxx', 'test', 'libcxx')
+inStd = os.path.join('libcxx', 'test', 'std')
+localConfig = os.path.normpath(os.path.realpath(__file__)).replace(inLibcxx, inStd)
 config.load_from_path(localConfig, lit_config)


        


More information about the libcxx-commits mailing list