From a9a0728761deb0cf7c37f294c816abbafb8ea16a Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 9 Jul 2021 15:25:25 -0400 Subject: [PATCH 1/2] Add tests for building arrow without dependencies --- .github/workflows/rust.yml | 29 +++++++++-------- arrow/test/dependency/README.md | 21 ++++++++++++ .../dependency/default-features/Cargo.toml | 32 +++++++++++++++++++ .../dependency/default-features/src/main.rs | 3 ++ .../dependency/no-default-features/Cargo.toml | 32 +++++++++++++++++++ .../no-default-features/src/main.rs | 3 ++ 6 files changed, 107 insertions(+), 13 deletions(-) create mode 100644 arrow/test/dependency/README.md create mode 100644 arrow/test/dependency/default-features/Cargo.toml create mode 100644 arrow/test/dependency/default-features/src/main.rs create mode 100644 arrow/test/dependency/no-default-features/Cargo.toml create mode 100644 arrow/test/dependency/no-default-features/src/main.rs diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ea561b16e68..d65de5a54c3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -244,6 +244,7 @@ jobs: rustup component add rustfmt - name: Run run: cargo fmt --all -- --check + coverage: name: Coverage runs-on: ubuntu-latest @@ -327,9 +328,9 @@ jobs: cd arrow cargo build --target wasm32-unknown-unknown - # test the projects can build without default features + # test builds with various feature flags default-build: - name: Check No Defaults on AMD64 Rust ${{ matrix.rust }} + name: Arrow Feature Flag Builds ${{ matrix.rust }} runs-on: ubuntu-latest strategy: matrix: @@ -338,15 +339,10 @@ jobs: container: image: ${{ matrix.arch }}/rust env: - # Disable full debug symbol generation to speed up CI build and keep memory down - # "1" means line tables only, which is useful for panic tracebacks. - RUSTFLAGS: "-C debuginfo=1" - ARROW_TEST_DATA: /__w/arrow-rs/arrow-rs/testing/data - PARQUET_TEST_DATA: /__w/arrow/arrow/parquet-testing/data + # Disable debug symbol generation to speed up CI build and keep memory down + RUSTFLAGS: "-C debuginfo=0" steps: - uses: actions/checkout@v2 - with: - submodules: true - name: Cache Cargo uses: actions/cache@v2 with: @@ -357,15 +353,22 @@ jobs: uses: actions/cache@v2 with: path: /github/home/target - key: ${{ runner.os }}-${{ matrix.arch }}-target-wasm32-cache-${{ matrix.rust }} + # this key equals the ones on `linux-build-lib` for re-use + key: ${{ runner.os }}-${{ matrix.arch }}-target-cache-${{ matrix.rust }} - name: Setup Rust toolchain run: | rustup toolchain install ${{ matrix.rust }} rustup override set ${{ matrix.rust }} rustup component add rustfmt - - name: Build arrow crate + - name: Build with default features run: | export CARGO_HOME="/github/home/.cargo" export CARGO_TARGET_DIR="/github/home/target" - cd arrow - cargo check --all-targets --no-default-features + cd arrow/test/dependency/default-features + cargo check + - name: Build with default-features=false + run: | + export CARGO_HOME="/github/home/.cargo" + export CARGO_TARGET_DIR="/github/home/target" + cd arrow/test/dependency/no-default-features + cargo check diff --git a/arrow/test/dependency/README.md b/arrow/test/dependency/README.md new file mode 100644 index 00000000000..b618b4636e7 --- /dev/null +++ b/arrow/test/dependency/README.md @@ -0,0 +1,21 @@ + + +This directory contains projects that use arrow as a dependency with +various combinations of feature flags. diff --git a/arrow/test/dependency/default-features/Cargo.toml b/arrow/test/dependency/default-features/Cargo.toml new file mode 100644 index 00000000000..01eb962c6bd --- /dev/null +++ b/arrow/test/dependency/default-features/Cargo.toml @@ -0,0 +1,32 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +[package] +name = "defeault-features" +description = "Models a user application of arrow that uses default features of arrow" +version = "0.1.0" +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[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/default-features/src/main.rs b/arrow/test/dependency/default-features/src/main.rs new file mode 100644 index 00000000000..e7a11a969c0 --- /dev/null +++ b/arrow/test/dependency/default-features/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/arrow/test/dependency/no-default-features/Cargo.toml b/arrow/test/dependency/no-default-features/Cargo.toml new file mode 100644 index 00000000000..77824975405 --- /dev/null +++ b/arrow/test/dependency/no-default-features/Cargo.toml @@ -0,0 +1,32 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +[package] +name = "no-default-features" +description = "Models a user application of arrow that specifies no-default-features=true" +version = "0.1.0" +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[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] diff --git a/arrow/test/dependency/no-default-features/src/main.rs b/arrow/test/dependency/no-default-features/src/main.rs new file mode 100644 index 00000000000..e7a11a969c0 --- /dev/null +++ b/arrow/test/dependency/no-default-features/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} From 65db5add5250b6a17be9b5834205af848f2c3cf6 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 9 Jul 2021 15:52:53 -0400 Subject: [PATCH 2/2] exclude rat --- dev/release/rat_exclude_files.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt index 4c13feef651..d64a431faf5 100644 --- a/dev/release/rat_exclude_files.txt +++ b/dev/release/rat_exclude_files.txt @@ -3,6 +3,7 @@ testing/* target/* dev/release/rat_exclude_files.txt arrow/test/data/* +arrow/test/dependency/* .gitattributes **.gitignore .gitmodules