Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address benchmarks that aren't compiling #1001

Merged
merged 3 commits into from
Dec 17, 2021

Conversation

carols10cents
Copy link
Contributor

@carols10cents carols10cents commented Dec 3, 2021

Which issue does this PR close?

Connects to #770. I'm not sure if this PR completely fixes it or not 😅

Rationale for this change

The parquet benchmarks use some types that are behind the test_common feature. The benchmarks don't build without turning on that feature. CI doesn't currently check that benches build, nor is this feature requirement documented anywhere.

What changes are included in this PR?

The first commit adds a job to CI to build (but not run) all benches in the workspace. I pushed this commit up first to demonstrate that it's currently failing.

The second commit adds --features test_common to the CI job, and it now passes. I've also documented the need for this flag in parquet/CONTRIBUTING.md.

Ideally, it'd be nice to be able to turn on a feature in Cargo.toml [bench] targets, but afaik that isn't possible currently.

Another possible solution is removing the cfg from these types, but I wasn't sure if that was desired or not.

Are there any user-facing changes?

Users trying to build parquet's benchmarks should be able to if they read the docs or check what CI does :)

@github-actions github-actions bot added the parquet Changes to the parquet crate label Dec 3, 2021
@carols10cents carols10cents force-pushed the fix-parquet-bench branch 3 times, most recently from 7216c5d to 307da0d Compare December 3, 2021 22:06
run: |
export CARGO_HOME="/github/home/.cargo"
export CARGO_TARGET_DIR="/github/home/target"
cargo build --benches --features test_common --workspace
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's strange, i was expecting any build error to be caught by the cargo clippy --features test_common run in the clippy job above 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about just cargo check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I can change it to check. I was keeping this new job consistent with the wasm32-build job.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's strange, i was expecting any build error to be caught by the cargo clippy --features test_common run in the clippy job above 🤔

That job enables the test_common feature, which fixes the problem :) The original issue (#770) is that cargo bench by itself fails to compile.

Copy link

@capkurmagati capkurmagati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might able to fix it by adding required-features.

test json::reader::tests::test_json_basic_schema ... ignored
diff --git a/parquet/Cargo.toml b/parquet/Cargo.toml
index f777b10f..d111abf2 100644
--- a/parquet/Cargo.toml
+++ b/parquet/Cargo.toml
@@ -79,4 +79,5 @@ harness = false

 [[bench]]
 name = "arrow_array_reader"
+required-features = ["test_common"]
 harness = false

@carols10cents
Copy link
Contributor Author

We might able to fix it by adding required-features.

OOooohhh!! TIL!! This seems to work, update incoming!

@carols10cents
Copy link
Contributor Author

Ok, revised: the first commit fails at the new CI job, the second commit passes.

The failing job looks like an ICE with Rust nightly that should be fixed in the next nighly; I'll try to rerun tomorrow.

@alamb
Copy link
Contributor

alamb commented Dec 10, 2021

@carols10cents I have worked around the issue with the internal compiler error with rust in #1023 so if you merge from master this PR should be green now

.github/workflows/rust.yml Outdated Show resolved Hide resolved
.github/workflows/rust.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great -- thanks @carols10cents . I just hit this as well

@alamb alamb merged commit 99b7d01 into apache:master Dec 17, 2021
@alamb
Copy link
Contributor

alamb commented Dec 17, 2021

Thanks @carols10cents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants