Hi Benjamin,

On Thu, Jan 02 2025, Benjamin Slade wrote:
> I've got the start of a Guix package build for the new [Ghostty
> terminal emulator], but it gets stuck when the zig-build tries fetch
> some dependencies, with what I think is a DNS (!) issue:

Guix builds happen in a container which does not have access to the
network. Thus, you do have a DNS issues, but it's not one you can
resolve within a Guix package build.

Looking at the Ghostty documentation, their main build is with Nix,
which has the same network restriction, so that's a good sign that this
can be made to work. Looking at their PACKAGING.md[1], it says that the
only step which requires an internet connection is running this command:

--8<---------------cut here---------------start------------->8---
./nix/build-support/fetch-zig-cache.sh
--8<---------------cut here---------------end--------------->8---

Looking in that script[2], it basically just runs "zig build --fetch",
with some extra work to fetch some other dependencies. I'm not familiar
with Zig builds, but looking at build.zig.zon[3] it seems to list the
required dependencies.

To get a Guix package building you may need to package these
dependencies, and then provide them as inputs to your Ghostty package.
I'm not sure whether the Zig build system is set up to handle this
properly. I couldn't find any examples of Zig packages with Zig
dependencies, but I didn't try very hard.

I hope that helps,

Carlo

[1]: 
https://github.com/ghostty-org/ghostty/blob/e2f9eb6a6f4dc2108f91293938374c0ed314dcb8/PACKAGING.md
[2]: 
https://github.com/ghostty-org/ghostty/blob/e2f9eb6a6f4dc2108f91293938374c0ed314dcb8/nix/build-support/fetch-zig-cache.sh
[3]: 
https://github.com/ghostty-org/ghostty/blob/e2f9eb6a6f4dc2108f91293938374c0ed314dcb8/build.zig.zon

Reply via email to