Skip to content

Compilation breaks on latest revision #515

Closed

Description

@Makogan

Expected Behaviour

Compiling valid rustgpu code

Example & Steps To Reproduce

I have some shaders that used to compile on revision 2aa4d4f8a8ba73103501562cfca17b8163e5a887, On revision 08f98a7335ae7e2ac4ec9423a9b1acf9270f2a65 they no longer compile with this error.

    Caused by:
      process didn't exit successfully: `/home/makogan/.rustup/toolchains/nightly-2025-06-30-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names -Zcodegen-backend=/home/makogan/.cache/rust-gpu/codegen/https___github_com_Rust-GPU_rust-gpu_+08f98a73/librustc_codegen_spirv.so -Zbinary-dep-depinfo -Csymbol-mangling-version=v0 '-Zcrate-attr=feature(register_tool)' '-Zcrate-attr=register_tool(rust_gpu)' -Coverflow-checks=off -Cdebug-assertions=off -Zinline-mir=off -Zmir-enable-passes=-GVN -Zshare-generics=off '-Cllvm-args=--module-output=multiple --spirv-metadata=full' --target /home/makogan/.cache/rust-gpu/codegen/https___github_com_Rust-GPU_rust-gpu_+08f98a73/target-specs/spirv-unknown-vulkan1.2.json --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
      --- stderr
      error: error loading target specification: `unknown` os can only be used on particular targets; use `none` for bare-metal targets
        |
        = help: run `rustc --print target-list` for a list of built-in targets

    [2026-01-17T19:38:56Z ERROR cargo_gpu] build failed
    Error: build failed

Based on the error it seems like some type has been changed to use an option and it's not receiving the expected option.

System Info

rustc 1.94.0-nightly (c61a3a44d 2025-12-09)
arch linux
RTX 4070
SPIR-V 1.6 (under Vulkan 1.3 semantics) SPIR-V 1.6 (under Vulkan 1.4 semantics)

Activity

  1. changed the title [-](my bug report)[/-] [+]Compilation breaks on latest revision[/+] on Jan 17, 2026
  2. Makogan commented on Jan 17, 2026

    @Makogan
    Author

    A more recent commit that I can verify compiles is e97524f6b4816056b3edaa70c3e0e0c656392c05

  3. Firestar99 commented on Jan 17, 2026

    @Firestar99
    Member

    That error is caused by incorrect "target spec" aka target specification json files. This is something you as an end user shouldn't have to worry about, as spirv-builder and cargo-gpu will take care of that for you.

    Which begs the question: are you using cargo-gpu via the cmdline, cargo-gpu in a build script or spirv-builder directly? And if cargo-gpu, which version?

  4. Firestar99 commented on Jan 17, 2026

    @Firestar99
    Member

    We recently changed target spec handling, but it shouldn't have broken anything eg. for an older cargo-gpu version until we update target specs again: #484

    Both suggested working revs are before this PR was merged.

  5. Makogan commented on Jan 19, 2026

    @Makogan
    Author

    That error is caused by incorrect "target spec" aka target specification json files. This is something you as an end user shouldn't have to worry about, as spirv-builder and cargo-gpu will take care of that for you.

    Which begs the question: are you using cargo-gpu via the cmdline, cargo-gpu in a build script or spirv-builder directly? And if cargo-gpu, which version?

    I am invoking cargo gpu through the command interface of a rust program. I am using cargo-gpu 0.1.0

  6. Firestar99 commented on Jan 19, 2026

    @Firestar99
    Member

    Sorry, but I need the rev of cargo-gpu via cargo gpu show commitsh, cause it's build from the repo where every single one is version 0.1.0. And I don't think we have functionality to print the rev of the build. You can probably try to reinstall cargo-gpu from main and that may just fix it.

  7. Firestar99 commented on Jan 19, 2026

    @Firestar99
    Member

    No that's it: you need to install the new version of cargo-gpu.

    I've swapped the "support direction":
    An old version of cargo-gpu can't support rust-gpu versions after target-specs v3 cause it'll misinterpret the dependency structure and think it's like a rev from shortly after 0.9, giving it the wrong target specs.
    Instead, we made sure the newest version of cargo-gpu still supports building older rust-gpu versions, so people upgrading cargo-gpu can still build older projects and gradually update.
    (Apart from like a handful of revs just prior of 2025 edition, all contained within one PR, so there really shouldn't be anybody using those. Like you've more likely to run into issues with cargo update not respecting msrv yet in those old versions.)

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions