rust icon indicating copy to clipboard operation
rust copied to clipboard

Provide cabi_realloc on wasm32-wasip2 by default

Open alexcrichton opened this issue 1 year ago • 2 comments

This commit provides a component model intrinsic in the standard library by default on the wasm32-wasip2 target. This intrinsic is not required by the component model itself but is quite common to use, for example it's needed if a wasm module receives a string or a list.

The intention of this commit is to provide an overridable definition in the standard library through a weak definition of this function. That means that downstream crates can provide their own customized and more specific versions if they'd like, but the standard library's version should suffice for general-purpose use.

alexcrichton avatar Mar 12 '24 22:03 alexcrichton

r? @m-ou-se

rustbot has assigned @m-ou-se. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot avatar Mar 12 '24 22:03 rustbot

cc @sunfishcode and @rylev

I've tested this locally where the wit-bindgen test suite passes with the wasm32-wasip2 target from this PR

alexcrichton avatar Mar 12 '24 22:03 alexcrichton

:umbrella: The latest upstream changes (presumably #122423) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Mar 13 '24 10:03 bors

Is this stuck? Might it need a "bors r+" to get it into the queue or is Bors meant to pick up review approvals now?

jeffparsons avatar Mar 23 '24 01:03 jeffparsons

Ah while @rylev and @sunfishcode and I are all stakeholders on the wasm32-wasip2 target I'm not sure any of us have r+ permissions, so we'll need someone else to tell bors this is ready I think.

alexcrichton avatar Mar 24 '24 16:03 alexcrichton

Looks like we might need @m-ou-se to reroll the review.

rylev avatar Apr 02 '24 16:04 rylev

@bors r+

m-ou-se avatar Apr 02 '24 17:04 m-ou-se

:pushpin: Commit 5af8187325210e3006874b1457fa6ec69293f0e9 has been approved by m-ou-se

It is now in the queue for this repository.

bors avatar Apr 02 '24 17:04 bors