Updating Zig 3rd party packages with the latest Git release

To the Zig team and users,

I wondered if there is a preferred way to update 3rd party packages to their latest Git release?

Perhaps there is a command to skip the cache during the build?

Currently I am performing the following (which I think is overkill but forces the 3rd party packages to be sourced directly):

cd ~/.cache/zig/p
rm -R *

cd ~/share/zig-projects/my_zig_project/
zig build

I then may need to update the hashes inside build.zig.zon (which I am fine with).
Then run “zig build” until all OK

Then the final build for rollout (to mirror production requirements):
zig build -Dtarget=x86_64-linux-gnu --release=small

I appreciate any help with this.

Andrew

Hello @andrew.keil Welcome to ziggit. :slight_smile:

build.zig.zon dependencies hash is the “source of truth” and the key to cache.

zig fetch --save url or a build without hash fields in build.zig.zon are some ways to update your dependencies.

3 Likes

Thanks for your response. I will experiment further and try to better understand the caching and association with build.zig.zon.

1 Like