You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2021/07/12 16:06:47 UTC
[arrow-rs] branch master updated: Fix default arrow build (#533)
This is an automated email from the ASF dual-hosted git repository.
alamb 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 8d5a711 Fix default arrow build (#533)
8d5a711 is described below
commit 8d5a71155c2a0ae4fb26cfa88a4144afdb53a21a
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Mon Jul 12 12:04:22 2021 -0400
Fix default arrow build (#533)
* Remove workaround for rand
* Fix for default features
---
arrow-pyarrow-integration-testing/Cargo.toml | 2 --
arrow/Cargo.toml | 5 ++++-
arrow/src/util/bit_util.rs | 2 +-
arrow/src/util/mod.rs | 4 ++++
arrow/test/dependency/default-features/Cargo.toml | 3 ---
arrow/test/dependency/no-default-features/Cargo.toml | 3 ---
6 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/arrow-pyarrow-integration-testing/Cargo.toml b/arrow-pyarrow-integration-testing/Cargo.toml
index 55bbd77..34d2435 100644
--- a/arrow-pyarrow-integration-testing/Cargo.toml
+++ b/arrow-pyarrow-integration-testing/Cargo.toml
@@ -31,8 +31,6 @@ name = "arrow_pyarrow_integration_testing"
crate-type = ["cdylib"]
[dependencies]
-# ensure we get the std version of rand so arrow builds without default features
-rand = { version = "0.8" }
arrow = { path = "../arrow", version = "5.0.0-SNAPSHOT" }
pyo3 = { version = "0.12.1", features = ["extension-module"] }
diff --git a/arrow/Cargo.toml b/arrow/Cargo.toml
index 5a14f1f..eef7dbc 100644
--- a/arrow/Cargo.toml
+++ b/arrow/Cargo.toml
@@ -58,12 +58,15 @@ multiversion = "0.6.1"
bitflags = "1.2.1"
[features]
-default = ["csv", "ipc"]
+default = ["csv", "ipc", "test_utils"]
avx512 = []
csv = ["csv_crate"]
ipc = ["flatbuffers"]
simd = ["packed_simd"]
prettyprint = ["prettytable-rs"]
+# 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"]
# this is only intended to be used in single-threaded programs: it verifies that
# all allocated memory is being released (no memory leaks).
# See README for details
diff --git a/arrow/src/util/bit_util.rs b/arrow/src/util/bit_util.rs
index d046f78..f643d59 100644
--- a/arrow/src/util/bit_util.rs
+++ b/arrow/src/util/bit_util.rs
@@ -125,7 +125,7 @@ where
simd_result.write_to_slice_unaligned_unchecked(result);
}
-#[cfg(test)]
+#[cfg(all(test, feature = "test_utils"))]
mod tests {
use std::collections::HashSet;
diff --git a/arrow/src/util/mod.rs b/arrow/src/util/mod.rs
index b2fd4f7..1802d3e 100644
--- a/arrow/src/util/mod.rs
+++ b/arrow/src/util/mod.rs
@@ -15,16 +15,20 @@
// specific language governing permissions and limitations
// under the License.
+#[cfg(feature = "test_utils")]
pub mod bench_util;
pub mod bit_chunk_iterator;
pub mod bit_util;
+#[cfg(feature = "test_utils")]
pub mod data_gen;
pub mod display;
+#[cfg(feature = "test_utils")]
pub mod integration_util;
#[cfg(feature = "prettyprint")]
pub mod pretty;
pub(crate) mod serialization;
pub mod string_writer;
+#[cfg(feature = "test_utils")]
pub mod test_util;
mod trusted_len;
diff --git a/arrow/test/dependency/default-features/Cargo.toml b/arrow/test/dependency/default-features/Cargo.toml
index 01eb962..0cc4020 100644
--- a/arrow/test/dependency/default-features/Cargo.toml
+++ b/arrow/test/dependency/default-features/Cargo.toml
@@ -26,7 +26,4 @@ edition = "2018"
[dependencies]
arrow = { path = "../../../../arrow", version = "5.0.0-SNAPSHOT" }
-# Workaround for https://github.com/apache/arrow-rs/issues/529
-rand = { version = "0.8" }
-
[workspace]
diff --git a/arrow/test/dependency/no-default-features/Cargo.toml b/arrow/test/dependency/no-default-features/Cargo.toml
index 7782497..6e46543 100644
--- a/arrow/test/dependency/no-default-features/Cargo.toml
+++ b/arrow/test/dependency/no-default-features/Cargo.toml
@@ -26,7 +26,4 @@ edition = "2018"
[dependencies]
arrow = { path = "../../../../arrow", version = "5.0.0-SNAPSHOT", default-features = false }
-# Workaround for https://github.com/apache/arrow-rs/issues/529
-rand = { version = "0.8" }
-
[workspace]