Skip to content

Shader processing error log contains escaped ANSI sequences #21164

Closed

Description

@akimakinai

Bevy version and features

main

What you did

Load shaders that contain errors.

What went wrong

Error message contain sanitized ANSI escape sequences, which make it unreadable.

ERROR bevy_render::render_resource::pipeline_cache: failed to process shader error:
\x1b[0m\x1b[1m\x1b[38;5;9merror\x1b[0m\x1b[1m: failed to build a valid final module: Entry point fragment at Fragment is invalid\x1b[0m
   \x1b[0m\x1b[36m┌─\x1b[0m shaders/custom_material.wgsl:13:12
   \x1b[0m\x1b[36m│\x1b[0m
\x1b[0m\x1b[36m13\x1b[0m \x1b[0m\x1b[36m│\x1b[0m     return \x1b[0m\x1b[31m(material_color * textureSample(material_color_texture, material_color_sampler, mesh.uv) * "shaders/custom_material_import.wgsl"::COLOR_MULTIPLIER).rgb\x1b[0m;
   \x1b[0m\x1b[36m│\x1b[0m            \x1b[0m\x1b[31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\x1b[0m \x1b[0m\x1b[31mnaga::ir::Expression [10]\x1b[0m
   \x1b[0m\x1b[36m│\x1b[0m
   \x1b[0m\x1b[36m=\x1b[0m The `return` expression Some([10]) does not match the declared return type Some([0])

Additional information

This is probably caused by tokio-rs/tracing@4c52ca5 (tracing-subscriber 0.3.20). It seems like users can no longer output logs with ANSI escape sequences.

Activity

  1. added
    C-BugAn unexpected or incorrect behavior
    S-Needs-TriageThis issue needs to be labelled
    on Sep 22, 2025
  2. ChristopherBiscardi commented on Sep 22, 2025

    @ChristopherBiscardi
    Member

    This is a tracing-subscriber 0.3.20 change, ansi codes are no longer allowed in log content regardless of with_ansi configuration.

    This log is being colorized by naga-oil and can be worked-around user side by setting NO_COLOR.

    NO_COLOR=true cargo run
    
    ERROR bevy_render::render_resource::pipeline_cache: failed to process shader error:
    error: no definition in scope for identifier: `psbr_input`
        ┌─ shaders/terrain.wgsl:101:15
        │
    101 │     let uv = (psbr_input.material.uv_transform * vec3(in.uv, 1.)).xy;
        │               ^^^^^^^^^^ unknown identifier
        │
        = no definition in scope for identifier: `psbr_input`
    
  3. added this to the 0.17 milestone on Sep 22, 2025
  4. added
    S-Needs-DesignThis issue requires design work to think about how it would best be accomplished
    A-RenderingDrawing game state to the screen
    and removed
    S-Needs-TriageThis issue needs to be labelled
    on Sep 22, 2025
  5. alice-i-cecile commented on Sep 22, 2025

    @alice-i-cecile
    Member

    Should we just pin our tracing-subscriber version for now?

    EDIT: @james7132 replies: " Given it's a security vulnerability, I would rather us not do so."

  6. tychedelia commented on Sep 23, 2025

    @tychedelia
    Member
  7. alice-i-cecile commented on Sep 26, 2025

    @alice-i-cecile
    Member

    Fixed (well, mitigated) by the new naga_oil release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions