-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
vscode-extensions.ms-python.python: Fix packaging. #53923
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
Conversation
Previously, this extension used the JEDI backend for understanding Python. Recently, Microsoft switched to using their Python Language Server (https://github.com/Microsoft/python-language-server). The extension attempts to download the latest version into the extension folder, which failed for obvious reasons. This change packages the language server into the extension, and performs the necessary fixups and wrapping to make the dotnet binary run. Tested on Linux x86_64, but it should work on Darwin too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
I don't know the vscode ecosystem nor its nixpkging, but I made some comments. HTH, feel free to ignore.
}; | ||
meta = with lib; { | ||
license = licenses.mit; | ||
maintainers = [ maintainers.jraygauthier maintainers.sdorminey ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you only have to do this if you want to become a maintainer of a package. Up to you.
https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes
''; | ||
}; | ||
|
||
languageServer = extractNuGet rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are other packages going to want to use this language server? Should it be packaged separately?
buildInputs = [ languageServer icu openssl ]; | ||
dontPatchELF = true; | ||
|
||
buildPhase = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if this phase happened in the python language server derivation.
Also I think it makes more sense for the installation here to be in the installPhase
and the patching and wrapping to happen at postFixup
.
''; | ||
|
||
fixupPhase = '' | ||
wrapProgram `find $out -name Microsoft.Python.LanguageServer` --prefix LD_LIBRARY_PATH ":" ${icu}/lib:${openssl.out}/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why having this in rpath
isn't done?
Haven't had any response in while, so I'm afraid it would customary for me to close this. Thanks 🌟 |
Motivation for this change
Previously, this extension used the JEDI backend for understanding
Python. Recently, Microsoft switched to using their Python Language
Server (https://github.com/Microsoft/python-language-server). The
extension attempts to download the latest version into the extension
folder, which failed for obvious reasons.
This change packages the language server into the extension, and
performs the necessary fixups and wrapping to make the dotnet binary
run.
Tested on Linux x86_64, but it should work on Darwin too.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)Before: 2794344 After: 2869216