devenv: Install pinned nightly Rust toolchain via rustup#122
devenv: Install pinned nightly Rust toolchain via rustup#122cgwalters wants to merge 1 commit intobootc-dev:mainfrom
Conversation
I want to start using `cargo fuzz`; it requires a nightly toolchain per https://rust-fuzz.github.io/book/cargo-fuzz/setup.html Pin to a version that gets renovate-bumped. (In the future I'd like to CI gate that our devenv works on some representative projects) Renovate is configured to track new nightlies via a custom datasource that reads the official Rust release manifest (manifests.txt), using the rust-release-channel versioning scheme. This is the same data source the upcoming native rust-version datasource will use (renovatebot/renovate#39529); once that merges this custom config can be replaced with zero-config native support. Tested: `podman run <image> cargo +nightly --version` succeeds in the resulting c10s container image. Assisted-by: OpenCode (Claude claude-opus-4-6) Signed-off-by: Colin Walters <walters@verbum.org>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the development environment by introducing support for a pinned Rust nightly toolchain. This change is crucial for utilizing features that require a nightly build, such as Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the installation of a pinned nightly Rust toolchain, managed by Renovate, by updating Containerfiles, modifying the Rust installation script, and configuring Renovate. No security vulnerabilities were found. However, a critical issue was identified: the default nightly version is set to a future date, which will cause container builds to fail. It is recommended to use a valid, existing nightly version. Additionally, suggestions have been provided to improve the robustness of the installation script.
|
|
||
| FROM base as rust | ||
| # renovate: datasource=custom.rust-nightly depName=rust-nightly versioning=rust-release-channel | ||
| ARG rust_nightly=nightly-2026-03-02 |
There was a problem hiding this comment.
The date 2026-03-02 is in the future. The rustup toolchain install command will fail because this nightly toolchain does not exist, which will break the container build. Please use a valid, existing nightly version to ensure the build works correctly before Renovate's first update.
ARG rust_nightly=nightly-2024-03-02
|
|
||
| FROM base as rust | ||
| # renovate: datasource=custom.rust-nightly depName=rust-nightly versioning=rust-release-channel | ||
| ARG rust_nightly=nightly-2026-03-02 |
There was a problem hiding this comment.
The date 2026-03-02 is in the future. The rustup toolchain install command will fail because this nightly toolchain does not exist, which will break the container build. Please use a valid, existing nightly version to ensure the build works correctly before Renovate's first update.
ARG rust_nightly=nightly-2024-03-02
| /usr/local/cargo/bin/rustup toolchain install "${rust_nightly}" --profile minimal | ||
| # Symlink the dated nightly as "nightly" so `cargo +nightly` works without | ||
| # requiring write access to RUSTUP_HOME for channel updates. | ||
| host=$(/usr/local/cargo/bin/rustc -vV | awk '/^host:/{print $2}') |
There was a problem hiding this comment.
Parsing the output of rustc -vV is brittle as its format is not guaranteed to be stable. A more robust way to get the host triple is to use rustc --print target-triple, which is designed for programmatic use.
| host=$(/usr/local/cargo/bin/rustc -vV | awk '/^host:/{print $2}') | |
| host=$(/usr/local/cargo/bin/rustc --print target-triple) |
| # Symlink the dated nightly as "nightly" so `cargo +nightly` works without | ||
| # requiring write access to RUSTUP_HOME for channel updates. | ||
| host=$(/usr/local/cargo/bin/rustc -vV | awk '/^host:/{print $2}') | ||
| ln -s "${rust_nightly}-${host}" "$RUSTUP_HOME/toolchains/nightly-${host}" |
There was a problem hiding this comment.
It's good practice to use ln -sf to create symbolic links in scripts. The -f (force) option will overwrite the destination file if it already exists. This makes the script more robust and idempotent, preventing errors if it's run multiple times or if a nightly symlink already exists for some reason.
| ln -s "${rust_nightly}-${host}" "$RUSTUP_HOME/toolchains/nightly-${host}" | |
| ln -sf "${rust_nightly}-${host}" "$RUSTUP_HOME/toolchains/nightly-${host}" |
| { | ||
| "customType": "regex", | ||
| "managerFilePatterns": ["(^|/)Containerfile$", "(^|/)Dockerfile$"], | ||
| "managerFilePatterns": ["(^|/)Containerfile(\\.[a-z0-9]+)?$", "(^|/)Dockerfile(\\.[a-z0-9]+)?$"], |
There was a problem hiding this comment.
There's a conflict. I think "managerFilePatterns": ["/(^|/)Containerfile(\\.[^/]*)?$/", "/(^|/)Dockerfile(\\.[^/]*)?$/"] is a better one.
It uses proper regex delimiters with /(^|/)...$/ and [^/]*.
I want to start using
cargo fuzz; it requires a nightly toolchain per https://rust-fuzz.github.io/book/cargo-fuzz/setup.htmlPin to a version that gets renovate-bumped.
(In the future I'd like to CI gate that our devenv works on
some representative projects)
Renovate is configured to track new nightlies via a custom datasource that reads the official Rust release manifest (manifests.txt), using the rust-release-channel versioning scheme. This is the same data source the upcoming native rust-version datasource will use (renovatebot/renovate#39529); once that merges this custom config can be replaced with zero-config native support.
Tested:
podman run <image> cargo +nightly --versionsucceeds in the resulting c10s container image.Assisted-by: OpenCode (Claude claude-opus-4-6)