Recreate Boost symlink at runtime to survive sdist. Closes: #13763.

pull/13779/merge
Jussi Pakkanen 1 month ago
parent 4d1623078f
commit adeb844b40
  1. 5
      run_format_tests.py
  2. 24
      run_project_tests.py
  3. 1
      test cases/frameworks/35 boost symlinks/boost/include/boost
  4. 6
      test cases/frameworks/35 boost symlinks/meson.build
  5. 3
      test cases/frameworks/35 boost symlinks/test.json

@ -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}.')

@ -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,18 @@ def clear_transitive_files() -> None:
symlink_file2.unlink()
except FileNotFoundError:
pass
try:
symlink_file3.unlink()
symlink_test_dir2.rmdir()
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')

@ -1,5 +1,11 @@
project('boosttestsymlinks', 'cpp')
bm = build_machine.system()
if bm == 'windows' or bm == 'cygwin'
error('MESON_SKIP_TEST: Windows and symlinks do not mix.')
endif
dep = dependency('boost', modules : ['regex', 'python'], required: false)
assert(dep.found(), 'expected to find a fake version of boost')

@ -0,0 +1,3 @@
{
"expect_skip_on_jobname": ["azure", "cygwin", "msys2"]
}
Loading…
Cancel
Save