Skip to content

Conversation

@seanses
Copy link
Collaborator

@seanses seanses commented Apr 25, 2025

  1. Upgrade rand so we can use the new "wasm_js" feature for the underlying getrandom dependency.
  2. Change deprecated rand gen, gen_range functions.
  3. Restrict tokio features.
  4. Change tempdir to tempfile because tempdir uses a very old non-wasm compat version of rand, and is merged into the latter and archived.
  5. Clean out some unnecessary dependencies.
  6. Moved a file from parutils to utils.

@seanses seanses marked this pull request as ready for review April 25, 2025 17:15
@seanses seanses requested a review from assafvayner April 25, 2025 17:27
[dependencies]
tokio = { version = "1.36", features = ["full"] }
tokio = { version = "1.44", features = ["sync"] }
async-scoped = { version = "0.7", features = ["use-tokio"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think async-scoped with use-tokio feature is likely still going to cause issues?

Copy link
Collaborator Author

@seanses seanses Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to make it compilation-compat. We are not going to use in JS/web workers anyway.

blake3 = "1.5.4"

[target.'cfg(target_family = "wasm")'.dependencies]
uuid = { version = "1", features = ["v4", "js"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you include the "js" feature for non-wasm build is that an error, I think the exports will just get ignored?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about that

utils = { path = "../utils" }
tempdir = "0.3.7"
tokio = { version = "1.36", features = ["full"] }
tempfile = "3.19.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this wasm compat??

Copy link
Collaborator Author

@seanses seanses Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is compilation-compat but won't work in web workers so we won't use this. But tempdir is very old and uses a very old version of rand, which uses a very old version of getrandom, which doesn't support the new wasm_js feature.

@seanses seanses changed the title Make dedup critical crates compat with wasm Make dedup critical crates compilation-compat with wasm Apr 25, 2025
@seanses seanses merged commit 0474cd7 into main Apr 29, 2025
4 checks passed
@seanses seanses deleted the di/wasm-compat branch April 29, 2025 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants