Skip to content

bevy_ui doesn't compile without the bevy_text feature #8984

@nicopap

Description

@nicopap

Bevy version

main branch: c24520c

What you did

cargo check --package bevy_ui --no-default-features

What went wrong

Compilation error (several)

error[E0432]: unresolved import `crate::widget::TextFlags`
 --> crates/bevy_ui/src/node_bundles.rs:4:22
  |
4 |     widget::{Button, TextFlags, UiImageSize},
  |                      ^^^^^^^^^ no `TextFlags` in `widget`

error[E0412]: cannot find type `Without` in this scope
   --> crates/bevy_ui/src/widget/image.rs:137:22
    |
137 |         (With<Node>, Without<UiImage>),
    |                      ^^^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
1   + use bevy_ecs::prelude::Without;
    |
1   + use crate::Without;
    |

error[E0599]: the method `before` exists for fn item `fn(Local<'a, f64>, Query<'b, 'c, &Window, With<...>>, ..., ..., ...) {update_atlas_content_size_system}`, but its trait bounds were not satisfied
   --> crates/bevy_ui/src/lib.rs:163:54
    |
163 |             widget::update_atlas_content_size_system.before(UiSystem::Layout),
    |                                                      ^^^^^^ method cannot be called due to unsatisfied trait bounds
    |

Why it's happening

bevy_text is marked as optional = true in the bevy_ui Cargo.toml. And there is several #[cfg(feature = "bevy_text")] that indicates it is intended to be possible to run bevy_ui without bevy_text.

When I use the --no-default-feature, bevy_text is removed as a dependency, and the feature flag "bevy_text" is also removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UIGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorP-Compile-FailureA failure to compile Bevy apps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions