cargo-dist icon indicating copy to clipboard operation
cargo-dist copied to clipboard

Step “host” fails in CI for rust edition 2024

Open jan-ferdinand opened this issue 10 months ago • 5 comments

When trying to create binaries using the fresh-off-the-press rust edition 2024, CI fails during step dist host. Apparently, the rust version in use is 1.84.1 (checksum 66221abde, release date 2024-11-19), which won't work for rust edition 2024. Could it be that the artifact that's loaded during step Install cached dist is out of date?

Locally, dist plan, dist build, and dist host all succeed.

jan-ferdinand avatar Feb 21 '25 07:02 jan-ferdinand

Same issue here. Easy fix for this is to manually specify toolchain in rust-toolchain.toml for your project, for instance as follows:

[toolchain]
channel = "1.85.0"

dkorunic avatar Feb 23 '25 10:02 dkorunic

Thanks, @dkorunic that fixed it for me https://github.com/mainmatter/rust-workshop-runner/pull/19/commits/5d54cc893d5c557ce50dcea25eb4a102d37afaec 👍🏻

graemer957 avatar Feb 23 '25 19:02 graemer957

manually specify toolchain in toolchain.toml

Minor detail: it's rust-toolchain.toml. (See also.) Thanks for the workaround. 🙂

jan-ferdinand avatar Feb 24 '25 14:02 jan-ferdinand

sadly the workaround is not suitable for me since I also depend on nightly for fuzzung, so creating overrides of overrides is just sad

gtema avatar Feb 24 '25 17:02 gtema

@gtema, you might be able to use a custom build step and the RUSTUP_TOOLCHAIN environment variable described here.

(See also this toy repo making use of a custom build step to set an environment variable (albeit a different one). The specifc places to look at are here and here. In this comment, I list a small number of gottchas when using dist's custom build steps.)

jan-ferdinand avatar Feb 24 '25 21:02 jan-ferdinand