Skip to content

rust: local output bases record a rustix rlib whose hash differs from its rmeta #14705

Open

Description

@TrapsterDK

Local Linux x86_64 builds of //cli/cli:dx fail at dx_upstream (cli/cli/BUILD.bazel:113):

error: crate `rustix` required to be available in rlib format, but was not found in this form

This has happened in three slots so far. Moving the disk cache aside does not help, and neither does --noremote_accept_cached.

What a broken slot shows: the rustix .rlib carries crate hash 8c0973… but its .rmeta carries 2fd999…. Every dependent crate was compiled against the .rmeta. The action key is the same as on main, but the slot's local action cache maps it to the wrong .rlib. Rustc runs unsandboxed. With pipelining turned off, main fails with .rmeta is not writeable.

The likely trigger is switching pipelining on and off in the same output base, so that the metadata action and the full action write the same paths out of step.

To recover a slot:

  1. Delete bazel-out/k8-fastbuild/bin/external/+crate+dx_crates__rustix-1.1.4.
  2. Build with --nouse_action_cache.
  3. Run bazel shutdown, then do a plain build.

Fix: find which flag or config toggles pipelining or the rustc strategy between builds, and make the two outputs always come from one consistent action. Then add a check that the .rlib and .rmeta crate hashes match for a pipelined crate.

🤖 Generated with Claude Code

Activity

  1. added
    local
    on Nov 22, 2026
  2. TrapsterDK commented on Nov 23, 2026

    @TrapsterDK
    CollaboratorAuthor

    More data:

    • A worker found the bad rustix rlib in the local --disk_cache (~/.cache/bazel-disk). The rlib's crate hash didn't match its rmeta. Deleting that one entry fixed Rust builds in that slot.
    • Another worker saw the mismatch again with --noremote_accept_cached. So the local disk cache is the likely source, not the remote cache.
    • Building rustix alone with no caches gives a matching rlib and rmeta. So rustc is fine, and a cache stores the rlib and rmeta from two different builds.

    A fix should make a cached rlib/rmeta pair impossible to mix. One way is to key both outputs on one action, or to check that their hashes match on download.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    local

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions