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

Missing resource Assets<TextureAtlas> with specific feature combination #8918

Closed
TimJentzsch opened this issue Jun 21, 2023 · 2 comments · Fixed by #8920
Closed

Missing resource Assets<TextureAtlas> with specific feature combination #8918

TimJentzsch opened this issue Jun 21, 2023 · 2 comments · Fixed by #8920
Labels
C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled

Comments

@TimJentzsch
Copy link
Contributor

Bevy version

0.10.1

[Optional] Relevant system information

If you cannot get Bevy to build or run on your machine, please include:

  • cargo 1.70.0 (ec8a8a0ca 2023-04-25)
  • Linux (Pop!_OS)

If your bug is rendering-related, copy the adapter info that appears when you run Bevy.

AdapterInfo { name: "NVIDIA GeForce RTX 2070 SUPER", vendor: 4318, device: 7812, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "525.116.04", backend: Vulkan }

What you did

Bevy dependency with the following features:

[dependencies.bevy]
version = "0.10"
default-features = false
features = [
  "bevy_asset",
  "bevy_text",
  "bevy_render",
  "bevy_core_pipeline",
  "x11",
  "filesystem_watcher",
  "bevy_ui",
]

main.rs:

use bevy::prelude::*;

fn main() {
    App::new().add_plugins(DefaultPlugins).run();
}

What went wrong

What actually happened:

thread '<unnamed>' panicked at 'Resource requested by bevy_text::text2d::update_text2d_layout does not exist: bevy_asset::assets::Assets<bevy_sprite::texture_atlas::TextureAtlas>', /home/tim/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.10.1/src/system/system_param.rs:555:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'A system has panicked so the executor cannot continue.: RecvError', /home/tim/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.10.1/src/schedule/executor/multi_threaded.rs:194:60
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/tim/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.10.1/src/task_pool.rs:376:49

What I expected:

The app runs without crashing.
Looks like there is either a missing feature dependency or the texture atlas should be created when another feature is enabled.

@TimJentzsch TimJentzsch added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 21, 2023
@TimJentzsch
Copy link
Contributor Author

Adding the bevy_sprite feature as well fixes the problem.
I assume that bevy_text needs a dependency on that.

@TimJentzsch
Copy link
Contributor Author

On main the given feature configuration doesn't trigger the error anymore, because bevy_ui has bevy_sprite as a dependency.
If you remove the bevy_ui dependency, you can still reproduce the error though.

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

- Fixes #8918.
- The app should not crash if only the `bevy_text` feature is enabled.

## Solution

The `bevy_text` feature now depends on `bevy_asset` and `bevy_sprite`,
because it uses resources from these crates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant