Skip to content

wasm32-unknown-emscripten build causes compilation errors #1093

@evroon

Description

@evroon

Cool library, thanks!

When trying to build jsonschema-py for WASM via Emcripten, I get these errors:

error[E0599]: no method named `with_http_options` found for struct `ValidationOptions<R>` in the current scope
   --> crates/jsonschema-py/src/lib.rs:977:27
    |
977 |         options = options.with_http_options(&http_opts).map_err(|e| {
    |                           ^^^^^^^^^^^^^^^^^
    |
help: there is a method `with_pattern_options` with a similar name
    |
977 -         options = options.with_http_options(&http_opts).map_err(|e| {
977 +         options = options.with_pattern_options(&http_opts).map_err(|e| {
    |

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

using these commands:

rustup target add wasm32-unknown-emscripten
cargo build --target wasm32-unknown-emscripten

Is it expected that make_options calls with_http_options, where make_options can be called from WASM but with_http_options can't?

options = options.with_http_options(&http_opts).map_err(|e| {
exceptions::PyRuntimeError::new_err(format!("Failed to configure HTTP options: {e}"))
})?;

For context, I am trying to open a PR to add jsonschema-rs to pyodide: pyodide/pyodide-recipes#559

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions