You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspecting the global cache shows that only one of the packages was downloaded, in this case zgl:
$ ls "$XDG_CACHE_HOME/zig/p"
12203782cb2501aa5fa88ce6ae488bcbdc86bf7cb002b641262bb0d897b1240aab50/
$ ls "$XDG_CACHE_HOME/zig/p/12203782cb2501aa5fa88ce6ae488bcbdc86bf7cb002b641262bb0d897b1240aab50"
binding.zig build.zig gyro.zzz LICENSE README.md types.zig zgl.zig
As such I am unable to depend on both zgl and zlm with the package manager, and have to fall back to using git submodules. I have tried clearing the local and global caches, adding the dependencies and building the zig project in every possible combination, adding the dependencies separately to two unique projects, but this problem persists.
Expected Behavior
zgl and zlm are hashed separately and can both be added as a dependency to the same project.
I can add other packages from git in the build.zig.zon just fine, it seems to be only these two packages with a duplicate hash.
The text was updated successfully, but these errors were encountered:
raddari
added
the
bug
Observed behavior contradicts documented or intended behavior
label
Sep 5, 2023
Why do all the hashes zig generates begin with 0x1220?
From what I recall, zig uses the multihash protocol - 0x12 means the hash is SHA2-256, and 0x20 means it is 32 bytes long.
I haven’t looked too deep into zig std to find where it calculates the hash for package dependencies, but I’m sure the answer to this issue is in there somewhere.
Zig Version
0.12.0-dev.278+0e8f130ae
Steps to Reproduce and Observed Behavior
With the following
build.zig.zon
, I add thezgl
dependency:Running
zig build
leads to the hash being generated, as expected:So I add this to
build.zig.zon
, andzig build
is successful.Now I want to add
zlm
, so I repeat the steps above:Something seems wrong; the expected hash is the same for both
zgl
andzlm
. If I add this to thebuild.zig.zon
, the build still succeeds.Inspecting the global cache shows that only one of the packages was downloaded, in this case
zgl
:As such I am unable to depend on both
zgl
andzlm
with the package manager, and have to fall back to using git submodules. I have tried clearing the local and global caches, adding the dependencies and building the zig project in every possible combination, adding the dependencies separately to two unique projects, but this problem persists.Expected Behavior
zgl
andzlm
are hashed separately and can both be added as a dependency to the same project.I can add other packages from git in the
build.zig.zon
just fine, it seems to be only these two packages with a duplicate hash.The text was updated successfully, but these errors were encountered: