You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ag...@apache.org on 2018/11/28 01:03:48 UTC
[arrow] branch master updated: ARROW-3868: [Rust] Switch to nightly
Rust for required build, stable is now allowed to fail
This is an automated email from the ASF dual-hosted git repository.
agrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 39d1e86 ARROW-3868: [Rust] Switch to nightly Rust for required build, stable is now allowed to fail
39d1e86 is described below
commit 39d1e86345836a98832604326ef1196e18b88cc4
Author: Andy Grove <an...@gmail.com>
AuthorDate: Tue Nov 27 18:03:35 2018 -0700
ARROW-3868: [Rust] Switch to nightly Rust for required build, stable is now allowed to fail
Author: Andy Grove <an...@gmail.com>
Closes #3034 from andygrove/ARROW-3868 and squashes the following commits:
1690438 <Andy Grove> fix bash if format
9cc083e <Andy Grove> fail build if examples fail
a602c6e <Andy Grove> fix bug
b3be151 <Andy Grove> Address PR feedback
ef0f068 <Andy Grove> use nightly Rust in release process
4843b54 <Andy Grove> Use separate scripts for nightly vs stable Rust
a55d35b <Andy Grove> update windows CI
8a6f938 <Andy Grove> cargo fmt using rust nightly
df6e2f6 <Andy Grove> Switch to nightly Rust for required build, stable is now allowed to fail
---
.travis.yml | 4 ++--
ci/rust-build-main.bat | 22 +++++++++++-----------
ci/travis_script_rust.sh | 10 +++++++---
dev/release/verify-release-candidate.sh | 10 +++++++---
rust/benches/builder.rs | 6 ++++--
rust/src/buffer.rs | 3 ++-
rust/src/csv/reader.rs | 3 ++-
rust/src/tensor.rs | 6 ++++--
8 files changed, 39 insertions(+), 25 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 457e656..b877e20 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -280,8 +280,8 @@ matrix:
- if [ $ARROW_CI_RUST_AFFECTED != "1" ]; then exit; fi
- $TRAVIS_BUILD_DIR/ci/travis_install_cargo.sh
script:
- - RUSTUP_TOOLCHAIN=stable $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh
- - RUSTUP_TOOLCHAIN=nightly $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh || true
+ - RUSTUP_TOOLCHAIN=stable $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh || true
+ - RUSTUP_TOOLCHAIN=nightly $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh
after_success:
- pushd ${TRAVIS_BUILD_DIR}/rust
# Run coverage for codecov.io
diff --git a/ci/rust-build-main.bat b/ci/rust-build-main.bat
index 463fdc0..c8a51fe 100644
--- a/ci/rust-build-main.bat
+++ b/ci/rust-build-main.bat
@@ -25,15 +25,15 @@ pushd rust
rustup default stable
rustup show
-cargo build --target %TARGET% || exit /B
-cargo build --target %TARGET% --release || exit /B
+cargo build --target %TARGET%
+cargo build --target %TARGET% --release
@echo Test (debug)
@echo ------------
-cargo test --target %TARGET% || exit /B
+cargo test --target %TARGET%
@echo
@echo Test (release)
@echo --------------
-cargo test --target %TARGET% --release || exit /B
+cargo test --target %TARGET% --release
@echo ===================================
@echo Build with nightly toolchain
@@ -41,20 +41,20 @@ cargo test --target %TARGET% --release || exit /B
rustup default nightly
rustup show
-cargo build --target %TARGET%
-cargo build --target %TARGET% --release
+cargo build --target %TARGET% || exit /B
+cargo build --target %TARGET% --release || exit /B
@echo Test (debug)
@echo ------------
-cargo test --target %TARGET%
+cargo test --target %TARGET% || exit /B
@echo
@echo Test (release)
@echo --------------
-cargo test --target %TARGET% --release
+cargo test --target %TARGET% --release || exit /B
@echo
@echo Run example (release)
@echo ---------------------
-cargo run --example builders --target %TARGET% --release
-cargo run --example dynamic_types --target %TARGET% --release
-cargo run --example read_csv --target %TARGET% --release
+cargo run --example builders --target %TARGET% --release || exit /B
+cargo run --example dynamic_types --target %TARGET% --release || exit /B
+cargo run --example read_csv --target %TARGET% --release || exit /B
popd
diff --git a/ci/travis_script_rust.sh b/ci/travis_script_rust.sh
index 1058ec2..02a32cd 100755
--- a/ci/travis_script_rust.sh
+++ b/ci/travis_script_rust.sh
@@ -26,9 +26,13 @@ pushd $RUST_DIR
# show activated toolchain
rustup show
-# raises on any formatting errors
-rustup component add rustfmt-preview
-cargo fmt --all -- --check
+# check code formatting only for Rust nightly
+if [ $RUSTUP_TOOLCHAIN == "nightly" ]
+then
+ # raises on any formatting errors
+ rustup component add rustfmt-preview
+ cargo fmt --all -- --check
+fi
# raises on any warnings
cargo rustc -- -D warnings
diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.sh
index 378dca3..5b66663 100755
--- a/dev/release/verify-release-candidate.sh
+++ b/dev/release/verify-release-candidate.sh
@@ -268,10 +268,14 @@ test_rust() {
# build and test rust
pushd rust
- # raises on any formatting errors (disabled, because RC1 has a couple)
- # rustup component add rustfmt-preview
- # cargo fmt --all -- --check
+ # we are targeting Rust nightly for releases
+ rustup default nightly
+
+ # raises on any formatting errors
+ rustup component add rustfmt-preview
+ cargo fmt --all -- --check
# raises on any warnings
+
cargo rustc -- -D warnings
cargo build
diff --git a/rust/benches/builder.rs b/rust/benches/builder.rs
index 4d09d94..5edc344 100644
--- a/rust/benches/builder.rs
+++ b/rust/benches/builder.rs
@@ -41,7 +41,8 @@ fn bench_primitive(c: &mut Criterion) {
}
black_box(builder.finish());
})
- }).throughput(Throughput::Bytes(
+ })
+ .throughput(Throughput::Bytes(
(data.len() * NUM_BATCHES * size_of::<i64>()) as u32,
)),
);
@@ -63,7 +64,8 @@ fn bench_bool(c: &mut Criterion) {
}
black_box(builder.finish());
})
- }).throughput(Throughput::Bytes(
+ })
+ .throughput(Throughput::Bytes(
(data_len * NUM_BATCHES * size_of::<bool>()) as u32,
)),
);
diff --git a/rust/src/buffer.rs b/rust/src/buffer.rs
index cec38db..67d2896 100644
--- a/rust/src/buffer.rs
+++ b/rust/src/buffer.rs
@@ -523,7 +523,8 @@ mod tests {
let buffer_copy = thread::spawn(move || {
// access buffer in another thread.
buffer.clone()
- }).join();
+ })
+ .join();
assert!(buffer_copy.is_ok());
assert_eq!(buffer2, buffer_copy.ok().unwrap());
diff --git a/rust/src/csv/reader.rs b/rust/src/csv/reader.rs
index 0a8a6e4..9f7d783 100644
--- a/rust/src/csv/reader.rs
+++ b/rust/src/csv/reader.rs
@@ -174,7 +174,8 @@ impl Reader {
other
))),
}
- }).collect();
+ })
+ .collect();
match arrays {
Ok(arr) => Some(Ok(RecordBatch::new(self.schema.clone(), arr))),
diff --git a/rust/src/tensor.rs b/rust/src/tensor.rs
index 933946f..a9f933f 100644
--- a/rust/src/tensor.rs
+++ b/rust/src/tensor.rs
@@ -96,7 +96,8 @@ macro_rules! impl_tensor {
.iter()
.map(|i| {
assert_eq!(s.len(), i.len(), "shape and stride dimensions differ")
- }).next();
+ })
+ .next();
names
.iter()
.map(|i| {
@@ -105,7 +106,8 @@ macro_rules! impl_tensor {
i.len(),
"number of dimensions and number of dimension names differ"
)
- }).next();
+ })
+ .next();
}
};
Self {