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 — Broken build of RustPython on wasip2 · Issue #6891 · RustPython/RustPython

Broken build of RustPython on wasip2 #6891

New issue
Copy link
New issue
Copy link
Closed
#6935
Closed
Broken build of RustPython on wasip2#6891
#6935
Copy link

Description

@sammyne
sammyne
opened on Jan 28, 2026
Issue body actions

Summary

Try to embed RustPython as a wasm component, but fail to build it on wasm32-wasip2 target.

Details

Environment

  • rust: 1.95.0-nightly (85eff7c80 2026-01-15)
  • RustPython: 2025-11-10-main-55
  • OS: Debian GNU/Linux 12

Reproduction

cargo build -r

Error goes as

error[E0425]: cannot find value `CLOCK_PROCESS_CPUTIME_ID` in crate `libc`
   --> /root/.cargo/git/checkouts/rustpython-63090cdce5e18442/9792001/vm/src/stdlib/time.rs:432:42
    |
432 |             if libc::clock_gettime(libc::CLOCK_PROCESS_CPUTIME_ID, time.as_mut_ptr()) == -1 {
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `rustpython-vm` (lib) due to 1 previous error

Related Code

lib.rs

#[cfg(target_arch = "wasm32")]
mod wasm;

#[cfg(target_arch = "wasm32")]
pub use wasm::*;

use anyhow::Result;
use rustpython_vm::{Interpreter, PyResult, VirtualMachine};

/// Run Python code and return the result
///
/// # Arguments
/// * `code` - The Python code to execute
///
/// # Returns
/// The result of the Python code execution as a string
///
/// # Errors
/// Returns an error if the Python code execution fails
pub fn run(code: &str) -> Result<String> {
    let interpreter = Interpreter::new_without_stdlib(None);
    let vm = &interpreter.vm;

    // Execute the Python code and get the result
    let result: PyResult = vm.run_code_string(code, "<embedded>".to_owned(), None);

    match result {
        Ok(value) => {
            // Convert the result to string representation
            let str_value = value.to_repr(vm);
            Ok(str_value.to_string())
        }
        Err(e) => Err(anyhow::anyhow!("Python execution error: {}", e.to_string(vm))),
    }
}

wasm.rs

mod bindgen {
    wit_bindgen::generate!();

    use crate::App;

    export!(App);
}

use bindgen::exports::sammyne::rust_python::api::Guest;

pub struct App;

impl Guest for App {
    fn run(code: String) -> Result<String, String> {
        crate::run(&code).map_err(|err| err.to_string())
    }
}

I made github repository https://github.com/sammyne/rust-python-broken-build-on-wasip2 to ease reproduction.

Activity

  1. youknowone
    closed this as completedin #6935on Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.