You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ne...@apache.org on 2021/07/14 04:35:50 UTC

[arrow-rs] branch master updated: Fix build, Make the js package a feature that can be enabled for wasm, rather than always on (#545)

This is an automated email from the ASF dual-hosted git repository.

nevime pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new cdcf013  Fix build, Make the js package a feature that can be enabled for wasm, rather than always on (#545)
cdcf013 is described below

commit cdcf013f610c169d2a2efa493d586c76da521053
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Wed Jul 14 00:35:41 2021 -0400

    Fix build, Make the js package a feature that can be enabled for wasm, rather than always on (#545)
    
    * Fix build, add js feature
    
    * fix command
---
 .github/workflows/rust.yml | 2 +-
 arrow/Cargo.toml           | 3 ++-
 arrow/README.md            | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 76511bf..5579072 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -332,7 +332,7 @@ jobs:
           export CARGO_HOME="/github/home/.cargo"
           export CARGO_TARGET_DIR="/github/home/target"
           cd arrow
-          cargo build --target wasm32-unknown-unknown
+          cargo build --features=js --target wasm32-unknown-unknown
 
   # test builds with various feature flags
   default-build:
diff --git a/arrow/Cargo.toml b/arrow/Cargo.toml
index eef7dbc..ca343eb 100644
--- a/arrow/Cargo.toml
+++ b/arrow/Cargo.toml
@@ -43,7 +43,7 @@ indexmap = "1.6"
 rand = { version = "0.8", default-features = false }
 # getrandom is a dependency of rand, not (directly) of arrow
 # need to specify `js` feature to build on wasm
-getrandom = { version = "0.2", features = ["js"] }
+getrandom = { version = "0.2", optional = true }
 num = "0.4"
 csv_crate = { version = "1.1", optional = true, package="csv" }
 regex = "1.3"
@@ -64,6 +64,7 @@ csv = ["csv_crate"]
 ipc = ["flatbuffers"]
 simd = ["packed_simd"]
 prettyprint = ["prettytable-rs"]
+js = ["getrandom/js"]
 # The test utils feature enables code used in benchmarks and tests but
 # not the core arrow code itself
 test_utils = ["rand/std", "rand/std_rng"]
diff --git a/arrow/README.md b/arrow/README.md
index f9b7308..77e36ec 100644
--- a/arrow/README.md
+++ b/arrow/README.md
@@ -30,6 +30,7 @@ The arrow crate provides the following optional features:
 - `csv` (default) - support for reading and writing Arrow arrays to/from csv files
 - `ipc` (default) - support for the [arrow-flight]((https://crates.io/crates/arrow-flight) IPC and wire format
 - `prettyprint` - support for formatting record batches as textual columns
+- `js` - support for building arrow for WebAssembly / JavaScript
 - `simd` - (_Requires Nightly Rust_) alternate optimized
   implementations of some [compute](https://github.com/apache/arrow/tree/master/rust/arrow/src/compute)
   kernels using explicit SIMD processor intrinsics.