Today I started a new project, but I got an invalid fingerprint:
zig build test
/home/manlio/src/zig/src/codeberg.org/manliop/build.zig.zon:1:2: error: invalid fingerprint: 0x163159c8b695f8c6; if this is a new or forked package, use this value: 0x7ec30896471f0bb7
.{
Part of the fingerprint is a checksum of the package name, so if the name changes it invalidates the fingerprint.
The rest of the fingerprint is random.
When a fingerprint is invalid, or missing; zig provides a new, valid, fingerprint you could use.
It is very important that when you make forks you update the fingerprint, even if the name is the same. If you donβt do that then you would be impersonating the original.
I want to jump in into this topic as I keep getting invalid fingerprint on my new project. Whenever I use the fingerprint that zig provide from the error, I keep getting invalid fingerprint and zig decide to give a different fingerprint. Is there something that I miss?
Oh never mind. It turns out the invalid fingerprint coming from the dependency package that I just changed its name without updating the fingerprint. However, the error is very misleading that I thought the generated fingerprint is for the new project not the dependency package
Ah you are right. I just reproduce the error and did not notice that it tells which dependency causing the error. I missed the hint because the dependency and new project name have quite similar naming. Thanks for pointing that out!