Skip to content

Commit 8d5a711

Browse files
authored
Fix default arrow build (apache#533)
* Remove workaround for rand * Fix for default features
1 parent 787e826 commit 8d5a711

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

arrow-pyarrow-integration-testing/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ name = "arrow_pyarrow_integration_testing"
3131
crate-type = ["cdylib"]
3232

3333
[dependencies]
34-
# ensure we get the std version of rand so arrow builds without default features
35-
rand = { version = "0.8" }
3634
arrow = { path = "../arrow", version = "5.0.0-SNAPSHOT" }
3735
pyo3 = { version = "0.12.1", features = ["extension-module"] }
3836

arrow/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ multiversion = "0.6.1"
5858
bitflags = "1.2.1"
5959

6060
[features]
61-
default = ["csv", "ipc"]
61+
default = ["csv", "ipc", "test_utils"]
6262
avx512 = []
6363
csv = ["csv_crate"]
6464
ipc = ["flatbuffers"]
6565
simd = ["packed_simd"]
6666
prettyprint = ["prettytable-rs"]
67+
# The test utils feature enables code used in benchmarks and tests but
68+
# not the core arrow code itself
69+
test_utils = ["rand/std", "rand/std_rng"]
6770
# this is only intended to be used in single-threaded programs: it verifies that
6871
# all allocated memory is being released (no memory leaks).
6972
# See README for details

arrow/src/util/bit_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ where
125125
simd_result.write_to_slice_unaligned_unchecked(result);
126126
}
127127

128-
#[cfg(test)]
128+
#[cfg(all(test, feature = "test_utils"))]
129129
mod tests {
130130
use std::collections::HashSet;
131131

arrow/src/util/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
#[cfg(feature = "test_utils")]
1819
pub mod bench_util;
1920
pub mod bit_chunk_iterator;
2021
pub mod bit_util;
22+
#[cfg(feature = "test_utils")]
2123
pub mod data_gen;
2224
pub mod display;
25+
#[cfg(feature = "test_utils")]
2326
pub mod integration_util;
2427
#[cfg(feature = "prettyprint")]
2528
pub mod pretty;
2629
pub(crate) mod serialization;
2730
pub mod string_writer;
31+
#[cfg(feature = "test_utils")]
2832
pub mod test_util;
2933

3034
mod trusted_len;

arrow/test/dependency/default-features/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,4 @@ edition = "2018"
2626
[dependencies]
2727
arrow = { path = "../../../../arrow", version = "5.0.0-SNAPSHOT" }
2828

29-
# Workaround for https://github.com/apache/arrow-rs/issues/529
30-
rand = { version = "0.8" }
31-
3229
[workspace]

arrow/test/dependency/no-default-features/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,4 @@ edition = "2018"
2626
[dependencies]
2727
arrow = { path = "../../../../arrow", version = "5.0.0-SNAPSHOT", default-features = false }
2828

29-
# Workaround for https://github.com/apache/arrow-rs/issues/529
30-
rand = { version = "0.8" }
31-
3229
[workspace]

0 commit comments

Comments
 (0)