From f5ff3cf76b1875f1f6104a4d0032e2c85c6f1b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francis=20Gagn=C3=A9?= Date: Sun, 9 Feb 2025 20:08:36 -0500 Subject: [PATCH] lldb: Fix dependency cycle between `out` and `lib` outputs Remove the `lib` output, so that `/lib` goes to the `out` output instead. This fixes the following error: ERROR: noBrokenSymlinks: the symlink .../lib/python3.12/site-packages/lldb/lldb-argdumper points to a missing target .../bin/lldb-argdumper Fixes #380196 --- pkgs/development/compilers/llvm/common/lldb.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/llvm/common/lldb.nix b/pkgs/development/compilers/llvm/common/lldb.nix index f4a131c47620..40e61d874621 100644 --- a/pkgs/development/compilers/llvm/common/lldb.nix +++ b/pkgs/development/compilers/llvm/common/lldb.nix @@ -54,9 +54,10 @@ stdenv.mkDerivation (rec { src = src'; inherit patches; - # LLDB expects to find the path to `bin` relative to `lib` on Darwin. It can’t be patched with the location of - # the `lib` output because that would create a cycle between it and the `out` output. - outputs = [ "out" "dev" ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ "lib" ]; + # There is no `lib` output because some of the files in `$out/lib` depend on files in `$out/bin`. + # For example, `$out/lib/python3.12/site-packages/lldb/lldb-argdumper` is a symlink to `$out/bin/lldb-argdumper`. + # Also, LLDB expects to find the path to `bin` relative to `lib` on Darwin. + outputs = [ "out" "dev" ]; sourceRoot = lib.optional (lib.versionAtLeast release_version "13") "${src.name}/${pname}"; @@ -140,7 +141,7 @@ stdenv.mkDerivation (rec { ''; postInstall = '' - wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ + wrapProgram $out/bin/lldb --prefix PYTHONPATH : ''${!outputLib}/${python3.sitePackages}/ # Editor support # vscode: