alexcrichton requested cfallin for a review on PR #8463.
alexcrichton opened PR #8463 from alexcrichton:initial-no-std
to bytecodealliance:main
:
This commit is the first in what will be multiple PRs to migrate Wasmtime to being compatible with
#![no_std]
. This work is outlined in #8341 and the rough plan I have in mind is to go on a crate-by-crate basis and use CI as a "ratchet" to ensure thatno_std
compat is preserved. In that sense this PR is a bit of a template for future PRs.This PR migrates a few small crates to
no_std
, basically those that need no changes beyond simply adding the attribute. The nontrivial parts introduced in this PR are:
CI is introduced to verify that a subset of crates can indeed be built on a
no_std
target. The target selected isx86_64-unknown-none
which is known to not havestd
and will result in a build error if it's attempted to be used.The
anyhow
crate, whichwasmtime-jit-icache-coherence
now depends on, has itsstd
feature disabled by default in Wasmtime's workspace. This means that some crates which requirestd
now need to explicitly enable the feature, but it means that by-default its usage is appropriate forno_std
.The first point should provide CI checks that compatibility with
no_std
indeed works, at least from an "it compiles" perspective. Note that it's not sufficient to test with a target likex86_64-unknown-linux-gnu
becauseextern crate std
will work on that target, even when#![no_std]
is active.The second point however is likely to increase maintenance burden in Wasmtime unfortunately. Namely we'll inevitably, either here or in the future, forget to turn on some feature for some crate that's not covered in CI checks. While I've tried to do my best here in covering it there's no guarantee that everything will work and the combinatorial explosion of what could be checked in CI can't all be added to CI. Instead we'll have to rely on bug fixes, users, and perhaps point releases to add more use cases to CI over time as we see fit.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #8463.
alexcrichton requested wasmtime-core-reviewers for a review on PR #8463.
alexcrichton requested fitzgen for a review on PR #8463.
alexcrichton requested wasmtime-default-reviewers for a review on PR #8463.
alexcrichton commented on PR #8463:
I'll also note that, procedurally, my plan is to discuss https://github.com/bytecodealliance/wasmtime/issues/8341 in the Wasmtime meeting tomorrow and assuming no objections start landing PRs, but the goal here isn't to jump the gun by any means but rather just be prepared.
alexcrichton updated PR #8463.
alexcrichton updated PR #8463.
fitzgen submitted PR review.
alexcrichton updated PR #8463.
alexcrichton has enabled auto merge for PR #8463.
alexcrichton updated PR #8463.
alexcrichton updated PR #8463.
alexcrichton has enabled auto merge for PR #8463.
alexcrichton updated PR #8463.
alexcrichton has enabled auto merge for PR #8463.
alexcrichton updated PR #8463.
alexcrichton has enabled auto merge for PR #8463.
alexcrichton updated PR #8463.
alexcrichton updated PR #8463.
alexcrichton merged PR #8463.
Last updated: Dec 23 2024 at 13:07 UTC