Skip to content

Commit e847c0e

Browse files
authored
Merge pull request #173 from nix-community/update-vadimcn-vscodelldb
Update `vadimcn.vscodelldb`: v1.11.8 -> v1.12.1
2 parents f55451e + dc44b6a commit e847c0e

File tree

7 files changed

+109
-122
lines changed

7 files changed

+109
-122
lines changed

extensions/vadimcn/vscode-lldb/latest/adapter.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ let
2121
else
2222
"${lib.getBin lldb}/bin/lldb-server";
2323
LLVM_TRIPLE = stdenv.buildPlatform.rust.rustcTarget;
24-
DYLIB_SUFFIX = if stdenv.hostPlatform.isDarwin then ".dylib" else ".so";
2524
in
2625
rustPlatform.buildRustPackage {
2726
pname = "${pname}-adapter";
@@ -33,10 +32,8 @@ rustPlatform.buildRustPackage {
3332
# The LLDB_* variables are used in adapter/lldb/build.rs.
3433
"CC_${LLVM_TRIPLE}" = "${stdenv.cc}/bin/cc";
3534
"CXX_${LLVM_TRIPLE}" = "${stdenv.cc}/bin/c++";
35+
LLDB_DYLIB = "${lib.getLib lldb}/lib/liblldb${stdenv.hostPlatform.extensions.sharedLibrary}";
3636
LLDB_INCLUDE = "${lib.getDev lldb}/include";
37-
LLDB_LINK_LIB = "lldb";
38-
LLDB_LINK_SEARCH = "${lib.getLib lldb}/lib";
39-
LLDB_DYLIB = "${lib.getLib lldb}/lib/liblldb${DYLIB_SUFFIX}";
4037

4138
nativeBuildInputs = [ makeWrapper ];
4239

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
makeBinaryWrapper,
3+
rustPlatform,
4+
pname,
5+
src,
6+
version,
7+
8+
cargoHash,
9+
}:
10+
rustPlatform.buildRustPackage {
11+
pname = "${pname}-codelldb-launch";
12+
inherit version src cargoHash;
13+
14+
nativeBuildInputs = [ makeBinaryWrapper ];
15+
16+
cargoBuildFlags = [
17+
"--package=codelldb-launch"
18+
];
19+
20+
# Tests fail to build (as of version 1.12.0).
21+
doCheck = false;
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
makeWrapper,
3+
rustPlatform,
4+
pname,
5+
src,
6+
version,
7+
8+
cargoHash,
9+
}:
10+
rustPlatform.buildRustPackage {
11+
pname = "${pname}-codelldb-types";
12+
inherit version src cargoHash;
13+
14+
nativeBuildInputs = [ makeWrapper ];
15+
16+
cargoBuildFlags = [
17+
"--package=codelldb-types"
18+
];
19+
20+
# Tests fail to build (as of version 1.12.0).
21+
doCheck = false;
22+
}

extensions/vadimcn/vscode-lldb/latest/default.nix

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Original implementation: https://github.com/NixOS/nixpkgs/pull/383013
2-
# After merging should be in https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb
1+
# Based on https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/default.nix
32
{
43
callPackage,
54
cargo,
@@ -21,15 +20,16 @@
2120
}:
2221
assert lib.versionAtLeast python3.version "3.5";
2322
let
24-
supportedVersion = "1.11.8";
23+
supportedVersion = "1.12.1";
24+
extFullName = "${mktplcRef.publisher}.${mktplcRef.name}";
2525
in
2626
assert lib.asserts.assertMsg (mktplcRef.version == supportedVersion) ''
27-
The version `${mktplcRef.version}` of `vadimcn.vscode-lldb` is not supported.
27+
The version `${mktplcRef.version}` of `${extFullName}` is not supported.
2828
2929
Only the version `${supportedVersion}` is supported.
3030
31-
Try `extensions.${stdenv.hostPlatform.system}.vscode-marketplace-universal.vadimcn.vscode-lldb`
32-
or `extensions.${stdenv.hostPlatform.system}.open-vsx-universal.vadimcn.vscode-lldb`.
31+
Try `extensions.${stdenv.hostPlatform.system}.vscode-marketplace-universal.${extFullName}`
32+
or `extensions.${stdenv.hostPlatform.system}.open-vsx-universal.${extFullName}`.
3333
'';
3434
let
3535
inherit (mktplcRef) publisher version;
@@ -46,25 +46,25 @@ let
4646

4747
# Get the hash of a source code in a release (https://github.com/vadimcn/codelldb/releases)
4848
#
49-
# nix-repl> rev = "1.11.8"
49+
# nix-repl> rev = "1.12.1"
5050
# nix-repl> src = pkgs.fetchFromGitHub { owner = "vadimcn"; repo = "codelldb"; rev = "v${rev}"; hash = ""; }
5151
# nix-repl> :b src
5252
#
5353
# Write here the hash that you `got:`.
54-
hash = "sha256-mal3hhf+nri8/2Y0wjfBhnMuGVwM3i0JswxT+ttTm7E=";
54+
hash = "sha256-B8iCy4NXG7IzJVncbYm5VoAMfhMfxGF+HW7M5sVn5b0=";
5555

5656
# Write here the hash from above.
57-
# nix-repl> src = pkgs.fetchFromGitHub { owner = "vadimcn"; repo = "codelldb"; rev = "v${rev}"; hash = "sha256-mal3hhf+nri8/2Y0wjfBhnMuGVwM3i0JswxT+ttTm7E="; }
57+
# nix-repl> src = pkgs.fetchFromGitHub { owner = "vadimcn"; repo = "codelldb"; rev = "v${rev}"; hash = "sha256-B8iCy4NXG7IzJVncbYm5VoAMfhMfxGF+HW7M5sVn5b0="; }
5858

5959
# nix-repl> :b pkgs.rustPlatform.buildRustPackage { cargoHash = ""; name = "dummy"; inherit src; useFetchCargoVendor = true; }
6060
#
6161
# Write here the hash that you `got:`.
62-
cargoHash = "sha256-sRqL629+mqvGyNkxpsYd/Kb3AyuysomN0JDR9zKwCO0=";
62+
cargoHash = "sha256-fuUTLdavMiYfpyxctXes2GJCsNZd5g1d4B/v+W/Rnu8=";
6363

6464
# nix-repl> :b pkgs.buildNpmPackage { npmDepsHash = ""; name = "dummy"; inherit src; dontNpmBuild = true; }
6565
#
6666
# Write here the hash that you `got:`.
67-
npmDepsHash = "sha256-cS7Fr4mrq0QIPFtG5VjLEOOiC2QuVDW+Ispt2LmI258=";
67+
npmDepsHash = "sha256-TCeIBrlsNuphW2gVsX97+Wu1lOG5gDwS7559YA1d10M=";
6868

6969
src = fetchFromGitHub {
7070
owner = "vadimcn";
@@ -74,23 +74,23 @@ let
7474
};
7575

7676
lldb = llvmPackages_19.lldb;
77+
stdenv = llvmPackages_19.libcxxStdenv;
7778

7879
adapter = (
7980
callPackage ./adapter.nix {
8081
# The adapter is meant to be compiled with clang++,
8182
# based on the provided CMake toolchain files.
8283
# <https://github.com/vadimcn/codelldb/tree/master/cmake>
8384
rustPlatform = makeRustPlatform {
84-
stdenv = llvmPackages_19.libcxxStdenv;
85-
inherit cargo rustc;
85+
inherit stdenv cargo rustc;
8686
};
87-
stdenv = llvmPackages_19.libcxxStdenv;
8887

8988
inherit
9089
pname
9190
src
9291
version
9392
cargoHash
93+
stdenv
9494
;
9595
}
9696
);
@@ -107,13 +107,31 @@ let
107107
);
108108

