Skip to content

spirv-std 0.8.0 & 0.9.0 fail to compile rustc-codegen-spirv #123

@Firestar99

Description

@Firestar99

cargo-gpu fails to compile spirv-std 0.8.0 & 0.9.0 with this error:

error: package `indexmap v2.12.0` cannot be built because it requires rustc 1.82 or newer, while the currently active rustc version is 1.70.0-nightly
Either upgrade to rustc 1.82 or newer, or use
cargo update -p [email protected] --precise ver
where `ver` is the latest version of `indexmap` supporting rustc 1.70.0-nightly

Cause

indexmap released version 2.12.0 (which cargo update automatically updates to) with the breaking change:

MSRV: Rust 1.82.0 or later is now required.

spirv-std 0.8.0 & 0.9.0 use a too old rustc version.

$ cargo tree -i [email protected]
indexmap v2.12.0
└── elsa v1.11.2
    └── spirt v0.2.0
        └── rustc_codegen_spirv v0.8.0
            └── rustc_codegen_spirv_dummy v0.1.0 (/home/firestar99/.cache/rust-gpu/codegen/0_8_0)

Resolution Options

Update spirv-std

Update spirv-std to 0.8.1 / 0.9.1 that fixes indexmap version to 0.11.4

Fix within cargo-gpu

We could add indexmap = "=0.11.4" to the rustc-codegen-spirv_dummy project that cargo-gpu creates to compile rustc-codegen-spirv. But that may break future rustc-codegen-spirv versions, so we need to limit it to old versions. Which is not super easy to detect, I could imagine somehow integrating it into the target_specs not detecting any target-specs being delivered, but it's kinda hacky.

Drop support for those old versions

I thought of redoing target_specs anyway to not have to distribute them as files but generate them on the fly. And potentially dropping all old versions to cleanup the cargo-gpu codebase a bit.

Lockfile support

Distribute rustc-codegen-spirv with a lockfile and use it, similarly to how cargo install --locked does it. May take more time to implement and may not be viable with older versions, haven't checked.

Pinging @schell @tombh @LegNeato @eddyb for opinions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions