From 4226e098f3632e24931f8f026291d776535c6fe4 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 18 Oct 2021 14:40:46 -0400 Subject: [PATCH 1/3] fix parquet_derive with default features (and fix `cargo publish`) (#837) * Run all tests and do dry runs of cargo publish * Add test for building parquet derive with default features' * fix feature flags in parquet crate * fixup rat * fix default feature test --- .github/workflows/rust.yml | 14 ++++++--- dev/release/rat_exclude_files.txt | 1 + dev/release/verify-release-candidate.sh | 19 +++++++++++- parquet/Cargo.toml | 4 +-- parquet_derive/test/dependency/README.md | 21 +++++++++++++ .../dependency/default-features/Cargo.toml | 30 +++++++++++++++++++ .../dependency/default-features/src/main.rs | 3 ++ 7 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 parquet_derive/test/dependency/README.md create mode 100644 parquet_derive/test/dependency/default-features/Cargo.toml create mode 100644 parquet_derive/test/dependency/default-features/src/main.rs diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f981986ee32..631763994a8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -341,9 +341,9 @@ jobs: cargo build --no-default-features --features=csv,ipc,simd --target wasm32-unknown-unknown cargo build --no-default-features --features=csv,ipc,simd --target wasm32-wasi - # test builds with various feature flags + # test builds with various feature flag combinations outside the main workspace default-build: - name: Arrow Feature Flag Builds ${{ matrix.rust }} + name: Feature Flag Builds ${{ matrix.rust }} runs-on: ubuntu-latest strategy: matrix: @@ -373,15 +373,21 @@ jobs: rustup toolchain install ${{ matrix.rust }} rustup override set ${{ matrix.rust }} rustup component add rustfmt - - name: Build with default features + - name: Arrow Build with default features run: | export CARGO_HOME="/github/home/.cargo" export CARGO_TARGET_DIR="/github/home/target" cd arrow/test/dependency/default-features cargo check - - name: Build with default-features=false + - name: Arrow 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 + - name: Parquet Derive build with default-features + run: | + export CARGO_HOME="/github/home/.cargo" + export CARGO_TARGET_DIR="/github/home/target" + cd parquet_derive/test/dependency/default-features + cargo check diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt index c5435d0edba..c976e2c58f8 100644 --- a/dev/release/rat_exclude_files.txt +++ b/dev/release/rat_exclude_files.txt @@ -4,6 +4,7 @@ target/* dev/release/rat_exclude_files.txt arrow/test/data/* arrow/test/dependency/* +parquet_derive/test/dependency/* .gitattributes **.gitignore .gitmodules diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.sh index 1ff34fd78cd..6501aa0ae43 100755 --- a/dev/release/verify-release-candidate.sh +++ b/dev/release/verify-release-candidate.sh @@ -132,7 +132,24 @@ test_source_distribution() { */Cargo.toml cargo build - cargo test + cargo test --all + + # verify that the crates can be published to crates.io + pushd arrow + cargo publish --dry-run + popd + + pushd arrow-flight + cargo publish --dry-run + popd + + pushd parquet + cargo publish --dry-run + popd + + pushd parquet_derive + cargo publish --dry-run + popd } TEST_SUCCESS=no diff --git a/parquet/Cargo.toml b/parquet/Cargo.toml index e11633540ea..e2c86661cab 100644 --- a/parquet/Cargo.toml +++ b/parquet/Cargo.toml @@ -41,7 +41,7 @@ lz4 = { version = "1.23", optional = true } zstd = { version = "0.9", optional = true } chrono = "0.4" num-bigint = "0.4" -arrow = { path = "../arrow", version = "6.0.0", optional = true, default-features = false } +arrow = { path = "../arrow", version = "6.0.0", optional = true, default-features = false, features = ["ipc"] } base64 = { version = "0.13", optional = true } clap = { version = "2.33.3", optional = true } serde_json = { version = "1.0", features = ["preserve_order"], optional = true } @@ -54,8 +54,8 @@ snap = "1.0" brotli = "3.3" flate2 = "1.0" lz4 = "1.23" -arrow = { path = "../arrow", version = "6.0.0" } serde_json = { version = "1.0", features = ["preserve_order"] } +arrow = { path = "../arrow", version = "7.0.0-SNAPSHOT", default-features = false, features = ["test_utils"] } [features] default = ["arrow", "snap", "brotli", "flate2", "lz4", "zstd", "base64"] diff --git a/parquet_derive/test/dependency/README.md b/parquet_derive/test/dependency/README.md new file mode 100644 index 00000000000..b618b4636e7 --- /dev/null +++ b/parquet_derive/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/parquet_derive/test/dependency/default-features/Cargo.toml b/parquet_derive/test/dependency/default-features/Cargo.toml new file mode 100644 index 00000000000..2a98dd49657 --- /dev/null +++ b/parquet_derive/test/dependency/default-features/Cargo.toml @@ -0,0 +1,30 @@ +# 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 parquet_derive that uses no additional 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] +parquet_derive = { path = "../../../../parquet_derive", version = "7.0.0-SNAPSHOT" } + +# Keep this out of the default workspace +[workspace] diff --git a/parquet_derive/test/dependency/default-features/src/main.rs b/parquet_derive/test/dependency/default-features/src/main.rs new file mode 100644 index 00000000000..e7a11a969c0 --- /dev/null +++ b/parquet_derive/test/dependency/default-features/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} From 7edb146eb715d3f8733949480d59b5e1c4c4f7f0 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Sun, 24 Oct 2021 06:47:53 -0400 Subject: [PATCH 2/3] Update parquet_derive/test/dependency/default-features/Cargo.toml --- parquet_derive/test/dependency/default-features/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parquet_derive/test/dependency/default-features/Cargo.toml b/parquet_derive/test/dependency/default-features/Cargo.toml index 2a98dd49657..5d811aaf256 100644 --- a/parquet_derive/test/dependency/default-features/Cargo.toml +++ b/parquet_derive/test/dependency/default-features/Cargo.toml @@ -24,7 +24,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -parquet_derive = { path = "../../../../parquet_derive", version = "7.0.0-SNAPSHOT" } +parquet_derive = { path = "../../../../parquet_derive", version = "6.0.0" } # Keep this out of the default workspace [workspace] From bc90765177050efa337a93cf5494dab7b0916b9b Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Sun, 24 Oct 2021 07:08:25 -0400 Subject: [PATCH 3/3] Remove merge issue --- parquet/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/parquet/Cargo.toml b/parquet/Cargo.toml index e2c86661cab..00409ebda3f 100644 --- a/parquet/Cargo.toml +++ b/parquet/Cargo.toml @@ -55,7 +55,6 @@ brotli = "3.3" flate2 = "1.0" lz4 = "1.23" serde_json = { version = "1.0", features = ["preserve_order"] } -arrow = { path = "../arrow", version = "7.0.0-SNAPSHOT", default-features = false, features = ["test_utils"] } [features] default = ["arrow", "snap", "brotli", "flate2", "lz4", "zstd", "base64"]