-
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
Rename wasm32-wasi-threads target to wasm32-wasi-preview1-threads #434
Conversation
Apologies in advance if this is the wrong venue for this question... Would it be worth rolling the |
I know this is being planned for Rust, and given the ABI for preview 2 will be different than preview 1, I think it makes sense to apply the same for WASI libc. IRC @sunfishcode has already started some work towards supporting preview 2, so he might have different opinion on that though. Having said that, I think this can be a follow-up PR if we choose to make that change. |
@sbc100 / @abrown / @sunfishcode would you be able to review the PR? Many thanks |
I wasn't party the target renaming discussions but this seems like a change to me. |
I'll leave it @abrown to approve |
@loganek, I am in favor for doing something like this. I've been at WasmCon (and preparing for WasmCon) and so has @sunfishcode so I haven't been able to look at this closely. I will take a closer look early next week! |
it's better to avoid confusing triple parsing code further. |
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.
LGTM, pending my question about the import names. Naturally I think we are all concerned with an explosion in the number of targets (@yamt) but I talked to @sunfishcode and he is OK with this, noting that it is easier to add and remove new targets than change existing ones.
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'm against the change.
- it's incompatible with the spec and implementations as @abrown pointed out
- the rename doesn't solve anything. it just introduces confusions.
- after all, it's unclear if wasm32-wasi-threads will be an appropriate triplet for the new thread proposal.
Threading support is based on the [wasi-threads](https://github.com/WebAssembly/wasi-threads/) proposal. It was agreed that the proposal will not be included in any of the WASI releases; instead, there's [another proposal](https://github.com/abrown/thread-spawn) which adds spawning threads functionality to the WASM core. `wasm32-wasi-threads` is quite a nice name for the long-term solution, therefore I think it should be reserved for the `thread-spawn` proposal and use it once the proposal is ready. Given we'd like to support both `wasi-threads` and `thread-spawn` (at least for some time), I'm proposing adding another target specifically for wasi threads. I used the `wasm32-wasi-preview1-threads` target as the proposal kind of builds on top of wsp1. It's also the same as the [Rust target](https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/platform-support/wasm32-wasi-preview1-threads.md). I don't have strong opininion about the name and I'm open for suggestions; if there's a better name for that target, I'd be happy to update the PR. I keep both `wasm32-wasi-threads` and `wasm32-wasi-preview1-threads` for backward/forward compatibility. I know that `wasm32-wasi-threads` was considered experimental and would probably be safe to delete, but at the same time I think keeping it around is very little effort and can be re-used for thread-spawn in the future. If anybody thinks it's confusing and not worth it, happy to remove it. I also updated the `thread-spawn` import to be consistent with other wsp1 imports.
7d9f885
to
4b08dc6
Compare
This is already addressed
We introduce the new target so people can use it as a stable target for preview1 with threading. I think it'd be reasonable to do the same for non-threaded target as well, but that's outside of the scope for this PR - we can discuss this separately.
That's why I considered deleting the |
there is no problem with using the current "wasm-wasi-threads" as a stable target. for preview1 with threading.
sorry, i don't understand your logic. as the new one will be an extension to core wasm, it might be more appropriate to change the "wasm32" part as memory64 does. |
Rust seems to have settled on But when I build Rust code that depends on C code for the
I'm not sure if Rust is able to pass anything other than its own name for the target to Clang. So the rust names might need to be followed for the libc/SDK to work in Rust builds, or some other workaround would need to be found. |
Threading support is based on the wasi-threads proposal. It was agreed that the proposal will not be included in any of the WASI releases; instead, there's another proposal which adds spawning threads functionality to the WASM core.
wasm32-wasi-threads
is quite a nice name for the long-term solution, therefore I think it should be reserved for thethread-spawn
proposal and use it once the proposal is ready. Given we'd like to support bothwasi-threads
andthread-spawn
(at least for some time), I'm proposing adding another target specifically for wasi threads.I used the
wasm32-wasi-preview1-threads
target as the proposal kind of builds on top of wsp1. It's also the same as the Rust target. I don't have strong opininion about the name and I'm open for suggestions; if there's a better name for that target, I'd be happy to update the PR.I keep both
wasm32-wasi-threads
andwasm32-wasi-preview1-threads
for backward/forward compatibility. I know thatwasm32-wasi-threads
was considered experimental and would probably be safe to delete, but at the same time I think keeping it around is very little effort and can be re-used for thread-spawn in the future. If anybody thinks it's confusing and not worth it, happy to remove it.I also updated the
thread-spawn
import to be consistent with other wsp1 imports.