Skip to content

Commit

Permalink
refactor poll_until to only ever call wasm inside a fiber (#13)
Browse files Browse the repository at this point in the history
* refactor `poll_until` to only ever call wasm inside a fiber

With `wasmtime`'s `async` support enabled, all guest export calls need to happen
in a fiber because the guest may call back to the host, which may try to suspend
the fiber and return control to the top-level async executor.  In fact, even if
the guest doesn't call back to the host, epoch interruption might be enabled, in
which case the code might be instrumented with yield calls that do the same
thing.

In the process of this refactor, I discovered a couple of other issues (e.g. not
removing tasks from the "yielding" set when disposing of them) and fixed those
as well.

Fixes #9.

Signed-off-by: Joel Dice <[email protected]>

* disable `cargo-vet` tasks in `wasip3-prototyping.yml`

We'll address `cargo-vet` auditing when upstreaming these changes, but it's just
a distraction while we're working in this repo.

Signed-off-by: Joel Dice <[email protected]>

---------

Signed-off-by: Joel Dice <[email protected]>
  • Loading branch information
dicej authored Feb 18, 2025
1 parent 798b8c9 commit ab30f13
Show file tree
Hide file tree
Showing 5 changed files with 254 additions and 394 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/wasip3-prototyping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,54 +72,6 @@ jobs:
- uses: ./.github/actions/cancel-on-failure
if: failure()

cargo_vet:
name: Cargo vet
needs: determine
if: needs.determine.outputs.audit
runs-on: ubuntu-latest
outputs:
outcome: ${{ steps.vet.outcome }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
- uses: ./.github/actions/install-cargo-vet
- id: vet
run: cargo vet --locked
continue-on-error: ${{ github.event_name == 'pull_request' }}

# Double-check that if versions are bumped that `cargo vet` still works.
# This is intended to weed out mistakes such as #9115 from happening again.
- run: rustc scripts/publish.rs && ./publish bump-patch && cargo vet
name: Ensure `cargo vet` works if versions are bumped

# common logic to cancel the entire run if this job fails
- uses: ./.github/actions/cancel-on-failure
if: failure()

cargo_vet_failure_for_prs:
name: Cargo vet failed on a Pull Request
needs:
- determine
- cargo_vet
if: |
needs.determine.outputs.audit
&& github.event_name == 'pull_request'
&& needs.cargo_vet.outputs.outcome == 'failure'
runs-on: ubuntu-latest
steps:
# NB: this message ideally would link back to the previous step, but I'm not
# sure how to easily do that.
- run: |
echo 'failed to run "cargo vet", see previous `Cargo vet` step'
echo 'exiting with a nonzero status now to alert PR authors'
echo 'note, though, that this PR can still enter the merge queue'
echo ''
echo 'See https://docs.wasmtime.dev/contributing-coding-guidelines.html#cargo-vet-for-contributors'
echo 'for more information about the vetting process for Wasmtime'
exit 1
determine:
name: Determine CI jobs to run
runs-on: ubuntu-latest
Expand Down Expand Up @@ -698,7 +650,6 @@ jobs:
- test
- rustfmt
- cargo_deny
- cargo_vet
- doc
- micro_checks
- fiber_tests
Expand Down
Loading

0 comments on commit ab30f13

Please sign in to comment.