Skip to content

Commit

Permalink
fix parquet_derive with default features (and fix cargo publish) (#837
Browse files Browse the repository at this point in the history
)

* 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
  • Loading branch information
alamb committed Oct 18, 2021
1 parent 491e564 commit d6f3ef7
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 7 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions dev/release/rat_exclude_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ target/*
dev/release/rat_exclude_files.txt
arrow/test/data/*
arrow/test/dependency/*
parquet_derive/test/dependency/*
.gitattributes
**.gitignore
.gitmodules
Expand Down
19 changes: 18 additions & 1 deletion dev/release/verify-release-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions parquet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "7.0.0-SNAPSHOT", optional = true, default-features = false }
arrow = { path = "../arrow", version = "7.0.0-SNAPSHOT", 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 }
Expand All @@ -54,8 +54,8 @@ snap = "1.0"
brotli = "3.3"
flate2 = "1.0"
lz4 = "1.23"
arrow = { path = "../arrow", version = "7.0.0-SNAPSHOT" }
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"]
Expand Down
21 changes: 21 additions & 0 deletions parquet_derive/test/dependency/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!---
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.
-->

This directory contains projects that use arrow as a dependency with
various combinations of feature flags.
30 changes: 30 additions & 0 deletions parquet_derive/test/dependency/default-features/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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]
3 changes: 3 additions & 0 deletions parquet_derive/test/dependency/default-features/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

0 comments on commit d6f3ef7

Please sign in to comment.