Skip to content

Bazel: Update Rust toolchain to nightly/2026-01-22 and rules_rust to 0.68.1.codeql.1 - #21343

Merged
redsun82 merged 3 commits into
mainfrom
redsun82/update-rust-toolchain
Feb 19, 2026
Merged

Bazel: Update Rust toolchain to nightly/2026-01-22 and rules_rust to 0.68.1.codeql.1#21343
redsun82 merged 3 commits into
mainfrom
redsun82/update-rust-toolchain

Conversation

@redsun82

@redsun82redsun82 commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Update the Rust nightly toolchain from nightly/2025-08-01 to nightly/2026-01-22 (rustc 1.95.0-nightly), and rules_rust from 0.66.0 to 0.68.1.codeql.1.

rules_rust patch

The new Rust nightly changed how stdlib metadata is distributed: .rlib files now contain only a ~440-byte metadata stub, with full metadata in separate .rmeta files. rules_rust's stdlib glob in repository_utils.bzl doesn't include *.rmeta, causing:

error[E0786]: found invalid metadata files for crate `core`
= note: only metadata stub found for rlib dependency `core`

This is patched via a custom registry entry (0.68.1.codeql.1) that adds *.rmeta to the stdlib glob.
Upstream bug: bazelbuild/rules_rust#3859

Changes

  • MODULE.bazel: rules_rust0.66.00.68.1.codeql.1, RUST_VERSIONnightly/2025-08-01nightly/2026-01-22, updated sha256s
  • rust/ql/test/rust-toolchain.toml: stable channel 1.901.93
  • rust/extractor/src/nightly-toolchain/rust-toolchain.toml: nightly-2025-06-01nightly-2026-01-22
  • misc/bazel/registry/modules/rules_rust/: new 0.68.1.codeql.1 registry entry with include_rmeta_in_stdlib.patch

…0.68.1.codeql.1
Update the Rust nightly toolchain from nightly/2025-08-01 to nightly/2026-01-22
(rustc 1.95.0-nightly), and rules_rust from 0.66.0 to 0.68.1.codeql.1.
The new nightly changed how stdlib metadata is distributed: .rlib files now
contain only a metadata stub, with full metadata in separate .rmeta files.
rules_rust's stdlib glob doesn't include *.rmeta, causing 'only metadata stub
found' errors. This is patched via a custom registry entry (0.68.1.codeql.1).
Upstream bug: bazelbuild/rules_rust#3859
CopilotAI review requested due to automatic review settings February 18, 2026 11:23
@redsun82
redsun82 requested review from a team as code ownersFebruary 18, 2026 11:23
@github-actionsgithub-actionsBot added the Rust Pull requests that update Rust code label Feb 18, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the Bazel Rust toolchain and rules_rust dependency to align the repo with a newer Rust nightly, including a local rules_rust registry override to handle Rust’s new .rmeta stdlib metadata distribution.

Changes:

  • Bump Bazel rules_rust to 0.68.1.codeql.1 and Rust nightly toolchain to nightly/2026-01-22, including updated toolchain sha256s.
  • Update the Rust stable toolchain used by Rust QL extractor tests from 1.90 to 1.93.
  • Add an in-repo Bazel module registry entry for rules_rust@0.68.1.codeql.1 that patches stdlib globs to include *.rmeta.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
MODULE.bazelUpdates rules_rust dep, Rust nightly version, and toolchain sha256s.
rust/ql/test/rust-toolchain.tomlBumps stable Rust channel used in Rust extractor QL tests.
rust/extractor/src/nightly-toolchain/rust-toolchain.tomlBumps extractor nightly rustup toolchain date.
misc/bazel/registry/modules/rules_rust/metadata.jsonAdds registry metadata for the custom rules_rust module entry.
misc/bazel/registry/modules/rules_rust/0.68.1.codeql.1/source.jsonPoints at upstream rules_rust-0.68.1 tarball and applies the local patch.
misc/bazel/registry/modules/rules_rust/0.68.1.codeql.1/patches/include_rmeta_in_stdlib.patchExtends stdlib glob to include *.rmeta to avoid invalid metadata errors.
misc/bazel/registry/modules/rules_rust/0.68.1.codeql.1/MODULE.bazelDefines the module metadata/deps for the custom rules_rust version.

paldepind
paldepind previously approved these changes Feb 18, 2026

@paldepindpaldepind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! LGTM, there are some CI failures but they seem to only be some expected files that need updating.

@redsun82

redsun82 commented Feb 18, 2026

Copy link
Copy Markdown
ContributorAuthor

@paldepind there are also some extraction failures (e.g. rust/ql/test/query-tests/security/CWE-825 plus others) in the test runs, it's not just test expectation changes: could you take it from here?

@redsun82

Copy link
Copy Markdown
ContributorAuthor

@paldepind ah wait, the test errors and changes are from the changes to the rust-toolchain files used in testing. That can be done as follow-up (I'll leave that to you). Reverting the rust-toolchain.toml changes here should have a green CI 👍

@paldepind

paldepind commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

I see. Yes, I'll take a look at it.

@github-actionsgithub-actionsBot removed the Rust Pull requests that update Rust code label Feb 18, 2026
@redsun82

Copy link
Copy Markdown
ContributorAuthor

@paldepind ah, there were some test changes. Nothing too scary as it seems to me.

@paldepindpaldepind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! No changes to the expected files after reverting the version change in rust/ql/test/rust-toolchain.toml.

Thanks for doing this 🙏

@redsun82
redsun82 merged commit 6e8f43c into mainFeb 19, 2026
79 checks passed
@redsun82
redsun82 deleted the redsun82/update-rust-toolchain branch February 19, 2026 08:40
@githubgithub deleted a comment from martin28rt-aiFeb 20, 2026
Sign up for freeto 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.

3 participants

@redsun82@paldepind