Skip to content

Fix velocity_projection bench never compiling - #1040

Open
francisdb wants to merge 1 commit into
avianphysics:mainfrom
francisdb:fix/velocity-projection-bench
Open

Fix velocity_projection bench never compiling#1040
francisdb wants to merge 1 commit into
avianphysics:mainfrom
francisdb:fix/velocity-projection-bench

Conversation

@francisdb

Copy link
Copy Markdown

Objective

Remove invalid-feature warning on every build

Solution

The velocity_projection bench target required a "test" feature that was never declared, so cargo skipped the bench and printed an invalid-feature warning on every build. Since the bench never compiled, it had also bit-rotted: it imported the since-removed avian3d::math::PI along with an unused Vec3.

Declare the test feature in avian2d and avian3d, gate the shared test utilities module on cfg(any(test, feature = "test")) so benches can use QuasiRandomDirection, and drop the stale bench imports. The bench now compiles and runs with: cargo bench -p avian3d --features test

I kept the test feature name from the bench's original required-features, but can rename it to something like test-util if you prefer, since cfg(any(test, feature = "test")) is confusing.

AI assisted

Testing

The CI clippy step now runs cargo clippy --locked --all-targets --features avian2d/test,avian3d/test, which compiles and lints the bench on every PR. Verified locally with CI's deny-warnings flags

@francisdb

francisdb commented Jul 31, 2026

Copy link
Copy Markdown
Author

The Test Suite failure is unrelated to this PR: since nightly 2026-07-30, cargo's new build-dir layout (rust-lang/cargo#17258) breaks cargo-nextest's dylib search path, so any binary needing libbevy_dylib.so fails to load; all current PRs fail the same way. UPDATE: Fixed on the side of nextest

The velocity_projection bench target required a "test" feature that was
never declared, so cargo skipped the bench and printed an invalid-feature
warning on every build. Since the bench never compiled, it had also
bit-rotted: it imported the since-removed avian3d::math::PI along with
an unused Vec3.

Declare the test feature in avian2d and avian3d, gate the shared test
utilities module on cfg(any(test, feature = "test")) so benches can use
QuasiRandomDirection, and drop the stale bench imports. Enable the
feature in the CI clippy invocation so the bench keeps compiling.
The bench now runs with: cargo bench -p avian3d --features test
@francisdb
francisdb force-pushed the fix/velocity-projection-bench branch from 7627a8d to d1615da Compare August 5, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant