Skip to content

Commit bd97792

Browse files
committed
fix(flake): make nix-dev a path input instead of local import
Use a proper flake input declaration: inputs.nix-dev.url = "path:./nix-dev"; This change prevents downstream consumers from hitting "path '/nix/store/...-nix-dev' is not valid" during flake evaluation. It also preserves the original inputsCombined logic. Fixes #149
1 parent 979e203 commit bd97792

File tree

17 files changed

+3499
-2658
lines changed

17 files changed

+3499
-2658
lines changed

data/cache/open-vsx-latest.json

Lines changed: 775 additions & 603 deletions
Large diffs are not rendered by default.

data/cache/vscode-marketplace-latest.json

Lines changed: 2529 additions & 1862 deletions
Large diffs are not rendered by default.

extensions/default.nix

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,19 @@ in
3232

3333
vadimcn.vscode-lldb =
3434
config@{ mktplcRef, ... }:
35-
if lib.versionAtLeast mktplcRef.version "1.11.0" then
36-
# https://github.com/NixOS/nixpkgs/pull/383013
35+
let
36+
lowestSupportedVersion = "1.11.7";
37+
in
38+
if lib.versionAtLeast mktplcRef.version lowestSupportedVersion then
39+
# https://github.com/nix-community/nix-vscode-extensions/pull/151
3740
callPackage ./vadimcn/vscode-lldb/latest config
3841
else
39-
callPackage ./vadimcn/vscode-lldb/1.10.0 config;
42+
throw ''
43+
The version `${mktplcRef.version}` of `vadimcn.vscode-lldb` is unsupported.
44+
45+
Only versions greater or equal to `${lowestSupportedVersion}` are supported.
46+
47+
Try `extensions.${pkgs.stdenv.hostPlatform.system}.vscode-marketplace-universal.vadimcn.vscode-lldb`
48+
or `extensions.${pkgs.stdenv.hostPlatform.system}.open-vsx-universal.vadimcn.vscode-lldb`.
49+
'';
4050
}

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

Lines changed: 0 additions & 18 deletions
This file was deleted.

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

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -33,58 +33,27 @@ let
3333
# nix-repl> :lf nixpkgs
3434
# nix-repl> pkgs = legacyPackages.${builtins.currentSystem}
3535

36-
# - Build `f` with the version and the hash of the `src` of the new version.
37-
# - Use the `got:` hash.
38-
39-
# Hashes of the source code in releases (https://github.com/vadimcn/codelldb/releases)
40-
# nix-repl> rev = "1.11.6"
36+
# Get the hash of a source code in a release (https://github.com/vadimcn/codelldb/releases)
37+
#
38+
# nix-repl> rev = "1.11.7"
4139
# nix-repl> src = pkgs.fetchFromGitHub { owner = "vadimcn"; repo = "codelldb"; rev = "v${rev}"; hash = ""; }
4240
# nix-repl> :b src
4341
#
44-
# copy the hash that you got
45-
#
46-
# nix-repl> src = pkgs.fetchFromGitHub { owner = "vadimcn"; repo = "codelldb"; rev = "v${rev}"; hash = "sha256-uqvcixxJduF1l/qgt2rIACNsPcH1REiVwRz3zZBA82Q="; }
47-
hash =
48-
{
49-
"1.11.0" = "sha256-BzLKRs1fbLN4XSltnxPsgUG7ZJSMz/yJ/jQDZ9OTVxY=";
50-
"1.11.1" = "sha256-b063cCuiDpaeSSWxY0sbKsZucY7BCxI5s+35soJRFFQ=";
51-
"1.11.2" = "sha256-wj0X7nAcMU+kwl2qQRKixF+kTbTlnpgU7BYwaibIIKQ=";
52-
"1.11.3" = "sha256-zqaJzRTYc2gsipnbn4t16u62C/gkIohenWJDTEvZRvU=";
53-
"1.11.4" = "sha256-+Pe7ij5ukF5pLgwvr+HOHjIv1TQDiPOEeJtkpIW9XWI=";
54-
"1.11.5" = "sha256-mp50QmYmqMjIUfGKAt8fWcov4Bn9ruya+SwXGT3T/zk=";
55-
"1.11.6" = "sha256-uqvcixxJduF1l/qgt2rIACNsPcH1REiVwRz3zZBA82Q=";
56-
}
57-
.${version};
42+
# Write here the hash that you `got:`.
43+
hash = "sha256-qbpl+/GsMjhs7xZdt8r3CM5gYOowBlu/yCd5RmU2eXE=";
44+
45+
# Write here the hash from above.
46+
# nix-repl> src = pkgs.fetchFromGitHub { owner = "vadimcn"; repo = "codelldb"; rev = "v${rev}"; hash = "sha256-qbpl+/GsMjhs7xZdt8r3CM5gYOowBlu/yCd5RmU2eXE="; }
5847

5948
# nix-repl> :b pkgs.rustPlatform.buildRustPackage { cargoHash = ""; name = "dummy"; inherit src; useFetchCargoVendor = true; }
6049
#
61-
# add here the cargoHash that you got.
62-
cargoHash =
63-
{
64-
"1.11.0" = "sha256-cLmL+QnFh2HwS2FcKTmGYI1NsrGV7MLWf3UBhNzBo0g=";
65-
"1.11.1" = "sha256-HFu3u/DX+SOIwwgk7+2EbQZ1tp9yqaV1CxiCN1PgXwM=";
66-
"1.11.2" = "sha256-Bl7bD+ulRJkeTdzyS8T/eMBmFaeqgMFFg3OTwSfo/RY=";
67-
"1.11.3" = "sha256-Nh4YesgWa1JR8tLfrIRps9TBdsAfilXu6G2/kB08co8=";
68-
"1.11.4" = "sha256-Nh4YesgWa1JR8tLfrIRps9TBdsAfilXu6G2/kB08co8=";
69-
"1.11.5" = "sha256-nTQbgYDDDI+pnKpCAUWDtk5rujjlK+7ZLUgPp1C/foo=";
70-
"1.11.6" = "sha256-jAr/5wW9Vy2xfgHKeJGz/vuIRuouVAGH3XHFdQ34x4A=";
71-
}
72-
.${version};
50+
# Write here the hash that you `got:`.
51+
cargoHash = "sha256-jAr/5wW9Vy2xfgHKeJGz/vuIRuouVAGH3XHFdQ34x4A=";
7352

7453
# nix-repl> :b pkgs.buildNpmPackage { npmDepsHash = ""; name = "dummy"; inherit src; dontNpmBuild = true; }
7554
#
76-
# add here the npmDepsHash that you got.
77-
npmDepsHash =
78-
{
79-
"1.11.0" = "sha256-JRLXPsru+4cJe/WInYSr57+Js7mohL1CMR9LLCXORDg=";
80-
"1.11.1" = "sha256-4CCvOh7XOUsdI/gzDfx0OwzE7rhdCYFO49wVv6Gn/J0=";
81-
"1.11.2" = "sha256-oqRV9oDYPJkSkvYJA0jCgDyfzy6AnYq/ftRPM3swDyE=";
82-
"1.11.3" = "sha256-Efeun7AFMAnoNXLbTGH7OWHaBHT2tO9CodfjKrIYw40=";
83-
"1.11.4" = "sha256-Efeun7AFMAnoNXLbTGH7OWHaBHT2tO9CodfjKrIYw40=";
84-
"1.11.5" = "sha256-mHSY4LqcQiaVs6qvusxjybdKyrMh9sQatBanpIo6xk4=";
85-
"1.11.6" = "sha256-cS7Fr4mrq0QIPFtG5VjLEOOiC2QuVDW+Ispt2LmI258=";
86-
}
87-
.${version};
55+
# Write here the hash that you `got:`.
56+
npmDepsHash = "sha256-cS7Fr4mrq0QIPFtG5VjLEOOiC2QuVDW+Ispt2LmI258=";
8857

