Skip to content

reflect_auto_register_static doesn't register types in crates that aren't part of the workspace #21444

@eugineerd

Description

@eugineerd

Bevy version and features

  • bevy 0.17.2
  • reflect_auto_register_static feature

What you did

Using reflect_auto_register_static feature to automatically register types where reflect_auto_register doesn't work.

What went wrong

Only types from the current workspace get registered, anything in dependencies (bevy_reflect, bevy_ecs, bevy_transform, etc.) doesn't.

Additional information

Found by @occuros on discord

Repro: https://github.com/occuros/bevy_0_17_type_registry


This is because reflect_auto_register_static doesn't take into account where it's invoked, so the target where it writes the registration functions to is different from the one where the load_type_registrations! macro looks for them when compiled for crates outside the current workspace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ReflectionRuntime information about typesC-BugAn unexpected or incorrect behaviorD-ComplexQuite challenging from either a design or technical perspective. Ask for help!S-Needs-DesignThis issue requires design work to think about how it would best be accomplishedX-UncontroversialThis work is generally agreed upon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions