You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by uw...@apache.org on 2018/09/09 10:33:05 UTC

[arrow] branch master updated: ARROW-2520: [Rust] CI should also build against nightly Rust

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

uwe 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 7a2d228  ARROW-2520: [Rust] CI should also build against nightly Rust
7a2d228 is described below

commit 7a2d2283606dcbc1eeea8f51eada66b597315d4e
Author: Krisztián Szűcs <sz...@gmail.com>
AuthorDate: Sun Sep 9 12:32:46 2018 +0200

    ARROW-2520: [Rust] CI should also build against nightly Rust
    
    Author: Krisztián Szűcs <sz...@gmail.com>
    
    Closes #2477 from kszucs/ARROW-2520 and squashes the following commits:
    
    79b1e7a8 <Krisztián Szűcs> check against "Rust" in appceyor-install.bat
    4a31a422 <Krisztián Szűcs> fix install script
    99b99b65 <Krisztián Szűcs> set rust stable toolchain as default after running tests on appveyor
    f941121f <Krisztián Szűcs> use rustup environment variable
    15b6358a <Krisztián Szűcs> don't parenthesize
    07db3d94 <Krisztián Szűcs> make travis_install_cargo executable
    8af4c761 <Krisztián Szűcs> test both stable and nightly rust in the same CI step
    2720e1ed <Krisztián Szűcs> remove rust from allow_failures
    c5dd1449 <Krisztián Szűcs> separate matrix step
    79839767 <Krisztián Szűcs> remove beta channel
    40c0ed82 <Krisztián Szűcs> rust against rust nightly
---
 .travis.yml                                           | 11 ++++-------
 appveyor.yml                                          |  3 +--
 ci/appveyor-build.bat                                 | 18 ++++++++++++++++--
 ci/appveyor-install.bat                               |  6 ++++--
 ci/{travis_script_rust.sh => travis_install_cargo.sh} | 19 ++++++++-----------
 ci/travis_script_rust.sh                              |  4 ++++
 6 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index d919baf..43a5725 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -212,7 +212,6 @@ matrix:
   # Rust
   - language: rust
     cache: cargo
-    rust: stable
     addons:
       apt:
         packages:
@@ -223,17 +222,15 @@ matrix:
           - cmake
     before_script:
     - if [ $ARROW_CI_RUST_AFFECTED != "1" ]; then exit; fi
-    - pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
-    - export CARGO_TARGET_DIR=$TRAVIS_BUILD_DIR/target
-    - cargo install cargo-travis || echo "Skipping cargo-travis installation as it already exists in cache"
-    - export PATH=$HOME/.cargo/bin:$PATH
+    - $TRAVIS_BUILD_DIR/ci/travis_install_cargo.sh
     script:
-    - $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh
+    - RUSTUP_TOOLCHAIN=stable $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh
+    - RUSTUP_TOOLCHAIN=nightly $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh || true
     after_success:
     - pushd ${TRAVIS_BUILD_DIR}/rust
     # Run coverage for codecov.io
     - mkdir -p target/kcov
-    - RUST_BACKTRACE=1 cargo coverage --verbose
+    - RUST_BACKTRACE=1 RUSTUP_TOOLCHAIN=stable cargo coverage --verbose
     - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
   # Go
   - language: go
diff --git a/appveyor.yml b/appveyor.yml
index 1bbdf65..18ad9f5 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -60,8 +60,7 @@ environment:
       GENERATOR: Ninja
       CONFIGURATION: "Release"
       BUILD_SCRIPT: "CMake_Build_Script"
-    - JOB: "Rust_Stable"
-      RUST_VERSION: stable
+    - JOB: "Rust"
       TARGET: x86_64-pc-windows-msvc
       USE_CLCACHE: false
 
diff --git a/ci/appveyor-build.bat b/ci/appveyor-build.bat
index 4d6f047..304afc0 100644
--- a/ci/appveyor-build.bat
+++ b/ci/appveyor-build.bat
@@ -17,12 +17,26 @@
 
 @echo on
 
-if "%JOB%" == "Rust_Stable" (
-    cd rust
+if "%JOB%" == "Rust" (
+    pushd rust
+
+    rustup default stable
+    rustup show
     cargo build --target %TARGET% || exit /B
     cargo build --target %TARGET% --release || exit /B
     cargo test --target %TARGET% || exit /B
     cargo test --target %TARGET% --release || exit /B
+
+    rustup default nightly
+    rustup show
+    cargo build --target %TARGET%
+    cargo build --target %TARGET% --release
+    cargo test --target %TARGET%
+    cargo test --target %TARGET% --release
+
+    rustup default stable
+
+    popd
 ) else (
     git config core.symlinks true
     git reset --hard
diff --git a/ci/appveyor-install.bat b/ci/appveyor-install.bat
index f514e78..483f262 100644
--- a/ci/appveyor-install.bat
+++ b/ci/appveyor-install.bat
@@ -17,10 +17,12 @@
 
 @echo on
 
-if "%JOB%" == "Rust_Stable" (
+if "%JOB%" == "Rust" (
     curl -sSf -o rustup-init.exe https://win.rustup.rs/
-    rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
+    rustup-init.exe -y --default-host %TARGET% --default-toolchain stable
     set "PATH=%PATH%;C:\Users\Appveyor\.cargo\bin"
+    rustup install stable
+    rustup install nightly
     rustc -Vv
     cargo -V
 ) else (
diff --git a/ci/travis_script_rust.sh b/ci/travis_install_cargo.sh
similarity index 70%
copy from ci/travis_script_rust.sh
copy to ci/travis_install_cargo.sh
index f85820f..f433033 100755
--- a/ci/travis_script_rust.sh
+++ b/ci/travis_install_cargo.sh
@@ -19,17 +19,14 @@
 
 set -e
 
-RUST_DIR=${TRAVIS_BUILD_DIR}/rust
+# ensure that both toolchains are installed
+rustup install stable
+rustup install nightly
 
-pushd $RUST_DIR
+pip install 'travis-cargo<0.2' --user
 
-# raises on any formatting errors
-rustup component add rustfmt-preview
-cargo fmt --all -- --check
-# raises on any warnings
-cargo rustc -- -D warnings
+export PATH=$HOME/.local/bin:$PATH
+export CARGO_TARGET_DIR=$TRAVIS_BUILD_DIR/target
 
-cargo build
-cargo test
-
-popd
+cargo install cargo-travis || echo "Skipping cargo-travis installation as it already exists in cache"
+export PATH=$HOME/.cargo/bin:$PATH
diff --git a/ci/travis_script_rust.sh b/ci/travis_script_rust.sh
index f85820f..9fecb3f 100755
--- a/ci/travis_script_rust.sh
+++ b/ci/travis_script_rust.sh
@@ -23,9 +23,13 @@ RUST_DIR=${TRAVIS_BUILD_DIR}/rust
 
 pushd $RUST_DIR
 
+# show activated toolchain
+rustup show
+
 # raises on any formatting errors
 rustup component add rustfmt-preview
 cargo fmt --all -- --check
+
 # raises on any warnings
 cargo rustc -- -D warnings