-
Notifications
You must be signed in to change notification settings - Fork 260
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
Expose fsConfig.WithSysFSMount for custom writable FS support #2076
Comments
I can expose it like this:
But this is a runtime type assertion and can't be enforced at compile time, ideally FSConfigWithSysFSMount would be exposed by |
Admittedly, I think this may not be easy to find, but you should be able to write the following:
e.g. see wazero/experimental/sysfs/config_example_test.go Lines 14 to 23 in 2f2b6a9
|
Could that just be added to the main FSConfig or perhaps add a NewFSConfig to sysfs which returns sysfs.FSConfig and have the type assertion in wazero? That way we can trust that the type assertion won't panic (covered by wazero tests) |
Eventually, they will. They are not yet because this API has not been tested extensively by our users so far. So, please do play with it and let us know what other roadblocks you encounter :) |
For those of you who just want to expose an in-memory FS to their module and was fighting wasip1 |
I would like to implement a read/write filesystem in pure-Go and in memory, (not exposing an os fs).
The writable
fs.FS
proposal for Go was declined for the time being: golang/go#45757There is a comment still mentioning this proposal here:
wazero/experimental/sys/fs.go
Line 28 in 1458ccc
experimental/sys.FS
is the writable FS interface:wazero/experimental/sys/fs.go
Line 29 in 1458ccc
fsConfig
hasWithSysFSMount
but it is not exposed in the FSConfig interface and is therefore inaccessible:wazero/fsconfig.go
Line 186 in 1458ccc
I want to write an implementation of experimental/sys.FS and provide it to wazero via WithSysFSMount.
Could WithSysFSMount be added to
fsConfig
or otherwise be exposed so I can call it? Thanks!The text was updated successfully, but these errors were encountered: