I’m trying to include licenses / readmes from my dependencies in my project, as well as bundle dependency source code with my releases to comply with copyleft licenses (Im statically compiling to a lone executable). However, some of my dependencies exclude their readme/license from their build.zig.zon paths field. Is there any way to fetch a complete repository, ignoring the build.zig.zon paths variable? (or should I file an issue with the dependency in question…)

Cloudef July 10, 2026, 9:52am 2

I believe the paths field is used when zig recompresses the dep into cache. So it should include the LICENSE as well.

castholm July 10, 2026, 10:48am 3

paths should include any and all licenses, so this can definitely be considered an issue with the package itself and should be fixed upstream. Don’t just take my word for it, the default zig init output also agrees:

Specifies the set of files and directories that are included in this package. Only files and directories listed here are included in the hash that is computed for this package. Only files listed here will remain on disk when using the zig package manager. As a rule of thumb, one should list files required for compilation plus any license(s).

Paths are relative to the build root. Use the empty string ("") to refer to the build root itself.

A directory listed here means that all files within, recursively, are included.

.paths = .{
    "build.zig",
    "build.zig.zon",
    "src",
    // For example...
    //"LICENSE",
    //"README.md",
},

zig fetch is intended to be able to be used as a way to archive packages for offline access, and the idea is that you should be able to download packages you care about and store them on a USB stick or network drive or similar for the future. Not including the licenses in paths would mean that such copies of your package won’t include the information necessary to help your consumers fulfill license reproduction and attribution requirements.

(As an aside, you might be interested in knowing that the core team have thrown around the idea of declaring license information in the build.zig.zon manifest and having the package manager track their compatibility to a certain extent: package management: add opt-in source code license compatibility checking · Issue #14342 · ziglang/zig · GitHub)