-
Notifications
You must be signed in to change notification settings - Fork 200
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
bring cloud
throws unsupported operation error
#401
Comments
also, I found running
Looks like this test isn't getting run in CI - I have a hunch this could be related to the other bug... |
Investigation into this ticket turned out to be a much bigger issue than it seems. The Well, that breaks the WASI cap-based filesystem since a WASI module needs to have the directories it needs access to "preopened" before execution starts (security, who needs that, I know!). See the following references:
Here's the problem in code form:
Can't do that ^ because We can do two things:
Suggestions welcome. Tagging for visibility @yoav-steinberg / @MarkMcCulloh / @staycoolcall911 |
|
I think delegating file actions to the host (wing cli in our case) actually makes sense. I can see how for example in a browser context we would want a completely different way of locating and loading files. Instead of leaking out node apis into the compiler I'd define something like ICompilerHost which will expose a bunch of facilities for the compiler, amongst them file reading apis. Does that make sense? |
That makes sense. Compilers having a separate host is a common design. For reference:
While at it, we can also enable DWARF in WASI builds to help debugging. As well as providing a base host implementation for native builds (like how V8 offers a |
Work is currently in progress in my branch: main...sep/compiler-host Conditional inclusion: https://github.com/monadahq/winglang/blob/sep/compiler-host/libs/wingc/src/platform.rs
I kept native compatibility because removing it breaks so many other things. |
The rabbit hole just got deeper. So wasm-bindgen does not fully support WASI targets and some times it compiles, some times it does not and fails to generate bindings. Our compiler needs WASI to compile due to its dependency on tree-sitter. wasm-bindgen is needed to import/export stuff from/to the host. Since these two technologies do not mix (wasm-bindgen and WASI), we basically need to recreate wasm-bindgen's low level access in Rust through low level This is not hard, our platform use is pretty limited, but it's time consuming. |
@3p3r would you be able to create a draft pull request with this branch so I can provide some early feedback? |
bet. #414 |
Fixes #476 |
I tried this:
I expected to see this happen:
Some nice terraform generated
Instead, this happened:
Component
Select one or more:
Environment
Platform: MacOS
Version (
wing --version
): 0.2.95The text was updated successfully, but these errors were encountered: