-
Notifications
You must be signed in to change notification settings - Fork 766
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
feat(wasm-builder): add support for new wasm32v1-none
target
#7008
base: master
Are you sure you want to change the base?
feat(wasm-builder): add support for new wasm32v1-none
target
#7008
Conversation
Review required! Latest push from author must always be reviewed |
How do I pass CI checks like SemVer and other? |
Ping @bkchr It seems the CI won't trigger. |
@StackOverflowExcept1on https://github.com/paritytech/polkadot-sdk/actions/runs/12674781431/job/35324397805?pr=7008 This required CI failed, could you fix it? |
@jasl @bkchr I'll fix that in the next 30 minutes. Also wondering if we'll have to update the runners tomorrow, since the new version 1.84 will be stable tomorrow. I mean that the |
Head branch was pushed to by a user without write access
I'm not Parity staff, so I don't know... |
Actually I realized something, @StackOverflowExcept1on can we change the pr to make the new target optional? So, it should still accept the |
@bkchr For now, do you want to use an environment variable like |
Several required CI checks fail. Maybe the latest patch has trouble |
@jasl I think it's some kind of problem with std hitting wasmv1-none (it doesn't support it). It may have happened after recent merge of master. |
It's probably because of #5010. As I wrote above |
@StackOverflowExcept1on |
I think this is because polkadot-sdk/substrate/primitives/runtime/src/proving_trie/base16.rs Lines 195 to 200 in c139739
|
In my knowledge, all tests should be run with |
No. Just check for the available targets (I think we already have code for that) and then use the new target if available. If the new target is not available, print a warning to the build output. |
@jasl commit 4c3b0ea caused this problem, but I don't know why. I just accepted the changes that were in that log:
|
This reverts commit 4c3b0ea.
I think the change that CI gave you is incorrect. I just did a quick character length comparison, 5553 vs 5580, and 3825 vs 3799 |
I do a quick diff
the suggest change miss
The change add unexpected |
I believe your original one is good, but I don't know why CI give you the false suggest. @StackOverflowExcept1on Could you try don't change |
@bkchr Could you help to re-trigger CI? @StackOverflowExcept1on I think you still need to apply @bkchr request
Thank you for the work. I'm trying to migrate to Rust 2024 Edition when it's available. |
@jasl I'm still working on this request. It would be nice to have the ability to run CI without pinging the parity team...
|
This is a pain point. I guess it is about the cost. If possible, I would propose giving "verified" individual contributors an ability to trigger CI. |
These are some annoying security requirements. Which someone apparently turned on again.. |
@bkchr |
I should probably update prdoc as well: https://github.com/paritytech/polkadot-sdk/actions/runs/12687523719/job/35380940517
|
Description
Resolves #5777
Previously
wasm-builder
used hacks such as-Zbuild-std
(requiredrust-src
component) andRUSTC_BOOTSTRAP=1
to build WASM runtime without WASM features:sign-ext
,multivalue
andreference-types
, but since Rust 1.84 (will be stable on 9 January, 2025) the situation has improved as there is newwasm32v1-none
target that disables all "post-MVP" WASM features exceptmutable-globals
.Previously, your
rust-toolchain.toml
looked like this:It should now be updated to something like this:
To build the runtime:
Integration
If you are using Rust 1.84 and above, then install the
wasm32v1-none
target instead ofwasm32-unknown-unknown
as shown above. You can also remove the unnecessaryrust-src
component.Also note the slight differences in conditional compilation:
wasm32-unknown-unknown
:#[cfg(all(target_family = "wasm", target_os = "unknown"))]
wasm32v1-none
:#[cfg(all(target_family = "wasm", target_os = "none"))]
Avoid using
target_os = "unknown"
in#[cfg(...)]
or#[cfg_attr(...)]
and instead usetarget_family = "wasm"
ortarget_arch = "wasm32"
in the runtime code.Review Notes
Wasm builder requires the following prerequisites for building the WASM binary:
wasm32-unknown-unknown
targetrust-src
componentwasm32v1-none
target-Zbuild-std
andRUSTC_BOOTSTRAP=1
hacks andrust-src
component requirements!