Skip to content

nb install rustup fails with materialize failed: error.CopyFailed (revision double-counted in version) #354

Description

@Not-Nik

Installing rustup fails with the following error

==> Installing 1 package(s):
    rustup 1.29.0_2_2
==> Downloading + installing 1 packages...
nb: rustup: materialize failed: error.CopyFailed
    ✗ rustup (materialize failed)

Reproduce

nb install rustup

Environment is macOS 26.5.2, with no Homebrew installation left.

Rest is written by Claude

Cause

The revision is counted twice, so the computed keg version is wrong.

rustup's registry/upstream.json entry sets both:

"revision": 2,
"resolved": { "version": "1.29.0_2" }   // revision already baked in

effectiveVersion (src/api/formula.zig:33) appends it again: "1.29.0_2" + "_2""1.29.0_2_2". But the bottle's real keg dir is 1.29.0_2, so materialize cps a nonexistent path → CopyFailed. (The bottle's wrapper scripts also hardcode 1.29.0_2.)

buildPinnedFormula (src/main.zig:616) already avoids this by setting .revision = 0 when the version is pre-suffixed; the bottle-resolved path (src/upstream/github.zig:275) does not.

Fix

Either/both:

  1. Data: rustup's resolved.version should be "1.29.0" (base), leaving revision: 2 to add the suffix. Likely affects other homebrew_bottle entries with revision > 0.
  2. Code: make effectiveVersion idempotent — skip appending _<revision> if version already ends with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions