diff --git a/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/adapter.nix b/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/adapter.nix index 9f99b2e50a274..8847423527434 100644 --- a/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/adapter.nix +++ b/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/adapter.nix @@ -9,6 +9,16 @@ src, version, }: +let + # debugservers on macOS require the 'com.apple.security.cs.debugger' + # entitlement which nixpkgs' lldb-server does not yet provide; see + # for details + lldbServer = + if stdenv.hostPlatform.isDarwin then + "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver" + else + "${lldb.out}/bin/lldb-server"; +in rustPlatform.buildRustPackage { pname = "${pname}-adapter"; inherit version src; @@ -43,11 +53,13 @@ rustPlatform.buildRustPackage { cp -t $out/share/formatters formatters/*.py ln -s ${lib.getLib lldb} $out/share/lldb makeWrapper $out/share/adapter/codelldb $out/bin/codelldb \ - --set-default LLDB_DEBUGSERVER_PATH "${lldb.out}/bin/lldb-server" + --set-default LLDB_DEBUGSERVER_PATH "${lldbServer}" ''; patches = [ ./patches/adapter-output-shared_object.patch ]; # Tests are linked to liblldb but it is not available here. doCheck = false; + + passthru = { inherit lldbServer; }; } diff --git a/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/default.nix b/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/default.nix index 693aa5c329258..590c03c261152 100644 --- a/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/default.nix +++ b/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/default.nix @@ -64,14 +64,6 @@ let } ); - # debugservers on macOS require the 'com.apple.security.cs.debugger' - # entitlement which nixpkgs' lldb-server does not yet provide; see - # for details - lldbServer = - if stdenv.hostPlatform.isDarwin then - "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver" - else - "${lldb.out}/bin/lldb-server"; in stdenv.mkDerivation { pname = "vscode-extension-${publisher}-${pname}"; @@ -130,7 +122,7 @@ stdenv.mkDerivation { cp -t $ext/ -r ${adapter}/share/* wrapProgram $ext/adapter/codelldb \ --prefix LD_LIBRARY_PATH : "$ext/lldb/lib" \ - --set-default LLDB_DEBUGSERVER_PATH "${lldbServer}" + --set-default LLDB_DEBUGSERVER_PATH "${adapter.lldbServer}" # Mark that all components are installed. touch $ext/platform.ok @@ -153,7 +145,7 @@ stdenv.mkDerivation { description = "Native debugger extension for VSCode based on LLDB"; homepage = "https://github.com/vadimcn/vscode-lldb"; license = [ lib.licenses.mit ]; - maintainers = [ ]; + maintainers = [ lib.maintainers.r4v3n6101 ]; platforms = lib.platforms.all; }; }