With the new release of zig 0.16, I keep getting this error when trying to use a package I’ve fetched locally: error: failed to check cache: ‘zig-pkg/package_hash/src/root.zig’ file_hash FileNotFound.
Indeed, the file is not found in the zig-pkg directory. My question isn’t why I’m getting this error, but moreso how I’m meant to be achieving this functionality now.
For further context, I ran zig fetch –save ../local_path, but I also tried it zig fetch –save file:///tarbal.tar.gz and also just using the absolute path, and I hit this error every time.
What does the dependency end up looking like in your build.zig.zon? For local packages I use path instead of url + hash. I just tried using zig fetch --save for a local path and it failed with a different error: error: unable to copy directory '../../': Unexpected and didn’t even update the build.zig.zon. Using that path directly in build.zig.zon works fine.
I still personally would expect zig fetch to work with local paths, but maybe that doesn’t make sense since they aren’t being “fetched” in that situation.