Skip to content

build.zig.zon: Fix package hashes for Zig 0.14#4301

Merged
clason merged 1 commit intotree-sitter:masterfrom
JacobCrabill:bugfix/zig-14-pkg-hash
Mar 21, 2025
Merged

build.zig.zon: Fix package hashes for Zig 0.14#4301
clason merged 1 commit intotree-sitter:masterfrom
JacobCrabill:bugfix/zig-14-pkg-hash

Conversation

@JacobCrabill
Copy link
Contributor

Summary

Zig 0.14 changed how package hashes are computed and used, and if the old package hashes are left, every call to zig build will re-download every dependency every time (this also occurs with downstream packages that include tree-sitter in their build.zig.zon). Updating to the new hash format solves this.

Verification

To verify each package hash for yourself (as once a package is downloaded only the hash will be used to reference it), you can use the zig fetch command:

$ zig fetch https://github.com/bytecodealliance/wasmtime/releases/download/v29.0.1/wasmtime-v29.0.1-aarch64-android-c-api.tar.xz
N-V-__8AAC3KCQZMd5ea2CkcbjldaVqCT7BT_9_rLMId6V__

After downloading the tarball it will compute and print the package hash.

Zig 0.14 changed how package hashes are computed and used, and if the
old package hashes are left, every call to `zig build` will re-download
every package every time.  Updating to the new hash format solves this.
@clason clason merged commit e3db212 into tree-sitter:master Mar 21, 2025
13 checks passed
@clason
Copy link
Contributor

clason commented Mar 21, 2025

Thanks!

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.

2 participants