Skip to content
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

bevy_ui doesn't compile without the bevy_text feature #8984

Closed
nicopap opened this issue Jun 28, 2023 · 6 comments · Fixed by #8985
Closed

bevy_ui doesn't compile without the bevy_text feature #8984

nicopap opened this issue Jun 28, 2023 · 6 comments · Fixed by #8985
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior P-Compile-Failure A failure to compile Bevy apps

Comments

@nicopap
Copy link
Contributor

nicopap commented Jun 28, 2023

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.

@nicopap nicopap added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets P-Compile-Failure A failure to compile Bevy apps labels Jun 28, 2023
@ickshonpe
Copy link
Contributor

ickshonpe commented Jun 28, 2023

I introduced the first one when fixing the text queue problems. Put in a pr a while ago #8670 that needs to be added to 0.11

@nicopap
Copy link
Contributor Author

nicopap commented Jun 29, 2023

Still doesn't fix the compilation error. There is more than a single compilation error.

@ickshonpe
Copy link
Contributor

ickshonpe commented Jun 29, 2023

Still doesn't fix the compilation error. There is more than a single compilation error.

It did when I made the PR I think, just more errors were merged afterwards 😓.

@ickshonpe
Copy link
Contributor

ickshonpe commented Jun 29, 2023

Can we get this checked for by CI? It seems like every time there is a non-trivial UI change it will get broken again.

@nicopap
Copy link
Contributor Author

nicopap commented Jun 29, 2023

It's a fairly difficult choice. On one hand, we should make sure bevy compiles with all possible combination of feature flags, on the other hand, it's going to eat CI time like crazy.

I'd defer to @mockersf, given their knowledge of the CI pipeline

@mockersf
Copy link
Member

mockersf commented Jul 3, 2023

Compiling each crate individually without default features wouldn't add a lot, but currently there's no easy way to get a list of all crates in the workspace, so that's a bit painful to set up in CI.

A few crates are checked without default features:

crate: [bevy_ecs, bevy_reflect, bevy]

github-merge-queue bot pushed a commit that referenced this issue Jul 3, 2023
# Objective

- Fix #8984 

### Solution

- Address compilation errors

I admit: I did sneak it an unrelated mini-refactor. of the
`measurment.rs` module. it seemed to me that directly importing `taffy`
types helped reduce a lot of boilerplate, so I did it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior P-Compile-Failure A failure to compile Bevy apps
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants