Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Fixed ahash dependency for wasm #1407

Merged
merged 2 commits into from
Feb 15, 2023

Conversation

hzuo
Copy link
Contributor

@hzuo hzuo commented Feb 14, 2023

The WASM special-casing for ahash introduced by #1297 is problematic for a couple of reasons:

  1. The compile-time-rng feature is useless without first disabling runtime-rng (which is enabled as a default feature). When both are enabled, runtime-rng takes precendence but we end up bringing in extraneous dependencies for compile-time-rng. It's also misleading to see "compile-time-rng" when in reality it's still runtime-rng.
  2. If we really wanted to use compile-time-rng (which we could by setting default-features = false), there's no reason to include getrandom at all since there's no need to get randomness at runtime. But IMO it's a bad default since it leads to non-deterministic / uncacheable builds - see Disable use of const_random! by default rust-lang/hashbrown#155.
  3. This broke my use-case since using target_arch also made this config apply to wasm32-unknown-emscripten builds too, even though no special-casing is required for Emscripten. See getrandom's docs on WASM support.

@codecov
Copy link

codecov bot commented Feb 15, 2023

Codecov Report

Base: 83.61% // Head: 83.61% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (544041e) compared to base (ca7f36f).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1407   +/-   ##
=======================================
  Coverage   83.61%   83.61%           
=======================================
  Files         373      373           
  Lines       40288    40288           
=======================================
+ Hits        33685    33686    +1     
+ Misses       6603     6602    -1     
Impacted Files Coverage Δ
src/bitmap/immutable.rs 86.62% <0.00%> (-0.59%) ⬇️
src/io/ipc/read/file.rs 96.87% <0.00%> (-0.45%) ⬇️
src/offset.rs 85.76% <0.00%> (-0.35%) ⬇️
src/bitmap/utils/slice_iterator.rs 98.78% <0.00%> (+1.21%) ⬆️
src/array/binary/mod.rs 94.08% <0.00%> (+1.47%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jorgecarleitao jorgecarleitao changed the title Fix ahash dependency for wasm Fixed ahash dependency for wasm Feb 15, 2023
@jorgecarleitao jorgecarleitao added the bug Something isn't working label Feb 15, 2023
@jorgecarleitao jorgecarleitao merged commit b201655 into jorgecarleitao:main Feb 15, 2023
jgmartin pushed a commit to jgmartin/arrow2 that referenced this pull request Feb 22, 2023
ritchie46 pushed a commit to ritchie46/arrow2 that referenced this pull request Mar 29, 2023
ritchie46 pushed a commit to ritchie46/arrow2 that referenced this pull request Apr 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants