Skip to content

Conversation

@mrcjkb
Copy link
Member

@mrcjkb mrcjkb commented Nov 1, 2023

Description of changes

Fixes #160874.

See this comment: #160874 (comment)

To me this feels like a dirty hack, but it seems to work; and I can run

> nix build ".#vscode-extensions.vadimcn.vscode-lldb.adapter" 
> ./result/bin/codelldb --connect
error: The argument '--connect <connect>' requires a value but none was supplied

USAGE:
    codelldb --connect <connect>

For more information try --help

...where before it would complain about missing libraries.
The same hack is applied in the installPhase of the VSCode extension. (Maybe there's a cleaner way to do this?)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@mrcjkb mrcjkb requested a review from jonringer as a code owner November 1, 2023 21:20
@github-actions github-actions bot added the 6.topic: vscode A free and versatile code editor that supports almost every major programming language. label Nov 1, 2023
@mrcjkb
Copy link
Member Author

mrcjkb commented Nov 1, 2023

Result of nixpkgs-review pr 264887 run on x86_64-linux 1

1 package failed to build:
  • vscode-extensions.vadimcn.vscode-lldb

@ofborg ofborg bot requested a review from nigelgbanks November 1, 2023 22:29
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Nov 1, 2023
@mrcjkb mrcjkb changed the title vadimcn.vscode-lldb.adapter: fix passthru adapter vscode-extensions.vadimcn.vscode-lldb: fix passthru adapter Nov 2, 2023
Copy link
Member

Choose a reason for hiding this comment

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

libs should not be under bin

Copy link
Member Author

@mrcjkb mrcjkb Nov 27, 2023

Choose a reason for hiding this comment

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

I've added a comment explaining why codelldb won't work as a standalone if libcodelldb isn't symlinked to bin.

I've tried various other things (like prefixing LD_LIBRARY_PATH, passing in a flag), but none seem to work.
Do you have any ideas?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should put all files under $out/share/codelldb or similar and create a wrapper from that into $out/bin? Then we don't pollute the bin directory with unrelated files.

Copy link
Member Author

Choose a reason for hiding this comment

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

That appears to work.
@Majiir does this work for you in VSCode?

Copy link
Contributor

Choose a reason for hiding this comment

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

The plugin fails to build. I think you need to copy only ${adapter}/share/* instead of ${adapter}/{share,lib}/*, since there are files with the same name in both.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks - Should be fixed now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Builds and works in VSCode. 🚀

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for testing!

@mrcjkb mrcjkb force-pushed the codelldb-fix branch 2 times, most recently from de36c25 to 66ca0c0 Compare November 27, 2023 12:49
@mrcjkb
Copy link
Member Author

mrcjkb commented Nov 27, 2023

Result of nixpkgs-review pr 264887 run on x86_64-linux 1

1 package built:
  • vscode-extensions.vadimcn.vscode-lldb

@mrcjkb
Copy link
Member Author

mrcjkb commented Dec 4, 2023

Result of nixpkgs-review pr 264887 run on x86_64-linux 1

1 package failed to build:
  • vscode-extensions.vadimcn.vscode-lldb

@mrcjkb
Copy link
Member Author

mrcjkb commented Dec 5, 2023

Result of nixpkgs-review pr 264887 run on x86_64-linux 1

1 package built:
  • vscode-extensions.vadimcn.vscode-lldb

@wegank
Copy link
Member

wegank commented Dec 18, 2023

Result of nixpkgs-review pr 264887 run on aarch64-linux 1

1 package built:
  • vscode-extensions.vadimcn.vscode-lldb

@wegank wegank merged commit 69524c1 into NixOS:master Dec 18, 2023
@mrcjkb mrcjkb deleted the codelldb-fix branch December 18, 2023 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: vscode A free and versatile code editor that supports almost every major programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codelldb inside of vscode-lldb extension doesn't work

4 participants