Skip to content

CiTestingConfig is blocking bevy_dev_tools from using bevy_render #12356

@pablo-lua

Description

@pablo-lua

Bevy version

After #11341

What you did

Trying to import bevy_render or some crate that depends on bevy_render, like in #12354

What went wrong

This causes circular a dependence, because bevy_render depends internally on bevy_dev_tools

Additional information

Place where we use bevy_dev_tools in bevy_render

impl Plugin for ScreenshotPlugin {
   // . . .

    fn finish(&self, app: &mut bevy_app::App) {
        if let Ok(render_app) = app.get_sub_app_mut(RenderApp) {
            render_app.init_resource::<SpecializedRenderPipelines<ScreenshotToScreenPipeline>>();
        }

        #[cfg(feature = "bevy_ci_testing")]
        if app
            .world
            .contains_resource::<bevy_dev_tools::ci_testing::CiTestingConfig>()
        {
            app.add_systems(bevy_app::Update, ci_testing_screenshot_at);
        }
    }
}

#[cfg(feature = "bevy_ci_testing")]
fn ci_testing_screenshot_at(
    mut current_frame: Local<u32>,
    ci_testing_config: Res<bevy_dev_tools::ci_testing::CiTestingConfig>,
    mut screenshot_manager: ResMut<ScreenshotManager>,
    main_window: Query<Entity, With<bevy_window::PrimaryWindow>>,
) {
// . . .
}

Possible solutions

We can probably

  • Move related ci Test (probably used by screenshot example) into tests and adding this Ci system into there, so we can make sure that screenshots are still working. Then we can remove Ci from bevy_render
  • Move Ci back to where it was before, reverting the changes on this field, as we shouldn't really rely internally on nothing from inside bevy_dev_tools
  • Address this case in specific: If we are relying on screenshot to add this, maybe we can add the needed system somehow inside bevy_dev_tools?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Dev-ToolsTools used to debug Bevy applications.A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions