Skip to content

Commit 787e826

Browse files
authored
Add tests for building applications using arrow with different feature flags (apache#532)
* Add tests for building arrow without dependencies * exclude rat
1 parent f1fb2b1 commit 787e826

File tree

7 files changed

+108
-13
lines changed

7 files changed

+108
-13
lines changed

.github/workflows/rust.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ jobs:
244244
rustup component add rustfmt
245245
- name: Run
246246
run: cargo fmt --all -- --check
247+
247248
coverage:
248249
name: Coverage
249250
runs-on: ubuntu-latest
@@ -327,9 +328,9 @@ jobs:
327328
cd arrow
328329
cargo build --target wasm32-unknown-unknown
329330
330-
# test the projects can build without default features
331+
# test builds with various feature flags
331332
default-build:
332-
name: Check No Defaults on AMD64 Rust ${{ matrix.rust }}
333+
name: Arrow Feature Flag Builds ${{ matrix.rust }}
333334
runs-on: ubuntu-latest
334335
strategy:
335336
matrix:
@@ -338,15 +339,10 @@ jobs:
338339
container:
339340
image: ${{ matrix.arch }}/rust
340341
env:
341-
# Disable full debug symbol generation to speed up CI build and keep memory down
342-
# "1" means line tables only, which is useful for panic tracebacks.
343-
RUSTFLAGS: "-C debuginfo=1"
344-
ARROW_TEST_DATA: /__w/arrow-rs/arrow-rs/testing/data
345-
PARQUET_TEST_DATA: /__w/arrow/arrow/parquet-testing/data
342+
# Disable debug symbol generation to speed up CI build and keep memory down
343+
RUSTFLAGS: "-C debuginfo=0"
346344
steps:
347345
- uses: actions/checkout@v2
348-
with:
349-
submodules: true
350346
- name: Cache Cargo
351347
uses: actions/cache@v2
352348
with:
@@ -357,15 +353,22 @@ jobs:
357353
uses: actions/cache@v2
358354
with:
359355
path: /github/home/target
360-
key: ${{ runner.os }}-${{ matrix.arch }}-target-wasm32-cache-${{ matrix.rust }}
356+
# this key equals the ones on `linux-build-lib` for re-use
357+
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache-${{ matrix.rust }}
361358
- name: Setup Rust toolchain
362359
run: |
363360
rustup toolchain install ${{ matrix.rust }}
364361
rustup override set ${{ matrix.rust }}
365362
rustup component add rustfmt
366-
- name: Build arrow crate
363+
- name: Build with default features
367364
run: |
368365
export CARGO_HOME="/github/home/.cargo"
369366
export CARGO_TARGET_DIR="/github/home/target"
370-
cd arrow
371-
cargo check --all-targets --no-default-features
367+
cd arrow/test/dependency/default-features
368+
cargo check
369+
- name: Build with default-features=false
370+
run: |
371+
export CARGO_HOME="/github/home/.cargo"
372+
export CARGO_TARGET_DIR="/github/home/target"
373+
cd arrow/test/dependency/no-default-features
374+
cargo check

arrow/test/dependency/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!---
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
This directory contains projects that use arrow as a dependency with
21+
various combinations of feature flags.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
[package]
19+
name = "defeault-features"
20+
description = "Models a user application of arrow that uses default features of arrow"
21+
version = "0.1.0"
22+
edition = "2018"
23+
24+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
25+
26+
[dependencies]
27+
arrow = { path = "../../../../arrow", version = "5.0.0-SNAPSHOT" }
28+
29+
# Workaround for https://github.com/apache/arrow-rs/issues/529
30+
rand = { version = "0.8" }
31+
32+
[workspace]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
[package]
19+
name = "no-default-features"
20+
description = "Models a user application of arrow that specifies no-default-features=true"
21+
version = "0.1.0"
22+
edition = "2018"
23+
24+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
25+
26+
[dependencies]
27+
arrow = { path = "../../../../arrow", version = "5.0.0-SNAPSHOT", default-features = false }
28+
29+
# Workaround for https://github.com/apache/arrow-rs/issues/529
30+
rand = { version = "0.8" }
31+
32+
[workspace]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}

dev/release/rat_exclude_files.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ testing/*
33
target/*
44
dev/release/rat_exclude_files.txt
55
arrow/test/data/*
6+
arrow/test/dependency/*
67
.gitattributes
78
**.gitignore
89
.gitmodules

0 commit comments

Comments
 (0)