GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix wasip2 build by youknowone · Pull Request #6935 · RustPython/RustPython

Conversation

@youknowone

@youknowone youknowone commented Feb 1, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fix #6891
Fix #5704

Summary by CodeRabbit

  • Chores
    • Updated CI workflow to include compilation verification for the wasm32-wasip2 target.
    • Removed conditional feature gating from crate-level attributes.
    • Refactored platform-specific FFI implementations and path handling for WASI environments.
    • Updated standard library module exports for WASI platform compatibility.

✏️ Tip: You can customize this high-level summary in your review settings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@coderabbitai

coderabbitai Bot commented Feb 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The pull request migrates RustPython away from the unstable wasip2 feature flag by providing custom stable implementations of wasip2-specific APIs. It removes feature gates, adds a new WASI p2-specific ffi module with OsStrExt and OsStringExt traits, updates API imports and usage, and extends CI to verify compilation for the wasm32-wasip2 target.

Changes

Cohort / File(s) Summary
Feature gate removal
src/lib.rs, crates/stdlib/src/lib.rs, crates/common/src/lib.rs
Removes crate-level #![cfg_attr(...wasip2)] and #![feature(wasip2)] attributes, eliminating reliance on the unstable wasip2 feature flag.
WASI p2 stable ffi implementation
crates/common/src/os.rs
Introduces a new pub mod ffi under cfg(all(target_os = "wasi", target_env = "p2")) with custom trait definitions: OsStrExt (as_bytes, from_bytes) and OsStringExt (from_vec, into_vec). Includes trait implementations for std::ffi types and a sealed module, leveraging UTF-8 guarantees for WASI p2 compatibility.
API import and usage updates
crates/stdlib/src/select.rs, src/settings.rs
Updates RawFd re-export path from std::os::wasi::io::RawFd to std::os::fd::RawFd. Changes split_paths implementation to use as_encoded_bytes() and from_encoded_bytes_unchecked() instead of unstable OsStrExt trait methods.
CI enhancement
.github/workflows/ci.yaml
Adds rust-toolchain installation and cargo check step for the wasm32-wasip2 target to verify compilation on WASI p2 builds.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #5985: Converts string-based APIs to byte-oriented operations (as_bytes, as_encoded_bytes), employing similar patterns for handling encoded bytes across the codebase.

Poem

🐰 No longer trapped by unstable gates so tight,
WASI p2 shines with implementations bright,
Custom traits bloom, where bytes dance free,
Stable foundations for all to see! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title "Fix wasip2 build" directly corresponds to the main objective of addressing wasm32-wasip2 compilation failures referenced in issues #6891 and #5704.
Linked Issues check ✅ Passed The PR addresses both linked issues by providing stable WASI p2 FFI implementations, adjusting platform imports, removing conditional wasip2 features, and updating the split_paths implementation to work with wasip2 without relying on unstable features.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing wasip2 target compilation: CI workflow updates, WASI p2 FFI module implementations, feature flag removal, and import path adjustments align with the stated objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands and usage tips.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

Code has been automatically formatted

The code in this PR has been formatted using:

  • cargo fmt --all
    Please pull the latest changes before pushing again:
git pull origin wasip2
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@youknowone
Fix wasip2 build
01c758e
@youknowone
youknowone force-pushed the wasip2 branch from 887fe78 to 01c758e Compare February 1, 2026 14:43
@github-actions
Auto-format: cargo fmt --all
7e76971
@youknowone
youknowone marked this pull request as ready for review February 1, 2026 16:14
@youknowone
youknowone merged commit 5e732c5 into RustPython:main Feb 1, 2026
13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@youknowone
youknowone deleted the wasip2 branch February 1, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Broken build of RustPython on wasip2 Can not build RustPython to wasm32-wasip2

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@youknowone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.