Skip to content

Commit

Permalink
vscode-lldb: 1.9.1 -> 1.9.2
Browse files Browse the repository at this point in the history
The patched adapter now produces a dynamic library instead of a static archive

fixes #234908,#160874
  • Loading branch information
Congee committed Jun 9, 2023
1 parent 220b3a2 commit a31fa54
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 4f64ad191ec79b9f40843f88e3ac5910720636da Mon Sep 17 00:00:00 2001
From: Changsheng Wu <Congee@users.noreply.github.com>
Date: Fri, 9 Jun 2023 15:41:53 -0400
Subject: [PATCH] Update Cargo.toml

---
adapter/Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/adapter/Cargo.toml b/adapter/Cargo.toml
index bc86723..f5f26ce 100644
--- a/adapter/Cargo.toml
+++ b/adapter/Cargo.toml
@@ -39,7 +39,7 @@ winapi = { version = "0.3.8", features = ["std", "wincon", "namedpipeapi"] }
winreg = "0.6.2"

[lib]
-crate-type = ["staticlib"]
+crate-type = ["dylib", "rlib"]

[[bin]]
name = "codelldb"
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ae4dfb..519f544 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,13 +16,6 @@ endif()
@@ -16,13 +16,6 @@
set(VERSION "${VERSION}${VERSION_SUFFIX}")
message("Version ${VERSION}")

