filesystem: ErrorCode::NotPermitted when hard-linking directory#12137
Closed
wingo wants to merge 1 commit intobytecodealliance:mainfrom
Closed
filesystem: ErrorCode::NotPermitted when hard-linking directory#12137wingo wants to merge 1 commit intobytecodealliance:mainfrom
wingo wants to merge 1 commit intobytecodealliance:mainfrom
Conversation
On Windows, attempting to hard-link a directory gave ErrorCode::Access instead of NotPermitted. Fix it in the wasi crate instead of cap-std or wasi-common because it's where the sync/tokio configurations flow. Should fix wasmtime for WebAssembly/wasi-testsuite#177.
8288935 to
26724f3
Compare
Contributor
Author
|
As with #12136 (comment), I don't have a Windows system on which to test, just that the fix seems right (and will be tested via wasi-testsuite). |
rvolosatovs
reviewed
Dec 8, 2025
| #[cfg(windows)] | ||
| Err(ErrorCode::Access) => Err(ErrorCode::NotPermitted), | ||
| Ok(()) => Ok(()), | ||
| Err(err) => Err(err.into()), |
Member
There was a problem hiding this comment.
Isn't this into() redundant?
Looking at L928 it appears that the err is already ErrorCode?
Contributor
Author
There was a problem hiding this comment.
hard_link appears to return err as std::io::Error. In any case that is what the compiler thinks :)
rvolosatovs
approved these changes
Dec 8, 2025
Contributor
Author
|
It turns out this commit is a mistake; there are cases in which Windows can return EACCESS that aren't related to hard-links to directories. So, instead I filed WebAssembly/WASI#848 to relax the spec and loosened the wasi-testsuite test. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows, attempting to hard-link a directory gave ErrorCode::Access instead of NotPermitted. Fix it in the wasi crate instead of cap-std or wasi-common because it's where the sync/tokio configurations flow. Should fix wasmtime for
WebAssembly/wasi-testsuite#177.