diff --git a/nix/libghostty-vt.nix b/nix/libghostty-vt.nix index c6a78235b..eedc47e05 100644 --- a/nix/libghostty-vt.nix +++ b/nix/libghostty-vt.nix @@ -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 = [