libghostty-vt: fix dependency path resolution errors

Zigs build infra computes relatives paths to build-time executables that use `setCwd.`
The logic is purely lexical and doesn't take into account symlinks, unlike `chdir` that follows symlinks.

If the `cwd` resolves to a different depth, then the relative path becomes incorrect.
This commit is contained in:
Sander
2026-04-15 19:40:53 +01:00
parent 9df670cb55
commit d17e5517c7

View File

@@ -37,7 +37,23 @@ stdenv.mkDerivation (finalAttrs: {
);
};
deps = callPackage ../build.zig.zon.nix {name = "${finalAttrs.pname}-cache-${finalAttrs.version}";};
# Zig's build runner computes relative paths from `cwd` to the build directory.
# The logic is purely lexical, so if the `cwd` is a symlink that resolves to a different depth during `chdir`, the computed path becomes incorrect.
#
# See: https://codeberg.org/ziglang/zig/issues/32121
#
# Workaround: override `linkFarm` with a copy-farm so deps are real directories, not symlinks.
deps = callPackage ../build.zig.zon.nix {
name = "${finalAttrs.pname}-cache-${finalAttrs.version}";
linkFarm = name: entries:
runCommand name {} ''
mkdir -p $out
${lib.concatMapStringsSep "\n" (e: ''
cp -rL ${e.path} $out/${e.name}
'')
entries}
'';
};
nativeBuildInputs =
[