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

Naga fails to build: "unresolved import back::continue_forward" #6063

Closed
jimblandy opened this issue Jul 30, 2024 · 1 comment · Fixed by #6064
Closed

Naga fails to build: "unresolved import back::continue_forward" #6063

jimblandy opened this issue Jul 30, 2024 · 1 comment · Fixed by #6064
Labels
naga Shader Translator

Comments

@jimblandy
Copy link
Member

Naga fails to build as follows (which happens to be the way Firefox uses it):

$ cargo build --target=x86_64-pc-windows-msvc --features="dx12 vulkan"
   Compiling naga v22.0.0 (/home/jimb/rust/wgpu/naga)
   Compiling wgpu-core v22.0.0 (/home/jimb/rust/wgpu/wgpu-core)
   Compiling d3d12 v22.0.0 (/home/jimb/rust/wgpu/d3d12)
error[E0432]: unresolved import `back::continue_forward`
    --> naga/src/back/hlsl/writer.rs:1574:19
     |
1574 |         use back::continue_forward::ExitControlFlow;
     |                   ^^^^^^^^^^^^^^^^ could not find `continue_forward` in `back`

error[E0433]: failed to resolve: could not find `continue_forward` in `back`
   --> naga/src/back/hlsl/writer.rs:107:33
    |
107 |             continue_ctx: back::continue_forward::ContinueCtx::default(),
    |                                 ^^^^^^^^^^^^^^^^ could not find `continue_forward` in `back`

error[E0433]: failed to resolve: could not find `continue_forward` in `back`
   --> naga/src/back/hlsl/mod.rs:330:25
    |
330 |     continue_ctx: back::continue_forward::ContinueCtx,
    |                         ^^^^^^^^^^^^^^^^ could not find `continue_forward` in `back`

Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `naga` (lib) due to 3 previous errors
$ 
@jimblandy jimblandy added the naga Shader Translator label Jul 30, 2024
@jimblandy
Copy link
Member Author

The problem seems to be that, in naga/src/back/mod.rs, we have:

#[cfg(hlsl_out)]
pub mod hlsl;
...
#[cfg(any(feature = "hlsl-out", feature = "glsl-out"))]
mod continue_forward;

So the naga::back::hlsl is using the cfg_aliases aliases, but naga::back::continue_forward is using the old features.

jimblandy added a commit to jimblandy/wgpu that referenced this issue Jul 30, 2024
Rather than `feature = "blah"`, use the new `cfg` identifiers
introduced by the `cfg_aliases` invocation in `naga/build.rs` to
decide whether to compile the `naga::back::continue_forward` module,
which is only used by the GLSL and HLSL backends.

The `hlsl_out` `cfg` identifer has a more complex condition than just
`feature = "hlsl-out"`, introduced by gfx-rs#5919.

Fixes gfx-rs#6063.
jimblandy added a commit to jimblandy/wgpu that referenced this issue Jul 31, 2024
Rather than `feature = "blah"`, use the new `cfg` identifiers
introduced by the `cfg_aliases` invocation in `naga/build.rs` to
decide whether to compile the `naga::back::continue_forward` module,
which is only used by the GLSL and HLSL backends.

The `hlsl_out` `cfg` identifer has a more complex condition than just
`feature = "hlsl-out"`, introduced by gfx-rs#5919.

Fixes gfx-rs#6063.
jimblandy added a commit to jimblandy/wgpu that referenced this issue Jul 31, 2024
Rather than `feature = "blah"`, use the new `cfg` identifiers
introduced by the `cfg_aliases` invocation in `naga/build.rs` to
decide whether to compile the `naga::back::continue_forward` module,
which is only used by the GLSL and HLSL backends.

The `hlsl_out` `cfg` identifer has a more complex condition than just
`feature = "hlsl-out"`, introduced by gfx-rs#5919.

Fixes gfx-rs#6063.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
naga Shader Translator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant