aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2024-10-11 17:15:43 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2024-10-11 17:39:56 +0300
commit0693a1f97d1039c19c1f03ca62278145845dc6a4 (patch)
tree0042f877e52d038acfef7356d0e2d5aa6340ca5c
parent739683943aa8caca37343b105a0f363abf772fa9 (diff)
downloadmeson-symlinknuke.zip
meson-symlinknuke.tar.gz
meson-symlinknuke.tar.bz2
Recreate Boost symlink at runtime to survive sdist. Closes: #13763.symlinknuke
-rwxr-xr-xrun_format_tests.py5
-rwxr-xr-xrun_project_tests.py25
l---------test cases/frameworks/35 boost symlinks/boost/include/boost1
3 files changed, 23 insertions, 8 deletions
diff --git a/run_format_tests.py b/run_format_tests.py
index 719b76b..30c9758 100755
--- a/run_format_tests.py
+++ b/run_format_tests.py
@@ -65,9 +65,12 @@ def check_format() -> None:
check_file(root / file)
def check_symlinks():
+ # Test data must NOT contain symlinks. setup.py
+ # butchers them. If you need symlinks, they need
+ # to be created on the fly.
for f in Path('test cases').glob('**/*'):
if f.is_symlink():
- if 'boost symlinks' in str(f):
+ if 'boost symlinks/boost/lib' in str(f):
continue
raise SystemExit(f'Test data dir contains symlink: {f}.')
diff --git a/run_project_tests.py b/run_project_tests.py
index 831b947..58657d4 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -1563,12 +1563,17 @@ def detect_tools(report: bool = True) -> None:
print('{0:<{2}}: {1}'.format(tool.tool, get_version(tool), max_width))
print()
-tmpdir = list(Path('.').glob('test cases/**/*install functions and follow symlinks'))
-assert len(tmpdir) == 1
-symlink_test_dir = tmpdir[0]
-symlink_file1 = symlink_test_dir / 'foo/link1'
-symlink_file2 = symlink_test_dir / 'foo/link2.h'
-del tmpdir
+tmpdir1 = list(Path('.').glob('test cases/**/*install functions and follow symlinks'))
+tmpdir2 = list(Path('.').glob('test cases/frameworks/*boost symlinks'))
+assert len(tmpdir1) == 1
+assert len(tmpdir2) == 1
+symlink_test_dir1 = tmpdir1[0]
+symlink_test_dir2 = tmpdir2[0] / 'boost/include'
+symlink_file1 = symlink_test_dir1 / 'foo/link1'
+symlink_file2 = symlink_test_dir1 / 'foo/link2.h'
+symlink_file3 = symlink_test_dir2 / 'boost'
+del tmpdir1
+del tmpdir2
def clear_transitive_files() -> None:
a = Path('test cases/common')
@@ -1585,11 +1590,19 @@ def clear_transitive_files() -> None:
symlink_file2.unlink()
except FileNotFoundError:
pass
+ try:
+ symlink_file3.unlink()
+ symlink_test_dir2.rmdir()
+ pass
+ except FileNotFoundError:
+ pass
def setup_symlinks() -> None:
try:
symlink_file1.symlink_to('file1')
symlink_file2.symlink_to('file1')
+ symlink_test_dir2.mkdir(parents=True, exist_ok=True)
+ symlink_file3.symlink_to('../Cellar/boost/0.3.0/include/boost')
except OSError:
print('symlinks are not supported on this system')
diff --git a/test cases/frameworks/35 boost symlinks/boost/include/boost b/test cases/frameworks/35 boost symlinks/boost/include/boost
deleted file mode 120000
index 8acd7e2..0000000
--- a/test cases/frameworks/35 boost symlinks/boost/include/boost
+++ /dev/null
@@ -1 +0,0 @@
-../Cellar/boost/0.3.0/include/boost \ No newline at end of file