polkadot-sdk icon indicating copy to clipboard operation
polkadot-sdk copied to clipboard

Consider adding rust-toolchain.toml to the repo

Open nazar-pc opened this issue 1 year ago • 4 comments

I understand that you use nightly compiler (which version?) for formatting purposes and stable (which version?) for compilation.

When contributing it is somewhat painful to see huge number of warnings caused by project using different (older) version of the compiler.

rust-toolchain.toml will fix at least compilation warnings by ensuring everyone is using exactly the same version without digging into your GitLab pipelines trying to figure out what you happen to use for linting (today it happens to be 1.77.0).

nazar-pc avatar Aug 13 '24 08:08 nazar-pc

Yeah, when we switched to GHA we can do this switch. Basically the docker image could have the Rust version pre-installed, but the actual version is determined by the rust-toolchain.toml. This way we can bump the Rust version easily and the docker image could be updated later (to reduce CI time).

bkchr avatar Aug 13 '24 08:08 bkchr

It is still possible to use +nightly-whatever for formatting purposes, it just defines the default

nazar-pc avatar Aug 13 '24 08:08 nazar-pc

Just fyi, rust version can be found in the CI image name here For example, currently the image is docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v202407161507, where 1.77 is stable version and 2024-04-10 is nightly version

alvicsam avatar Aug 13 '24 09:08 alvicsam

Yep, that is exactly how I found it

nazar-pc avatar Aug 13 '24 09:08 nazar-pc

Hello folks, I'd like some advice on what would be needed in the rust-toolchain.toml file. I've made a basic example here in my PR, which will be used by the getting-started script, and I'm not familiar enough with the entire project's requirements.

Wolfenheimm avatar Aug 20 '24 14:08 Wolfenheimm

I suggest using PRR in the release pipeline if transitioning to GHA. PRR is specifically designed for releasing runtimes based on the Polkadot SDK and provides robust support for rust-toolchain.toml, unlike srtool. This is one of he reasons that I chose to abandon srtool and develop PRR instead.

  • https://github.com/chevdor/srtool-actions/pull/22
  • https://github.com/w3f/Grants-Program/blob/master/applications/polkadot-runtime-releaser.md
  • https://github.com/hack-ink/polkadot-runtime-releaser
  • https://github.com/hack-ink/polkadot-runtime-releaser-workshop

aurexav avatar Jan 10 '25 10:01 aurexav