-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[browser][io] Emscripten does not support file locking. #40065
Comments
@kjpou1 what do mean it does not work correctly? Does it work only for some operations or not at all? |
It does not seem to work at all. What does not work it that it does not throw an error.
The test above does not throw an error and in this case will write to the file and then read the bytes from the file. |
That's strange and it looks like emscripten bug. The API is implemented and it's used by some of emscripten internal tooling (https://github.com/emscripten-core/emscripten/blob/master/tools/filelock.py#L363). Could you report a bug? |
Issue opened here: emscripten-core/emscripten#11797 |
Assigning to @kjpou1 - not sure if there were more discussions since your last comment with emscripten issue linked. |
Not sure that file locking matters in the vfs context. Also doesn't seem to be that high of a priority on the emscripten side. I would recommend closing and adjusting the tests accordingly. Note that the current emscripten implementation is just going to blanket succeed. |
Steve, I think this really is a bug and should be fixed. Of course lower priority but still should work as designed if someones code is relying on the file locking. Right now the tests use ActiveIssue so that the tests are marked and continue to be documented. I that is not what everyone wants could I be provided more of a description of how we should adjust the tests if we are to close this issue. Not use ActiveIssue and do a platform specific test as follows:
|
Advisory lock on an open file is provided by calling
flock
on the filestream.https://github.com/dotnet/runtime/blob/master/src/libraries/Native/Unix/System.Native/pal_io.c#L641-L646
This does not work correctly in the filesystem interface running under wasm.
The text was updated successfully, but these errors were encountered: