Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
d3bgger opened this issue Sep 6, 2024 · 1 comment
Open
2 tasks done

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

d3bgger opened this issue Sep 6, 2024 · 1 comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer rust Related to Rust Polars

Comments

@d3bgger
Copy link

d3bgger commented Sep 6, 2024

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: [email protected]: liblz4/lib/lz4.c:222:11: fatal error: 'stdlib.h' file not found
warning: [email protected]:   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.

@d3bgger d3bgger added bug Something isn't working needs triage Awaiting prioritization by a maintainer rust Related to Rust Polars labels Sep 6, 2024
@d3bgger
Copy link
Author

d3bgger commented Sep 6, 2024

As I understand, the root cause is that C is not supported (yet) for wasm32-unknown-unknown rustwasm/team#291

But can I opt out of needing lz4 at all, since I don't use compression?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer rust Related to Rust Polars
Projects
None yet
Development

No branches or pull requests

1 participant