109109
codelldb-types = (
110-
callPackage ./lldb-types.nix {
110+
callPackage ./codelldb-types.nix {
111+
rustPlatform = makeRustPlatform {
112+
inherit stdenv cargo rustc;
113+
};
114+
115+
inherit
116+
pname
117+
src
118+
version
119+
cargoHash
120+
;
121+
}
122+
);
123+
124+
codelldb-launch = (
125+
callPackage ./codelldb-launch.nix {
126+
rustPlatform = makeRustPlatform {
127+
inherit stdenv cargo rustc;
128+
};
129+
111130
inherit
112131
pname
113132
src
114133
version
115134
cargoHash
116-
nodeDeps
117135
;
118136
}
119137
);
@@ -132,10 +150,11 @@ lib.customisation.makeOverridable stdenv.mkDerivation {
132150

133151
nativeBuildInputs = [
134152
cmake
135-
cargo
136153
makeWrapper
137154
nodejs
138155
unzip
156+
codelldb-types
157+
codelldb-launch
139158
];
140159

141160
patches = [ ./patches/cmake-build-extension-only.patch ];
@@ -147,14 +166,6 @@ lib.customisation.makeOverridable stdenv.mkDerivation {
147166

148167
postConfigure = ''
149168
cp -r ${nodeDeps}/lib/node_modules .
150-
151-
# Copy pre-built package.json and generated types from codelldb-types
152-
cp ${codelldb-types}/package.json .
153-
mkdir -p generated
154-
cp -r ${codelldb-types}/generated/* generated/
155-
156-
# Touch the files to ensure they're newer than dependencies
157-
touch package.json generated/codelldb.ts
158169
''
159170
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
160171
export HOME="$TMPDIR/home"
@@ -183,6 +194,11 @@ lib.customisation.makeOverridable stdenv.mkDerivation {
183194
wrapProgram $ext/adapter/codelldb \
184195
--prefix LD_LIBRARY_PATH : "$ext/lldb/lib" \
185196
--set-default LLDB_DEBUGSERVER_PATH "${adapter.lldbServer}"
197+
198+
# Used by VSCode
199+
mkdir -p $ext/bin
200+
cp ${codelldb-launch}/bin/codelldb-launch $ext/bin/codelldb-launch
201+
186202
# Mark that all components are installed.
187203
touch $ext/platform.ok
188204
@@ -197,15 +213,15 @@ lib.customisation.makeOverridable stdenv.mkDerivation {
197213
'';
198214

199215
passthru = {
200-
inherit lldb adapter codelldb-types;
216+
inherit lldb adapter;
201217
updateScript = ./update.sh;
202218
};
203219

204220
meta = {
205221
description = "Native debugger extension for VSCode based on LLDB";
206222
homepage = "https://github.com/vadimcn/vscode-lldb";
207223
license = [ lib.licenses.mit ];
208-
maintainers = [ lib.maintainers.r4v3n6101 ];
224+
maintainers = [ ];
209225
platforms = lib.platforms.all;
210226
};
211227
}

extensions/vadimcn/vscode-lldb/latest/lldb-types.nix

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 215dd3c..0409d03 100644
2+
index 3e4f955..2ca59d0 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
55
@@ -16,13 +16,6 @@ endif()
@@ -15,54 +15,42 @@ index 215dd3c..0409d03 100644
1515
-
1616
set(CMAKE_CTEST_ARGUMENTS "--output-on-failure" CACHE INTERNAL "CTest arguments")
1717

18-
if (CMAKE_SYSROOT)
19-
@@ -121,30 +114,9 @@ configure_file(webpack.config.mjs ${CMAKE_CURRENT_BINARY_DIR}/webpack.config.mjs
20-
configure_file(vscode.test.mjs ${CMAKE_CURRENT_BINARY_DIR}/.vscode-test.mjs)
21-
22-
set(PLATFORM_PACKAGE_URL "https://github.com/vadimcn/codelldb/releases/download/v\${version}/\${platformPackage}" CACHE STRING "")
23-
-configure_file(package.json ${CMAKE_CURRENT_BINARY_DIR}/package.json @ONLY)
24-
-# We still need to resolve codelldb schema $ref's in it, but we'll do this during the build.
25-
-file(COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/package.json ${CMAKE_CURRENT_BINARY_DIR}/package.pre.json)
26-
-file(COPY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json ${CMAKE_CURRENT_BINARY_DIR}/package-lock.json)
18+
set(TEST_TIMEOUT 5000 CACHE STRING "Test timeout [ms]")
19+
@@ -120,12 +113,6 @@ configure_file(package.json ${CMAKE_CURRENT_BINARY_DIR}/package.json @ONLY)
20+
# We still need to resolve codelldb schema $ref's in it, but we'll do this during the build.
21+
file(COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/package.json ${CMAKE_CURRENT_BINARY_DIR}/package.pre.json)
22+
file(COPY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json ${CMAKE_CURRENT_BINARY_DIR}/package-lock.json)
2723
-# Install node_modules
2824
-execute_process(
2925
- COMMAND ${NPM} install
3026
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
3127
- COMMAND_ERROR_IS_FATAL ANY
3228
-)
33-
-# So we can commit any changes
34-
-file(COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/package-lock.json ${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json)
35-
-
36-
-# Generate schema for codelldb types, resolve references to them in package.pre.json yielding the final package.json
37-
-add_custom_command(
38-
- OUTPUT ${CMAKE_BINARY_DIR}/package.json ${CMAKE_BINARY_DIR}/generated/codelldb.ts
39-
- DEPENDS ${CMAKE_SOURCE_DIR}/package.json ${CMAKE_SOURCE_DIR}/src/codelldb-types/src/lib.rs
29+
# So we can commit any changes
30+
file(COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/package-lock.json ${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json)
31+
32+
@@ -133,7 +120,7 @@ file(COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/package-lock.json ${CMAKE_CURRENT_SOU
33+
add_custom_command(
34+
OUTPUT ${CMAKE_BINARY_DIR}/package.json ${CMAKE_BINARY_DIR}/generated/codelldb.ts
35+
DEPENDS ${CMAKE_SOURCE_DIR}/package.json ${CMAKE_SOURCE_DIR}/src/codelldb-types/src/lib.rs
4036
- COMMAND cargo run --package codelldb-types -- ${CMAKE_BINARY_DIR}/codelldb.schema.json
41-
- COMMAND ${WithEnv} NODE_PATH=${CMAKE_CURRENT_BINARY_DIR}/node_modules node ${CMAKE_CURRENT_SOURCE_DIR}/tools/prep-package.js
42-
- ${CMAKE_CURRENT_BINARY_DIR}/package.pre.json ${CMAKE_CURRENT_BINARY_DIR}/package.json
43-
- COMMAND ${NPM} run json2ts -- ${CMAKE_BINARY_DIR}/codelldb.schema.json ${CMAKE_BINARY_DIR}/generated/codelldb.ts
44-
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
45-
- USES_TERMINAL
46-
-)
47-
+
48-
+# Nix: package.json and generated/codelldb.ts are provided by the codelldb-types derivation
49-
+# They are copied into the build directory in postConfigure phase
50-
add_custom_target(package_json
51-
DEPENDS ${CMAKE_BINARY_DIR}/package.json
52-
)
53-
@@ -163,6 +135,7 @@ add_custom_target(update_lockfiles
37+
+ COMMAND codelldb-types ${CMAKE_BINARY_DIR}/codelldb.schema.json
38+
COMMAND ${WithEnv} NODE_PATH=${CMAKE_CURRENT_BINARY_DIR}/node_modules node ${CMAKE_CURRENT_SOURCE_DIR}/tools/prep-package.js
39+
${CMAKE_CURRENT_BINARY_DIR}/package.pre.json ${CMAKE_CURRENT_BINARY_DIR}/package.json
40+
COMMAND ${NPM} run json2ts -- ${CMAKE_BINARY_DIR}/codelldb.schema.json ${CMAKE_BINARY_DIR}/generated/codelldb.ts
41+
@@ -158,6 +145,7 @@ add_custom_target(update_lockfiles
5442

5543
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_BINARY_DIR}/README.md)
5644
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md ${CMAKE_CURRENT_BINARY_DIR}/CHANGELOG.md)
5745
+add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE)
5846
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/lldb.png ${CMAKE_CURRENT_BINARY_DIR}/images/lldb.png)
5947
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/user.svg ${CMAKE_CURRENT_BINARY_DIR}/images/user.svg)
6048
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/users.svg ${CMAKE_CURRENT_BINARY_DIR}/images/users.svg)
61-
@@ -179,6 +152,7 @@ add_custom_target(dev_debugging
49+
@@ -174,6 +162,7 @@ add_custom_target(dev_debugging
6250
set(PackagedFilesBootstrap
6351
README.md
6452
CHANGELOG.md
6553
+ LICENSE
6654
extension.js
6755
images/*
68-
syntaxes/*
56+
syntaxes/*

nix/vscode-with-extensions.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ pkgs.vscode-with-extensions.override {
4444
))
4545
++ (with extensions.vscode-marketplace-universal; [
4646
# TODO enable after closing https://github.com/nix-community/nix-vscode-extensions/issues/165
47-
# vadimcn.vscode-lldb
47+
vadimcn.vscode-lldb
4848
]);
4949
}

0 commit comments

Comments
 (0)