alamb opened a new pull request #545:
URL: https://github.com/apache/arrow-rs/pull/545


   # Which issue does this PR close?
   Closes https://github.com/apache/arrow-rs/issues/544
   
   # Rationale for this change
   
   We upgraded Arrow to the latest version of `rand` in 
https://github.com/apache/arrow-rs/pull/488 which has changed how they do js/ 
wasm support
   
   When I tried to use arrow/datafusion in IOx (which depends on both arrow and 
datafusion) I got this crazy error while trying to resolve dependencies:
   
   ```
   error: cyclic package dependency: package `ahash v0.7.4` depends on itself. 
Cycle:
   package `ahash v0.7.4`
       ... which is depended on by `hashbrown v0.11.2`
       ... which is depended on by `indexmap v1.7.0`
       ... which is depended on by `serde_json v1.0.64`
       ... which is depended on by `wasm-bindgen v0.2.74`
       ... which is depended on by `js-sys v0.3.51`
       ... which is depended on by `getrandom v0.2.3`
       ... which is depended on by `ahash v0.7.4`
   ```
   
   The issue appears to be that the `js` feature of rand somehow pulls in ahsah 
again. 
   
   # What changes are included in this PR?
   
   Make the `getrandom/js` (needed to build for wasm) dependency optional for 
arrow
   
   # Are there any user-facing changes?
   
   Yes, In order to build for WASM, the previous command
   
   ```shell
   cargo build --target wasm32-unknown-unknown
   ```
   
   Fails with an error such as
   ```
   cd /Users/alamb/Software/arrow-rs/arrow && cargo build --target 
wasm32-unknown-unknown
      Compiling getrandom v0.2.3
   error: the wasm32-unknown-unknown target is not supported by default, you 
may need to enable the "js" feature. For more information see: 
https://docs.rs/getrandom/#webassembly-support
      --> 
/Users/alamb/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.2.3/src/lib.rs:219:9
       |
   219 | /         compile_error!("the wasm32-unknown-unknown target is not 
supported by \
   220 | |                         default, you may need to enable the \"js\" 
feature. \
   221 | |                         For more information see: \
   222 | |                         
https://docs.rs/getrandom/#webassembly-support";);
       | 
|_________________________________________________________________________^
   
   ```
   
   Now, arrow users will have to explicitly specify the `js` feature:
   ```shell
   cargo build --features=js --target wasm32-unknown-unknown
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to