Skip to content

devenv: Install pinned nightly Rust toolchain via rustup#122

Open
cgwalters wants to merge 1 commit intobootc-dev:mainfrom
cgwalters:devenv-nightly
Open

devenv: Install pinned nightly Rust toolchain via rustup#122
cgwalters wants to merge 1 commit intobootc-dev:mainfrom
cgwalters:devenv-nightly

Conversation

@cgwalters
Copy link
Contributor

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)

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>
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 cargo fuzz. It also integrates Renovate to ensure that the nightly toolchain version is automatically kept up-to-date, improving maintainability and reducing manual intervention for dependency management.

Highlights

  • Pinned Rust Nightly Toolchain: Implemented the installation of a specific, pinned Rust nightly toolchain in the development environment, enabling access to features like cargo fuzz.
  • Renovate Integration for Nightly Updates: Configured Renovate to automatically track and bump the pinned Rust nightly toolchain version by introducing a custom datasource and manager rules.
  • Containerfile Updates: Modified Containerfile.c10s and Containerfile.debian to accept a rust_nightly argument, allowing for dynamic installation of the specified nightly toolchain.

🧠 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
  • devenv/Containerfile.c10s
    • Added an ARG for rust_nightly with a default pinned date.
    • Modified the install-rust.sh command to use the rust_nightly argument.
  • devenv/Containerfile.debian
    • Added an ARG for rust_nightly with a default pinned date.
    • Modified the install-rust.sh command to use the rust_nightly argument.
  • devenv/install-rust.sh
    • Implemented conditional logic to install a specified Rust nightly toolchain using rustup.
    • Created a symlink from the dated nightly toolchain to a generic nightly toolchain for easier access.
  • renovate-shared-config.json
    • Defined a new custom datasource rust-nightly to track Rust nightly releases from the official manifest.
    • Expanded customManagers regex for managerFilePatterns to match Containerfile and Dockerfile with various extensions.
    • Updated customManagers match strings to support versioning and a broader range of datasource names.
    • Added a versioning rule for custom.rust-nightly to use rust-release-channel.
Activity
  • No activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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}')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
ln -s "${rust_nightly}-${host}" "$RUSTUP_HOME/toolchains/nightly-${host}"
ln -sf "${rust_nightly}-${host}" "$RUSTUP_HOME/toolchains/nightly-${host}"

@cgwalters cgwalters requested a review from henrywang March 3, 2026 18:55
{
"customType": "regex",
"managerFilePatterns": ["(^|/)Containerfile$", "(^|/)Dockerfile$"],
"managerFilePatterns": ["(^|/)Containerfile(\\.[a-z0-9]+)?$", "(^|/)Dockerfile(\\.[a-z0-9]+)?$"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a conflict. I think "managerFilePatterns": ["/(^|/)Containerfile(\\.[^/]*)?$/", "/(^|/)Dockerfile(\\.[^/]*)?$/"] is a better one.
It uses proper regex delimiters with /(^|/)...$/ and [^/]*.

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

Successfully merging this pull request may close these issues.

2 participants