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

Use fixed version of Rust toolchain for releases #137

Open
patriknw opened this issue Jan 23, 2024 · 4 comments
Open

Use fixed version of Rust toolchain for releases #137

patriknw opened this issue Jan 23, 2024 · 4 comments

Comments

@patriknw
Copy link
Member

Reproducible builds of releases are important.

@huntc
Copy link
Contributor

huntc commented Jan 23, 2024

I’m unsure that this is required. Toolchain and compiler releases are backwards compatible and so releases should always be able to be rebuilt. You’d also have to persist the cargo lock file, which is generally not done for libs.

We already have a min Rust version enforced to help out here.

@huntc
Copy link
Contributor

huntc commented Jan 23, 2024

Actually, it appears that the advice of storing the lock file changed late last year (again?).

https://doc.rust-lang.org/cargo/faq.html#why-have-cargolock-in-version-control

This wouldn’t have prevented the toolchain being updated though. Clippy would still have complained, although you can ignore its warnings if needed.

@huntc
Copy link
Contributor

huntc commented Jan 23, 2024

I also just checked tokio, Axum and hyper, and none of them check in the lock file either. Pros and cons.

@huntc
Copy link
Contributor

huntc commented Jan 24, 2024

An additional consideration... when a binary is checked in that depends on various libraries, it does tend to include its lock file thereby achieving reproducible builds. I've also found myself pinning the toolchain on occasion, but this is less necessary. And, if needed, pinning can be retrospectively applied. In fact, the only time I've needed to pin the toolchain was when the compiler moved the MIPS32 target from being supported as a Tier 2, and so I needed an older one. Toolchains can be pinned using a rust-toolchain.toml file at the same level as Cargo.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants