-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Check dev-dependencies for bevy
/bevy-internal
only in test builds
#2262
Conversation
fixes issue where using `bevy` in `[dev-dependencies]` but not `[dependencies]` would cause macros to fail to compile in normal builds
a2ef41d
to
07bcdcf
Compare
Wow, I had run |
.or_else(|| deps_dev.and_then(find_in_deps)) | ||
.unwrap_or_else(|| get_path(name)) | ||
let path = deps.and_then(find_in_deps); | ||
#[cfg(test)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[cfg(test)]
is only set when the current crate is itself tested, not when any dependent crate is being tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RIP... I knew something had to be wrong with this approach. Any idea how to make this work, then?
Admittedly my specific use case is a bit of laziness, and not depending on bevy
is saving me less as time goes on and I decide I want to use more of bevy's features... but this seems like something that might surprise other users...
Is it possible to add a test for this? |
While I originally said this is a regression, it's entirely possible I'm the only user this is affecting, and I don't see a way forward if it's not possible to know when Although I have to wonder if |
This fixes a regression caused by #1875 where using
bevy
in[dev-dependencies]
but not in[dependencies]
(using, e.g.,bevy_ecs
instead) would cause derive macros to fail to compile in non-test builds.