Expand All @@ -16,11 +15,11 @@ index 6ae4dfb..519f544 100644
if (CMAKE_SYSROOT)
set(CMAKE_C_FLAGS "--sysroot=${CMAKE_SYSROOT} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "--sysroot=${CMAKE_SYSROOT} ${CMAKE_CXX_FLAGS}")
@@ -93,16 +86,6 @@ configure_file(package.json ${CMAKE_CURRENT_BINARY_DIR}/package.json @ONLY)
@@ -102,16 +95,6 @@
configure_file(webpack.config.js ${CMAKE_CURRENT_BINARY_DIR}/webpack.config.js @ONLY)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

-# Run 'npm install'
-# Install node_modules
-execute_process(
- COMMAND ${NPM} ci # like install, but actually respects package-lock file.
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
Expand All @@ -30,23 +29,22 @@ index 6ae4dfb..519f544 100644
- message(FATAL_ERROR "npm intall failed: ${Result}")
-endif()
-
# Copy it back, so we can commit the lock file.
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/package-lock.json DESTINATION ${CMAKE_CURRENT_SOURCE_DIR})

@@ -154,6 +137,7 @@ add_custom_target(tests
# Resolve $refs
execute_process(
COMMAND ${WithEnv} NODE_PATH=${CMAKE_CURRENT_BINARY_DIR}/node_modules node ${CMAKE_CURRENT_SOURCE_DIR}/tools/prep-package.js ${CMAKE_CURRENT_BINARY_DIR}/package.json ${CMAKE_CURRENT_BINARY_DIR}/package.json
@@ -169,6 +152,7 @@

add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_BINARY_DIR}/README.md)
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md ${CMAKE_CURRENT_BINARY_DIR}/CHANGELOG.md)
+add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE)
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/lldb.png ${CMAKE_CURRENT_BINARY_DIR}/images/lldb.png)
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/user.svg ${CMAKE_CURRENT_BINARY_DIR}/images/user.svg)
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/users.svg ${CMAKE_CURRENT_BINARY_DIR}/images/users.svg)
@@ -170,6 +154,7 @@ add_custom_target(dev_debugging
@@ -185,6 +169,7 @@
set(PackagedFilesBootstrap
README.md
CHANGELOG.md
+ LICENSE
extension.js
images/*
syntaxes/*

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ assert lib.versionAtLeast python3.version "3.5";
let
publisher = "vadimcn";
pname = "vscode-lldb";
version = "1.9.1";
version = "1.9.2";

vscodeExtUniqueId = "${publisher}.${pname}";
vscodeExtPublisher = publisher;
Expand All @@ -15,7 +15,7 @@ let
owner = "vadimcn";
repo = "vscode-lldb";
rev = "v${version}";
sha256 = "sha256-DqxdZtSW8TZaOFGXOZQ7a4tmgRj6iAWDppCNomdfVxY=";
sha256 = "6QmYRlSv8jY3OE3RcYuZt+c3z6GhFc8ESETVfCfF5RI=";
};

# need to build a custom version of lldb and llvm for enhanced rust support
Expand All @@ -25,7 +25,7 @@ let
pname = "${pname}-adapter";
inherit version src;

cargoSha256 = "sha256-+hfNkr9cZbOcWdWKUWUqDj9a0PKjKeApFXYZzS1XokE=";
cargoSha256 = "sha256-Qq2igtH1XIB+NAEES6hdNZcMbEmaFN69qIJ+gTYupvQ=";

nativeBuildInputs = [ makeWrapper ];

Expand All @@ -38,6 +38,8 @@ let
"--bin=codelldb"
];

patches = [ ./adapter-output-shared_object.patch ];

# Tests are linked to liblldb but it is not available here.
doCheck = false;
};
Expand All @@ -46,7 +48,7 @@ let
pname = "${pname}-node-deps";
inherit version src;

npmDepsHash = "sha256-Cdlq1jxHSCfPjXhasClc6XzEUp3vlLgkStbhYtCyc7E=";
npmDepsHash = "sha256-fMKGi+AJTMlWl7SQtZ21hUwOLgqlFYDhwLvEergQLfI=";

nativeBuildInputs = [
python3
Expand Down Expand Up @@ -82,12 +84,6 @@ in stdenv.mkDerivation {

patches = [ ./cmake-build-extension-only.patch ];

postPatch = ''
# temporary patch for forgotten version updates
substituteInPlace CMakeLists.txt \
--replace "1.9.0" ${version}
'';

postConfigure = ''
cp -r ${nodeDeps}/lib/node_modules .
'';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env nix-shell
#! nix-shell ../../update-shell.nix -i bash -p wget prefetch-npm-deps
#! nix-shell ../../update-shell.nix -i bash -p nix-prefetch-github prefetch-npm-deps

set -eo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
Expand All @@ -18,7 +18,7 @@ version="$1"
if [[ $# -ne 1 ]]; then
# no version specified, find the newest one
version=$(
curl -s "https://api.github.com/repos/$owner/$repo/releases" |
curl -sL "https://api.github.com/repos/$owner/$repo/releases" |
jq 'map(select(.prerelease | not)) | .[0].tag_name' --raw-output |
sed 's/[\"v]//'
)
Expand All @@ -29,19 +29,18 @@ if grep -q 'cargoSha256 = ""' ./default.nix; then
fi
if [[ "$version" == "$old_version" ]]; then
echo "Up to date: $version"
exit
fi
echo "$old_version -> $version"

# update hashes
sed -E 's/\bversion = ".*?"/version = "'$version'"/' --in-place "$nixFile"
srcHash=$(nix-prefetch fetchFromGitHub --owner vadimcn --repo vscode-lldb --rev "v$version")
srcHash=$(nix-prefetch-github vadimcn vscode-lldb --rev "v$version" | jq --raw-output .sha256)
sed -E 's#\bsha256 = ".*?"#sha256 = "'$srcHash'"#' --in-place "$nixFile"
cargoHash=$(nix-prefetch "{ sha256 }: (import $nixpkgs {}).vscode-extensions.vadimcn.vscode-lldb.adapter.cargoDeps.overrideAttrs (_: { outputHash = sha256; })")
sed -E 's#\bcargoSha256 = ".*?"#cargoSha256 = "'$cargoHash'"#' --in-place "$nixFile"

pushd $TMPDIR
wget https://raw.githubusercontent.com/$owner/$repo/v${version}/package-lock.json
curl -LO https://raw.githubusercontent.com/$owner/$repo/v${version}/package-lock.json
npmDepsHash=$(prefetch-npm-deps ./package-lock.json)
popd
sed -E 's#\bnpmDepsHash = ".*?"#npmDepsHash = "'$npmDepsHash'"#' --in-place "$nixFile"
Expand Down

0 comments on commit a31fa54

Please sign in to comment.