-
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
Support compilation-only build by adding a runtime
feature
#7766
Support compilation-only build by adding a runtime
feature
#7766
Conversation
7e194e5
to
fccbf74
Compare
Subscribe to Label Actioncc @peterhuene
This issue or pull request has been labeled: "cranelift", "wasmtime:api", "wasmtime:config"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Label Messager: wasmtime:configIt looks like you are changing Wasmtime's configuration options. Make sure to
To modify this label's message, edit the To add new label messages or remove existing label messages, edit the |
This feature can be disabled to build `wasmtime` only for compilation. This can be useful when cross-compiling, especially on a target that can't run wasmtime itself (e.g. `wasm32`).
fccbf74
to
9afd818
Compare
Subscribe to Label Actioncc @peterhuene
This issue or pull request has been labeled: "wasi", "wasmtime:c-api"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
runtime
featureruntime
feature
b51c245
to
6320ca4
Compare
61dc35c
to
c145ea0
Compare
Ok, I've made most of the suggested changes:
Yes this seems to be cleaner.
I moved these three as well as
I added an extra build job in the CI (that runs on x86 linux). Hope this makes sense within the general CI setup of the project.
Yep this works fine, except I didn't add a
I put some things that were at the top-level under the |
Ah yep, that's working for me as well. Doing the debug build hits the limit though:
Would it make sense to add that code as an example along with a CI job do the compilation in Wasm and then execute on the host system? And would you want that job to run on all hosts in the matrix? |
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.
Ok thanks again for you work on this, it's all looking great to me! I've got some minor nits and things but I think it's probably best to go ahead and land this and I can follow-up myself with anything else I'd like. I'd also like to get the wasmtime
CLI itself compiling to wasm with just the cranelift/winch features enabled, but no need to do that here either! I think there's a rebase conflict but otherwise I'm happy to throw this at the merge queue.
Would it make sense to add that code as an example along with a CI job do the compilation in Wasm and then execute on the host system? And would you want that job to run on all hosts in the matrix?
I think so yeah, but I'll do that as part of a follow-up to get the wasmtime
CLI itself compiling. I tried for a bit to figure out what function was causing issues unsuccessfully, but this is also ok to work on as a follow-up.
My guess is that it's a function in cranelift-codegen for lowering since that's the main source of "big generated code". I have yet to confirm this though.
Ah ok so I found the function:
That corresponds to the ISLE-generated code for optimizing CLIF. I'm not personally aware of any low-hanging fruit on optimizing the output of ISLE for debug builds, so this may be a case where |
I resolved the conflicts. Happy to follow up with compiling the CLI to wasm as well. |
Ok sounds good! I don't necessarily have a concrete use case in mind but it seems like a neat way to demo how Cranelift can be compiled to wasm. I'll poke a bit more at the internals of the |
This is a follow-up to bytecodealliance#7766 with some more changes and reorganization. These are some small items here and there which shouldn't have any actual impact on functionality but are intended to reorganize a bit. Changes here include: * Move component artifact definitions to `wasmtime-environ` as core module ones already live there. * Rename the module with module artifacts from `instantiate` to `module_artifacts`. * Make `wasmtime-jit-icache-coherence` an optional dependency as only the `runtime` feature requires it. * Reorganize serialized metadata for wasmtime ELF files to consolidate everything back into `wasmtime::engine::serialization`. This is to prevent the definition of the serialization format being spread across a few files. * Touching up the `serialization` module to compile in all builds of the `wasmtime` crate.
I was curious to play around with this and went a bit far down the rabbit hole! I was able to hack things up and get things working though with #7842 and #7844, however. That's perhaps a bit of a taste of how cross-compilation, especially across pointer widths, is not the most well trodden path in Wasmtime so there may be a few other lingering bugs. Mostly just something to be aware of, and I'd hope that we can start adding regression tests in CI once we've got CLI support! |
* Shuffle some items around in `wasmtime` This is a follow-up to #7766 with some more changes and reorganization. These are some small items here and there which shouldn't have any actual impact on functionality but are intended to reorganize a bit. Changes here include: * Move component artifact definitions to `wasmtime-environ` as core module ones already live there. * Rename the module with module artifacts from `instantiate` to `module_artifacts`. * Make `wasmtime-jit-icache-coherence` an optional dependency as only the `runtime` feature requires it. * Reorganize serialized metadata for wasmtime ELF files to consolidate everything back into `wasmtime::engine::serialization`. This is to prevent the definition of the serialization format being spread across a few files. * Touching up the `serialization` module to compile in all builds of the `wasmtime` crate. * fix docs typo --------- Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
This commit fixes an accidental regression from bytecodealliance#7766 where `infer_native_flags` is called even if a target is explicitly specified to a `Config`. Now inference only happens if a target isn't specified meaning that the host is selected.
This commit fixes an accidental regression from #7766 where `infer_native_flags` is called even if a target is explicitly specified to a `Config`. Now inference only happens if a target isn't specified meaning that the host is selected.
) This commit fixes an accidental regression from bytecodealliance#7766 where `infer_native_flags` is called even if a target is explicitly specified to a `Config`. Now inference only happens if a target isn't specified meaning that the host is selected.
) This commit fixes an accidental regression from bytecodealliance#7766 where `infer_native_flags` is called even if a target is explicitly specified to a `Config`. Now inference only happens if a target isn't specified meaning that the host is selected.
This commit fixes an accidental regression from #7766 where `infer_native_flags` is called even if a target is explicitly specified to a `Config`. Now inference only happens if a target isn't specified meaning that the host is selected. Co-authored-by: Alex Crichton <alex@alexcrichton.com>
Initial draft of changes discussed here: #7652