Skip to content

Miri fails to prepare a sysroot (did not expect repo at $HOME to be bare) #16928

@V0ldek

Description

@V0ldek

I tried to run miri on an Ubuntu machine I haven't used miri on before. Installed the nightly toolchain, ran cargo +nightly miri run and received this:

I will run `"rustup" "component" "add" "rust-src"` to install the `rust-src` component for the selected toolchain. Proceed? [Y/n] Y
info: downloading component 'rust-src'
info: installing component 'rust-src'
Preparing a sysroot for Miri (target: x86_64-unknown-linux-gnu)... fatal error: failed to build sysroot: sysroot build failed; stderr:
error: failed to determine package fingerprint for build script for compiler_builtins v0.1.160 (/home/mat/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/compiler-builtins/compiler-builtins)

Caused by:
  failed to determine the most recently modified file in /home/mat/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/compiler-builtins/compiler-builtins

Caused by:
  failed to determine list of files in /home/mat/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/compiler-builtins/compiler-builtins

Caused by:
  did not expect repo at /home/mat to be bare

/home/mat is my $HOME directory. The /home/mat/.../compiler-builtins/compiler-builtins directory exists, I can ls it:

drwxrwxr-x  3 mat mat  4096 Apr 21 17:38 ./
drwxrwxr-x 12 mat mat  4096 Apr 21 17:38 ../
-rw-r--r--  1 mat mat 28266 Apr 21 17:38 build.rs
-rw-r--r--  1 mat mat  1912 Apr 21 17:38 Cargo.toml
-rw-r--r--  1 mat mat  6636 Apr 21 17:38 CHANGELOG.md
-rw-r--r--  1 mat mat  4206 Apr 21 17:38 configure.rs
-rw-r--r--  1 mat mat 10453 Apr 21 17:38 README.md
drwxrwxr-x  8 mat mat  4096 Apr 21 17:38 src/

My rustup and nightly are:

rustup +nightly -V
rustup 1.26.0 (2024-04-01)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.97.0-nightly (66da6cae1 2026-04-20)`

Not sure what other information would help in diagnosing this.

EDIT:
Not sure if this is relevant but my $HOME is not, in fact, a git repository at all 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-gitArea: anything dealing with gitC-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions