gh-90473: wasmtime does not support absolute symlinks (GH-93490)

This commit is contained in:
Christian Heimes 2022-06-05 09:59:47 +02:00 committed by GitHub
parent 713eb184b5
commit 6f8367d348
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 23 deletions

View file

@ -171,9 +171,13 @@ def can_symlink():
global _can_symlink
if _can_symlink is not None:
return _can_symlink
symlink_path = TESTFN + "can_symlink"
# WASI / wasmtime prevents symlinks with absolute paths, see man
# openat2(2) RESOLVE_BENEATH. Almost all symlink tests use absolute
# paths. Skip symlink tests on WASI for now.
src = os.path.abspath(TESTFN)
symlink_path = src + "can_symlink"
try:
os.symlink(TESTFN, symlink_path)
os.symlink(src, symlink_path)
can = True
except (OSError, NotImplementedError, AttributeError):
can = False