Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zig build --fetch doesn't fetch transitive dependencies #20976

Open
mitchellh opened this issue Aug 7, 2024 · 1 comment
Open

zig build --fetch doesn't fetch transitive dependencies #20976

mitchellh opened this issue Aug 7, 2024 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@mitchellh
Copy link
Sponsor Contributor

mitchellh commented Aug 7, 2024

Zig Version

0.13.0

Steps to Reproduce and Observed Behavior

All maintainers of Zig should have access to Ghostty, so this reproduction uses Ghostty source:

With https://github.com/ghostty-org/ghostty/commit/59e226154c413a03b41b37ed8ec6c61193b340bd:

$ rm -rfv ~/.cache/zig
$ zig build --fetch # INTERNET ENABLED HERE
$ zig build # DISABLED INTERNET FOR THIS STEP
/home/x/.cache/zig/p/12207f53d7dddd3e5ca6577fcdd137dcf1fa32c9f22cbb0911ad0701cde4095a1c4c/build.zig.zon:7:20: error: unable to discover remote git server capabilities: TemporaryNameServerFailure
            .url = "git+https://github.com/zigimg/zigimg#3a667bdb3d7f0955a5a51c8468eac83210c1439e",
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/x/.cache/zig/p/12207f53d7dddd3e5ca6577fcdd137dcf1fa32c9f22cbb0911ad0701cde4095a1c4c/build.zig.zon:20:20: error: unable to discover remote git server capabilities: TemporaryNameServerFailure
            .url = "git+https://github.com/mitchellh/libxev#f6a672a78436d8efee1aa847a43a900ad773618b",
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you check out an earlier commit https://github.com/ghostty-org/ghostty/commit/8211e7e83af26406fd451afef03b9c6e2bb5017d this works fine. The difference is that the commit that broke it introduces a dependency with transitive dependencies.

This use case is important to enable sandboxed builds in Nix.

Expected Behavior

This should work and allow builds without internet access.

@mitchellh mitchellh added the bug Observed behavior contradicts documented or intended behavior label Aug 7, 2024
@mlugg mlugg added the zig build system std.Build, the build runner, `zig build` subcommand, package management label Aug 7, 2024
@mlugg mlugg added this to the 0.14.0 milestone Aug 7, 2024
@rohlem
Copy link
Contributor

rohlem commented Aug 7, 2024

Related to #20716, although that one doesn't mention the --fetch flag - not sure whether the behavior should be different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

No branches or pull requests

3 participants