Skip to content

Commit cdcf013

Browse files
authored
Fix build, Make the js package a feature that can be enabled for wasm, rather than always on (apache#545)
* Fix build, add js feature * fix command
1 parent 6698eed commit cdcf013

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ jobs:
332332
export CARGO_HOME="/github/home/.cargo"
333333
export CARGO_TARGET_DIR="/github/home/target"
334334
cd arrow
335-
cargo build --target wasm32-unknown-unknown
335+
cargo build --features=js --target wasm32-unknown-unknown
336336
337337
# test builds with various feature flags
338338
default-build:

arrow/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ indexmap = "1.6"
4343
rand = { version = "0.8", default-features = false }
4444
# getrandom is a dependency of rand, not (directly) of arrow
4545
# need to specify `js` feature to build on wasm
46-
getrandom = { version = "0.2", features = ["js"] }
46+
getrandom = { version = "0.2", optional = true }
4747
num = "0.4"
4848
csv_crate = { version = "1.1", optional = true, package="csv" }
4949
regex = "1.3"
@@ -64,6 +64,7 @@ csv = ["csv_crate"]
6464
ipc = ["flatbuffers"]
6565
simd = ["packed_simd"]
6666
prettyprint = ["prettytable-rs"]
67+
js = ["getrandom/js"]
6768
# The test utils feature enables code used in benchmarks and tests but
6869
# not the core arrow code itself
6970
test_utils = ["rand/std", "rand/std_rng"]

arrow/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The arrow crate provides the following optional features:
3030
- `csv` (default) - support for reading and writing Arrow arrays to/from csv files
3131
- `ipc` (default) - support for the [arrow-flight]((https://crates.io/crates/arrow-flight) IPC and wire format
3232
- `prettyprint` - support for formatting record batches as textual columns
33+
- `js` - support for building arrow for WebAssembly / JavaScript
3334
- `simd` - (_Requires Nightly Rust_) alternate optimized
3435
implementations of some [compute](https://github.com/apache/arrow/tree/master/rust/arrow/src/compute)
3536
kernels using explicit SIMD processor intrinsics.

0 commit comments

Comments
 (0)