Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode-extensions.vadimcn.vscode-lldb: init at 1.5.3 #91250

Merged
merged 1 commit into from Sep 22, 2020

Conversation

oxalica
Copy link
Contributor

@oxalica oxalica commented Jun 21, 2020

Motivation for this change

Package vadimcn.vscode-lldb, a new vscode extension for debugging and pretty print support (especially for rust) with native lldb.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
    • 593 MiB (~94 MiB itself. Others are lldb, python3, etc.)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@monomadic
Copy link

monomadic commented Jun 28, 2020

I'd love for this to be merged - for others who can't wait, I suggest downloading the full vsix manually from the the owners github https://github.com/vadimcn/vscode-lldb/releases

and installing it from command line. you'll have to manually patch the executables inside the extension with patchelf and link to the python 3.5 lib manually in your vscode settings.

But I'm guessing this PR would negate the need for all of that!

@oxalica
Copy link
Contributor Author

oxalica commented Aug 25, 2020

ping @jonringer

@oxalica
Copy link
Contributor Author

oxalica commented Sep 17, 2020

Refactored to use standalone generated node-packages.nix without touching global nodePackages.

@oxalica
Copy link
Contributor Author

oxalica commented Sep 21, 2020

According to #97444 (comment), change to use global node-packages.nix again.

r? @jonringer

name = "vscode-lldb";
version = "1.5.3";

dylibExt = stdenv.hostPlatform.extensions.sharedLibrary;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an unused variable, is it possible to remove it?

postFixup = ''
wrapProgram $out/adapter/codelldb \
--prefix PATH : "${python3}/bin" \
--prefix LD_LIBRARY_PATH : "${python3}/lib"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment explaining why this is necessary? (e.g., vscode-lldb loads libpython at runtime)

Comment on lines +81 to +82
dontStrip = true;
dontPatchELF = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also deserve a comment.

};

in vscode-utils.buildVscodeExtension {
inherit name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include the version in name. Also include the version attribute in the derivation to make it easy to extract the version when generating package.json.

Suggested change
inherit name;
inherit version;
name = "${name}-${version}";

@@ -0,0 +1,24 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would help to include a script (maybe generate.sh?) that would generate this automatically. Here's an example:

#!/usr/bin/env bash

# Script to generate package.json needed to create the build environment.

set -eu -o pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"

SRC="$(nix-build -A vscode-extensions.vadimcn.vscode-lldb.src.src --no-out-link ../../../..)"
VERSION="$(nix-instantiate --eval -A vscode-extensions.vadimcn.vscode-lldb.version ../../../.. | tr -d '"')"
JQ_BIN="$(nix-build -A jq --no-out-link ../../../..)/bin/jq"


main() {
    jq "{\"name\": \"vscode-lldb\", \"version\": \"$VERSION\", \"dependencies\": (.devDependencies + .dependencies)}" \
        "$SRC/package.json" \
        > build-deps/package.json
}

jq() {
    command "$JQ_BIN" "$@"
}

main

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR has been going on for months, I think we could have another PR to do refinements.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was able to build it.

@jonringer jonringer merged commit 11c3633 into NixOS:master Sep 22, 2020
@oxalica oxalica deleted the vscode.codelldb branch October 20, 2020 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants