bevyengine / bevyengine/bevy

`BevyManifest` incorrectly assumes that all crates starting with `bevy_` are exposed through `::bevy::`

Open
#17,816 2 comments 0 reactions 0 assignees View on GitHub
A-Cross-Cutting C-Bug D-Macros S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

https://github.com/bevyengine/bevy/blob/153ce468efb1d596c744378be6bdb1a83dea05b8/crates/bevy_macro_utils/src/bevy_manifest.rs#L14-L18

When I modified `BevyManifest`, I thought that it was bevy internal. However it is also used by https://github.com/bevyengine/bevy_editor_prototypes/blob/f41e2240174e29f1c9206bb6b080431463466ea5/crates/bevy_bsn/src/macros/src/derive_construct.rs#L14-L16 and possibly in other crates too. As long as only official bevy crates are resolved though it, there are no issues.

However, should a user crate that extends bevy and is named `bevy_...` use the `BevyManifest` in their proc macros, it will incorrectly assume their crate is available through `::bevy::`.

A fix would be to only strip the prefix from the `bevy_` crates that are actually available through `::bevy::`.

I can create a pr for this and see two options:
1) List dir in `crates/` to get all the bevy internal crates. More complex but should automatically keep up with bevy but possibly yield wrong results if crates are added that are not rexported through bevy.
2) Just using a manual string list. Simpler but needs to be kept in sync manually.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.