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

ANSI escape codes in error messages in Firefox #2278

Closed
Kangz opened this issue Mar 15, 2023 · 3 comments · Fixed by gfx-rs/wgpu#3591
Closed

ANSI escape codes in error messages in Firefox #2278

Kangz opened this issue Mar 15, 2023 · 3 comments · Fixed by gfx-rs/wgpu#3591
Assignees
Labels
area: validation Validation of the IR kind: bug Something isn't working kind: diagnostics Error message should be better

Comments

@Kangz
Copy link

Kangz commented Mar 15, 2023

Trying to fixup the webgpu-samples to run in Firefox I got the following error message from Naga:

Shader validation �[0m�[1m�[38;5;9merror�[0m�[1m: �[0m
   �[0m�[34m┌─�[0m :55:7
   �[0m�[34m│�[0m
�[0m�[34m55�[0m �[0m�[34m│�[0m   if (�[0m�[31mcMassCount > 0�[0m) {
   �[0m�[34m│�[0m       �[0m�[31m^^^^^^^^^^^^^^�[0m �[0m�[31mnaga::Expression [100]�[0m

The ANSI escape codes are adding a TON of noise that make it hard to understand what the issue is. If needed I can try to roll back my changes to retrieve the shader that was causing the issue. Let me know.

@jimblandy
Copy link
Member

Thanks for filing this. I can reproduce this locally.

It only seems to apply to errors from Naga validation; WGSL front end errors are all right:

Shader '' parsing error: unknown attribute: 'vertexx'
  ┌─ wgsl:4:2
  │
4 │ @vertexx
  │  ^^^^^^^ unknown attribute

@jimblandy jimblandy self-assigned this Mar 15, 2023
@jimblandy jimblandy added kind: bug Something isn't working area: validation Validation of the IR kind: diagnostics Error message should be better labels Mar 15, 2023
@jimblandy
Copy link
Member

The problem actually seems to be in wgpu:

        let mut writer = term::termcolor::Ansi::new(Vec::new());

@teoxoy
Copy link
Member

teoxoy commented Mar 15, 2023

Fixed in gfx-rs/wgpu#3591

@teoxoy teoxoy closed this as completed Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: validation Validation of the IR kind: bug Something isn't working kind: diagnostics Error message should be better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants