jorgecarleitao / arrow2

Transmute-free Rust library to work with the Arrow format
Apache License 2.0
1.06k stars 223 forks source link

Fixed ahash dependency for wasm #1407

Closed hzuo closed 1 year ago

hzuo commented 1 year ago

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 https://github.com/rust-lang/hashbrown/pull/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[bot] commented 1 year ago

Codecov Report

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

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

Additional details and impacted files ```diff @@ 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](https://codecov.io/gh/jorgecarleitao/arrow2/pull/1407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao) | Coverage Δ | | |---|---|---| | [src/bitmap/immutable.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/1407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2JpdG1hcC9pbW11dGFibGUucnM=) | `86.62% <0.00%> (-0.59%)` | :arrow_down: | | [src/io/ipc/read/file.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/1407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2lvL2lwYy9yZWFkL2ZpbGUucnM=) | `96.87% <0.00%> (-0.45%)` | :arrow_down: | | [src/offset.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/1407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL29mZnNldC5ycw==) | `85.76% <0.00%> (-0.35%)` | :arrow_down: | | [src/bitmap/utils/slice\_iterator.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/1407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2JpdG1hcC91dGlscy9zbGljZV9pdGVyYXRvci5ycw==) | `98.78% <0.00%> (+1.21%)` | :arrow_up: | | [src/array/binary/mod.rs](https://codecov.io/gh/jorgecarleitao/arrow2/pull/1407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao#diff-c3JjL2FycmF5L2JpbmFyeS9tb2QucnM=) | `94.08% <0.00%> (+1.47%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jorge+Leitao)

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