mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-24 05:40:15 +00:00
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:
@@ -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 =
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user