Skip to content

Refactor how guest exported tasks work#1268

Merged
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:refactor-guest-exports
Apr 10, 2025
Merged

Refactor how guest exported tasks work#1268
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:refactor-guest-exports

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit refactors some of the code generation and ABI instructions used for exported tasks. Instead of a future + closure they're represented now only as a single future which internally handles the invocation of task.return. No major functional change here, just some refactoring.

This commit refactors some of the code generation and ABI instructions
used for exported tasks. Instead of a future + closure they're
represented now only as a single future which internally handles the
invocation of `task.return`. No major functional change here, just some
refactoring.
@alexcrichton alexcrichton requested a review from dicej April 9, 2025 21:57
Copy link
Copy Markdown
Collaborator

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, assuming the wasip3-prototyping tests pass.

Comment thread crates/rust/src/interface.rs Outdated
if needs_cleanup_list {
let vec = self.path_to_vec();
uwriteln!(self.src, "let mut cleanup_list = {vec}::new();");
uwriteln!(self.src, "let mut cleanup_list = Vec::new();");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we not need to use self.path_to_vec() here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this is my mistake, we do still need that and this just got lost in some refactorings I made along the way and didn't double-check the diff at the end.

@alexcrichton alexcrichton enabled auto-merge April 10, 2025 15:47
@alexcrichton alexcrichton added this pull request to the merge queue Apr 10, 2025
Merged via the queue into bytecodealliance:main with commit 5a23303 Apr 10, 2025
18 checks passed
@alexcrichton alexcrichton deleted the refactor-guest-exports branch April 10, 2025 16:38
alexcrichton added a commit to alexcrichton/wasip3-prototyping that referenced this pull request Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants