-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
WASI-Build spec #10259
base: feature/wasi-tasks
Are you sure you want to change the base?
WASI-Build spec #10259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I've got LOTS of comments here but this is great progress and I'm getting even more excited about the project. Feel free to reach out to discuss anything.
|
||
windows/linux/mac all seem like they will have some specifics | ||
|
||
threadsafety? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hopefully not a problem here, should be able to treat as single-threaded (for now). Another place where a couple of // TODO thread safety
are probably fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC we're forced to single-threaded execution until threads land in WASI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah good point, there are two sides of thread safety:
- Inside the task
- In MSBuild outside the task.
Probably fine to deprioritize both, inside for @baronfel's reason and outside because task execution should appear single-threaded (due to MSBuild's multi-process instead of multi-thread model).
</PropertyGroup> | ||
|
||
<Target Name="RunWasmtime" AfterTargets="Build"> | ||
<Exec Command="wasmtime bin/$(Configuration)/$(TargetFramework)/wasi-wasm/AppBundle/$(AssemblyName).wasm" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be interesting to have a WASM program that does something "build-y" like read a list of files and write an output. The actual transformation doesn't have to be interesting, concatenation would be fine.
## Stories for requirements | ||
Currently tasks have unrestricted access to resources, Wasm/WASI runtimes provide a way to sandbox tasks (by default executables don't have access to any resources). This can be acheived by specifying Inputs and Outputs of these tasks and other resources they can access. | ||
|
||
We want to be able to run tasks written in other languages than C# in MSBuild. Those tasks will need a definition for how to write them. Invoking a Wasm runtime can easily run pre-compiled tasks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definition for how to write them. please explain what exactly you mean here.
We can use the Exec task in this manner to run an executable .wasm file (.NET example): | ||
- note that this execution does not get any resources so it can't manipulate files | ||
|
||
1. install [wasi-sdk](https://github.com/WebAssembly/wasi-sdk), [wasmtime](https://wasmtime.dev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this example, thanks!
- the compilation target is called wasm-wasi 👍👎 | ||
- *-> mostly use Wasm-tasks unless Wasm/WASI is more appropriate for that situation* | ||
|
||
### Open questions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this section is slightly outdated after the recent sync.
This is a PR for the proposed WASI-Build feature spec, only documentation