Skip to content

Include *.rmeta files in stdlib sysroot glob - #3860

Merged
krasimirgg merged 2 commits into
bazelbuild:mainfrom
redsun82:fix-rmeta-sysroot-glob
Feb 23, 2026
Merged

Include *.rmeta files in stdlib sysroot glob#3860
krasimirgg merged 2 commits into
bazelbuild:mainfrom
redsun82:fix-rmeta-sysroot-glob

Conversation

@redsun82

Copy link
Copy Markdown
Contributor

Starting around nightly 2026-01-22 (rustc 1.95.0-nightly), the Rust distribution ships stdlib .rlib files as ~440-byte metadata stubs, with full metadata in separate .rmeta files alongside them. The _build_file_for_stdlib_template glob only includes *.rlib, so the .rmeta files are excluded from the sysroot, causing error[E0786]: only metadata stub found errors.

This PR adds *.rmeta to the glob.

Fixes #3859

Starting around nightly 2026-01-22, the Rust distribution ships stdlib
.rlib files as metadata stubs, with the full metadata in separate .rmeta
files. Add *.rmeta to the _build_file_for_stdlib_template glob so these
files are included in the Bazel sysroot.

Fixes bazelbuild#3859
@krasimirgg
krasimirgg self-requested a review February 23, 2026 09:33

@krasimirgg krasimirgg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you!

@krasimirgg
krasimirgg enabled auto-merge February 23, 2026 09:33
@krasimirgg
krasimirgg added this pull request to the merge queue Feb 23, 2026
Merged via the queue into bazelbuild:main with commit 5f633d2 Feb 23, 2026
2 checks passed
wfraser pushed a commit to dropbox/rules_rust that referenced this pull request Apr 2, 2026
Starting around nightly `2026-01-22` (rustc 1.95.0-nightly), the Rust
distribution ships stdlib `.rlib` files as ~440-byte metadata stubs,
with full metadata in separate `.rmeta` files alongside them. The
[`_build_file_for_stdlib_template`](https://github.com/bazelbuild/rules_rust/blob/42b098b3a891d7425212c39697e436a21fb5399e/rust/private/repository_utils.bzl#L275)
glob [only includes
`*.rlib`](https://github.com/bazelbuild/rules_rust/blob/42b098b3a891d7425212c39697e436a21fb5399e/rust/private/repository_utils.bzl#L280-L286),
so the `.rmeta` files are excluded from the sysroot, causing
`error[E0786]: only metadata stub found` errors.

This PR adds `*.rmeta` to the glob.

Fixes bazelbuild#3859

Co-authored-by: Krasimir Georgiev <krasimir@google.com>
(cherry picked from commit 5f633d2)
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.

Stdlib .rmeta files not included in sysroot glob, causing "only metadata stub found" errors with recent Rust nightlies

2 participants