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

polars can not be built for wasm from v0.29 #8783

Closed
2 tasks done
Dirreke opened this issue May 10, 2023 · 7 comments
Closed
2 tasks done

polars can not be built for wasm from v0.29 #8783

Dirreke opened this issue May 10, 2023 · 7 comments
Labels
bug Something isn't working rust Related to Rust Polars

Comments

@Dirreke
Copy link

Dirreke commented May 10, 2023

Polars version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of Polars.

Issue description

V0.29 can not be built for wasm.
It has two problem

  1. POOL has no method current_thread_index() for wasm, which is introduced in perf(rust, python): improve nested grouptuples related code #8618 at hashing.rs

  2. crate home which used in polars-io to replace crate dir can not be built for wasm. Move to the smaller, cargo-team maintained home crate #8449

Reproducible example

  1. POOL has no method current_thread_index() for wasm, which is introduced in # 8618 at hashing.rs
error[E0599]: no method named `current_thread_index` found for struct `once_cell::sync::Lazy<Pool>` in the current scope
  --> ...\polars-core-0.29.0\src\frame\groupby\hashing.rs:30:13
   |
30 |     if POOL.current_thread_index().is_none() {
   |             ^^^^^^^^^^^^^^^^^^^^ method not found in `Lazy<Pool>`

for wasm, it has a similar method current_num_threads() (I'm not sure if they have the same functionality ) at wasm.rs. Perhaps it will help

  1. crate home which used in polars-io to replace crate dir can not be built for wasm. Move to the smaller, cargo-team maintained home crate #8449
error[E0425]: cannot find function `home_dir_inner` in the crate root
  --> ...\home-0.5.5\src\env.rs:33:16
   |
33 |         crate::home_dir_inner()
   |                ^^^^^^^^^^^^^^ not found in the crate root

Installed versions

v0.29
@Dirreke Dirreke added bug Something isn't working rust Related to Rust Polars labels May 10, 2023
@Dirreke
Copy link
Author

Dirreke commented Jun 9, 2023

0.30 can compile pass

@Dirreke Dirreke closed this as completed Jun 9, 2023
@lorepozo
Copy link
Contributor

lorepozo commented Jun 13, 2023

@Dirreke this is still broken with the same compile errors reported in the original post.

repro:

$ cargo new bug8783
$ cd bug8783
$ echo 'polars = { version = "0.30", default-features = false }' >> Cargo.toml
$ cargo build --target wasm32-unknown-unknown

Personally I also have the following features enabled and working fine in 0.28: fmt_no_tty, rows, lazy, concat_str, strings.

Regressions like this are preventable with better coverage, we should be able to build the wasm target from the workflow in .github/workflows/test-rust.yml

May I suggest keeping this issue open until CI tests have been added for the WASM target and are passing?

@Dirreke Dirreke reopened this Jun 14, 2023
@Dirreke
Copy link
Author

Dirreke commented Jun 14, 2023

you are right, I did the wrong test. Actually, it still broke

@Dirreke Dirreke changed the title V0.29 can not be built for wasm polars can not be built for wasm from v0.29 Aug 5, 2023
@Dirreke Dirreke closed this as completed Aug 16, 2023
@mingsterism
Copy link

hi guys. want to ask has this issue been solved? because we have been trying it out and it still causes bugs. just wanted to know if latest polars can use WASM

@Dirreke
Copy link
Author

Dirreke commented Sep 21, 2023

yeah,it has been solved in 0.33

@kAif-gh
Copy link

kAif-gh commented Oct 19, 2023

i think it's still broken, i have just created an issue in wasm_bindgen issues that describe an encountered problem.https://github.com/rustwasm/wasm-bindgen/issues/3661

@lorepozo
Copy link
Contributor

@kAif-gh you may have disabled features that you were relying on. You can enable the features you need, e.g. rows, explicitly rather than via the default features. See also my comment on another issue. The list of available features is on docs.rs here and defined in crates/polars/Cargo.toml

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

No branches or pull requests

4 participants