Skip to content

ls: fall back to "." metadata for ".." on WASI#11633

Merged
sylvestre merged 2 commits intouutils:mainfrom
sylvestre:wasm-ls
Apr 4, 2026
Merged

ls: fall back to "." metadata for ".." on WASI#11633
sylvestre merged 2 commits intouutils:mainfrom
sylvestre:wasm-ls

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

On WASI the sandbox blocks access to the parent directory at the preopened root, causing ls -a to show an error and display ".." with question marks. Fall back to the current directory metadata so the entry appears with valid information.

On WASI the sandbox blocks access to the parent directory at the
preopened root, causing ls -a to show an error and display ".."
with question marks. Fall back to the current directory metadata
so the entry appears with valid information.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

GNU testsuite comparison:

Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/misc/io-errors is no longer failing!
Congrats! The gnu test tests/basenc/bounded-memory is now passing!
Congrats! The gnu test tests/rm/many-dir-entries-vs-OOM is now passing!

@cakebaker
Copy link
Copy Markdown
Contributor

How is the test supposed to be run with wasm? I'm able to run the ls unit tests, but so far I couldn't figure out how to run the integration tests.

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Apr 4, 2026

Why do not we use wasmtime --dir ..::.. --dir .::. ls.wasm instead?

@sylvestre
Copy link
Copy Markdown
Contributor Author

sylvestre commented Apr 4, 2026

in theory:
CARGO_TARGET_WASM32_WASIP1_RUNNER=wasmtime cargo test --locked --target wasm32-wasip1 --no-default-features -p uu_ls

@sylvestre
Copy link
Copy Markdown
Contributor Author

Why do not we use wasmtime --dir ..::.. --dir .::. ls.wasm instead?

without that, we get an ugly error in wasm runtime

@sylvestre sylvestre merged commit 8c100da into uutils:main Apr 4, 2026
167 checks passed
@sylvestre
Copy link
Copy Markdown
Contributor Author

automerging as i need it now :)

@sylvestre sylvestre deleted the wasm-ls branch April 4, 2026 20:21
kevinburkesegment pushed a commit to kevinburkesegment/coreutils that referenced this pull request Apr 6, 2026
* ls: fall back to "." metadata for ".." on WASI

On WASI the sandbox blocks access to the parent directory at the
preopened root, causing ls -a to show an error and display ".."
with question marks. Fall back to the current directory metadata
so the entry appears with valid information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants