Skip to content

WASM build fails with "lazy" "streaming" features #18589

Open
@d3bgger

Description

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

Cargo.toml

[package]
name = "rust-polars-wasm"
version = "0.1.0"
authors = [""]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
wasm-bindgen = "0.2.84"

[dependencies.polars]
version = "*"
default-features = false
features = [
  "lazy",
  "streaming",
  "csv",
]

[profile.release]
opt-level = "s"

src/lib.rs

use polars::prelude::*;
use wasm_bindgen::prelude::*;


#[wasm_bindgen(start)]
fn main() -> Result<(), JsValue> {
    Ok(())
}

Log output

warning: lz4-sys@1.10.0: liblz4/lib/lz4.c:222:11: fatal error: 'stdlib.h' file not found
warning: lz4-sys@1.10.0:   222 | # include <stdlib.h>   /* malloc, calloc, free */

liblz4/lib/lz4frame.c:88:10: fatal error: 'string.h' file not found
  cargo:warning=   88 | #include <string.h>   /* memset, memcpy, memmove */

In file included from liblz4/lib/lz4hc.c:66:
  cargo:warning=liblz4/lib/lz4.c:222:11: fatal error: 'stdlib.h' file not found
  cargo:warning=  222 | # include <stdlib.h>   /* malloc, calloc, free */

liblz4/lib/xxhash.c:107:10: fatal error: 'stdlib.h' file not found
  cargo:warning=  107 | #include <stdlib.h>

Issue description

When adding "lazy" and "streaming" features and building with wasm-pack build --target web the build fails.

If these two features are not both added, but use one or the other, the build is successful.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageAwaiting prioritization by a maintainerrustRelated to Rust Polars

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions