#Fetched dependency is empty

1 messages · Page 1 of 1 (latest)

humble pond
#

I want to use a zig package (that I made) in another package, but when I try to add it as a dependency it is not being downloaded/unpacked properly.
Other things seem to download/unpack just fine (I can see them in ~/.cache/zig/p/) but for my link it somehow doesn't work (it creates an empty folder with hash 1220e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)

build.zig.zon:

.{
    .name = "something",
    .version = "0.0.1",
    .paths = .{
        "src",
    },
    .dependencies = .{
        .pdcurses_git = .{
            .url = "https://github.com/salo-dea/zig-pdcurses/archive/refs/tags/v0.0.1.tar.gz",
            .hash = "1220f23c70ebd7e432c66e7820915938fd7ea40d2fbaa866109b8c0ba1bbdfc50059",
            //the hash is not correct, but my understanding is that it should be fetched anyway
        },
    },
}

This is on linux with zig version 0.12.0-dev.1327+256ab68a9 (but I also have the same behaviour on windows)

rancid geyser
#

When you get the information about bad hash you should update the hash in your build.zig.zon and try again

humble pond
#

My understanding is that the bad hash doesn't prevent the fetching of the package, e.g. I replace the link with the official pdcurses release like so

        .pdcurses_git = .{
            //.url = "https://github.com/salo-dea/zig-pdcurses/archive/refs/tags/v0.0.1.tar.gz",
            .url = "https://github.com/wmcbrine/PDCurses/archive/refs/tags/3.9.tar.gz",
            .hash = "1220f23c70ebd7e432c66e7820915938fd7ea40d2fbaa866109b8c0ba1bbdfc50058",
        },

It informs me of the incorrect hash, but i still get a folder in zig/p that has content inside (with the correct hash as a name)

humble pond
#

I did some local test by using .url = "file:///home/a/b/c.tar.gz" and if I add some files into the archive in a subfolder, those are placed into the zig/p/<hash>/subdir

manic oxide
#

remove the hash field entirely and let zig fetch and report the correct hash

humble pond