Comments (4)
I can expose it like this:
// FSConfigWithSysFSMount extends FSConfig to expose the existing WithSysFSMount function.
// https://github.com/tetratelabs/wazero/issues/2076
type FSConfigWithSysFSMount interface {
WithSysFSMount(fs wazero_sys.FS, guestPath string) wazero.FSConfig
}
var writableFS wazero_sys.FS
fsConf.(FSConfigWithSysFSMount).WithSysFSMount(writableFS, "/")
But this is a runtime type assertion and can't be enforced at compile time, ideally FSConfigWithSysFSMount would be exposed by wazero
and type-asserted that fsConfig
conforms to that exported interface.
from wazero.
Admittedly, I think this may not be easy to find, but you should be able to write the following:
import (
"github.com/tetratelabs/wazero"
"github.com/tetratelabs/wazero/experimental/sysfs"
)
func main() {
var sys.FS = ...
config := wazero.NewFSConfig()
config.(sysfs.FSConfig).WithSysFSMount(myFs, guestPath)
...
}
e.g. see
wazero/experimental/sysfs/config_example_test.go
Lines 14 to 23 in 2f2b6a9
from wazero.
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)
from wazero.
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 :)
from wazero.
Related Issues (20)
- [Question] How to handle importing memory HOT 4
- compiler(arm64) overflow in call relocations HOT 8
- Can a Runtime be reused in parallel and across multiple mutually-untrusted modules? HOT 2
- Please tell me how to properly handle stdio HOT 3
- GOOS=wasip1 embedding wazero succeeds with wasmtime but fails with wazero on arm64 HOT 5
- Make compilation faster HOT 20
- Support dialing sockets, udp, tcp, unix. HOT 3
- Race condition during module compilation engine HOT 7
- `wazero.NewCompilationCache` creates a `CompilationCache` instance that's not really caching anything HOT 8
- Race condition during module interpretation with `interpreter` engine HOT 1
- When using `Instantiate` & `InstantiateWithConfig` modules are removed implicitly from the in-memory cache
- Binary built with simd128 works with arm64 but fails with amd64 HOT 12
- Plans to support component model? HOT 4
- wasm debug build crashes HOT 9
- performance issue in browser environment HOT 3
- [help want] the program is hangup when read my net file system HOT 1
- [Question] Compilation cache over different versions HOT 1
- `unreachable` error and stack trace if compiled and extra memory, not otherwise HOT 4
- Clarification on concurrency semantics for invocations HOT 2
- `path_open` with an empty path should fail
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wazero.