8958
src = fetchFromGitHub {
9059
owner = "vadimcn";
@@ -125,6 +94,18 @@ let
12594
;
12695
}
12796
);
97+
98+
codelldb-types = (
99+
callPackage ./lldb-types.nix {
100+
inherit
101+
pname
102+
src
103+
version
104+
cargoHash
105+
nodeDeps
106+
;
107+
}
108+
);
128109
in
129110
lib.customisation.makeOverridable stdenv.mkDerivation {
130111
pname = "vscode-extension-${publisher}-${pname}";
@@ -155,6 +136,14 @@ lib.customisation.makeOverridable stdenv.mkDerivation {
155136

156137
postConfigure = ''
157138
cp -r ${nodeDeps}/lib/node_modules .
139+
140+
# Copy pre-built package.json and generated types from codelldb-types
141+
cp ${codelldb-types}/package.json .
142+
mkdir -p generated
143+
cp -r ${codelldb-types}/generated/* generated/
144+
145+
# Touch the files to ensure they're newer than dependencies
146+
touch package.json generated/codelldb.ts
158147
''
159148
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
160149
export HOME="$TMPDIR/home"
@@ -197,7 +186,7 @@ lib.customisation.makeOverridable stdenv.mkDerivation {
197186
'';
198187

199188
passthru = {
200-
inherit lldb adapter;
189+
inherit lldb adapter codelldb-types;
201190
updateScript = ./update.sh;
202191
};
203192

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
rustPlatform,
3+
nodejs,
4+
nodeDeps,
5+
stdenv,
6+
7+
pname,
8+
src,
9+
version,
10+
11+
cargoHash,
12+
}:
13+
# codelldb-types.nix
14+
rustPlatform.buildRustPackage {
15+
pname = "${pname}-types";
16+
inherit version src cargoHash;
17+
18+
nativeBuildInputs = [ nodejs ];
19+
20+
buildAndTestSubdir = "src/codelldb-types";
21+
cargoBuildFlags = [ "--bin=codelldb-types" ];
22+
23+
# Don't run normal install - we need custom workflow
24+
dontCargoInstall = true;
25+
26+
postBuild = ''
27+
# Go back to the workspace root
28+
cd $NIX_BUILD_TOP/source
29+
30+
# The binary is in target/<rust-target>/release/codelldb-types
31+
RUST_TARGET="${stdenv.hostPlatform.rust.rustcTarget}"
32+
CODELLDB_TYPES_BIN="./target/$RUST_TARGET/release/codelldb-types"
33+
34+
echo "Looking for binary at: $CODELLDB_TYPES_BIN"
35+
ls -la $CODELLDB_TYPES_BIN
36+
37+
# Generate schema by running codelldb-types
38+
$CODELLDB_TYPES_BIN codelldb.schema.json
39+
40+
# Copy node_modules for prep-package.js
41+
cp -r ${nodeDeps}/lib/node_modules .
42+
43+
# Process package.json (substitute @VERSION@ with actual version)
44+
sed "s/@VERSION@/${version}/g" package.json > package.pre.json
45+
node tools/prep-package.js package.pre.json package.json
46+
47+
# Generate TypeScript types
48+
mkdir -p generated
49+
npm run json2ts -- codelldb.schema.json generated/codelldb.ts
50+
51+
'';
52+
53+
installPhase = ''
54+
mkdir -p $out
55+
cp package.json $out/
56+
cp -r generated $out/
57+
'';
58+
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
2+
lib,
23
buildNpmPackage,
34

5+
stdenv,
46
libsecret,
57
python3,
68
pkg-config,
9+
clang_20,
710

811
pname,
912
src,
1013
version,
11-
1214
npmDepsHash,
1315
}:
1416
buildNpmPackage {
@@ -20,7 +22,8 @@ buildNpmPackage {
2022
nativeBuildInputs = [
2123
python3
2224
pkg-config
23-
];
25+
]
26+
++ lib.optionals stdenv.isDarwin [ clang_20 ];
2427

2528
buildInputs = [ libsecret ];
2629

extensions/vadimcn/vscode-lldb/latest/patches/cmake-build-extension-only.patch

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index d51dfad..2b2e492 100644
2+
index 0132c82..83e871c 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
55
@@ -16,13 +16,6 @@ endif()
@@ -15,11 +15,15 @@ index d51dfad..2b2e492 100644
1515
-
1616
set(CMAKE_CTEST_ARGUMENTS "--output-on-failure" CACHE INTERNAL "CTest arguments")
1717

18-
if (CMAKE_SYSROOT)
19-
@@ -125,15 +118,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)
18+
set(TEST_TIMEOUT 5000 CACHE STRING "Test timeout [ms]")
19+
@@ -116,33 +109,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)
2327
-# Install node_modules
2428
-execute_process(
2529
- COMMAND ${NPM} install
@@ -29,18 +33,35 @@ index d51dfad..2b2e492 100644
2933
-if (NOT ${Result} EQUAL 0)
3034
- message(FATAL_ERROR "npm install failed: ${Result}")
3135
-endif()
32-
# So we can commit any changes
33-
file(COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/package-lock.json ${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json)
34-
35-
@@ -166,6 +150,7 @@ add_custom_target(update_lockfiles
36+
-# So we can commit any changes
37+
-file(COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/package-lock.json ${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json)
38+
-
39+
-# Generate schema for codelldb types, resolve references to them in package.pre.json yielding the final package.json
40+
-add_custom_command(
41+
- OUTPUT ${CMAKE_BINARY_DIR}/package.json ${CMAKE_BINARY_DIR}/generated/codelldb.ts
42+
- DEPENDS ${CMAKE_SOURCE_DIR}/package.json ${CMAKE_SOURCE_DIR}/src/codelldb-types/src/lib.rs
43+
- COMMAND cargo run --package codelldb-types -- ${CMAKE_BINARY_DIR}/codelldb.schema.json
44+
- COMMAND ${WithEnv} NODE_PATH=${CMAKE_CURRENT_BINARY_DIR}/node_modules node ${CMAKE_CURRENT_SOURCE_DIR}/tools/prep-package.js
45+
- ${CMAKE_CURRENT_BINARY_DIR}/package.pre.json ${CMAKE_CURRENT_BINARY_DIR}/package.json
46+
- COMMAND ${NPM} run json2ts -- ${CMAKE_BINARY_DIR}/codelldb.schema.json ${CMAKE_BINARY_DIR}/generated/codelldb.ts
47+
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
48+
- USES_TERMINAL
49+
-)
50+
+
51+
+# Nix: package.json and generated/codelldb.ts are provided by the codelldb-types derivation
52+
+# They are copied into the build directory in postConfigure phase
53+
add_custom_target(package_json
54+
DEPENDS ${CMAKE_BINARY_DIR}/package.json
55+
)
56+
@@ -161,6 +130,7 @@ add_custom_target(update_lockfiles
3657

3758
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_BINARY_DIR}/README.md)
3859
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md ${CMAKE_CURRENT_BINARY_DIR}/CHANGELOG.md)
3960
+add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE)
4061
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/lldb.png ${CMAKE_CURRENT_BINARY_DIR}/images/lldb.png)
4162
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/user.svg ${CMAKE_CURRENT_BINARY_DIR}/images/user.svg)
4263
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/users.svg ${CMAKE_CURRENT_BINARY_DIR}/images/users.svg)
43-
@@ -182,6 +167,7 @@ add_custom_target(dev_debugging
64+
@@ -177,6 +147,7 @@ add_custom_target(dev_debugging
4465
set(PackagedFilesBootstrap
4566
README.md
4667
CHANGELOG.md

extensions/vadimcn/vscode-lldb/latest/update.sh

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)