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.python-language-server: init #70058

Closed
wants to merge 4 commits into from
Closed

Conversation

teto
Copy link
Member

@teto teto commented Sep 30, 2019

It was already defined in nix but not referencable.
I make it accessible so that one can reuse it for instance in coc-python (which otherwise installs its version in $HOME/.config/coc/extensions/coc-python-data/languageServer.0.4.24/)

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

aka make accessible to plugins like coc-python.
@teto
Copy link
Member Author

teto commented Oct 1, 2019

seems like I need to patchelf the interpreter. I am trying to add hooks to extra-nuget.nix ...

@teto
Copy link
Member Author

teto commented Oct 1, 2019

I am not sure what I am doing: I've added autoPatchelfHook and then added libraries until the build succeeded.
When coc-python starts the mpls server, it now errors with:

Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
   at System.Globalization.GlobalizationMode..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.CultureInfo..cctor()
   at System.FormattableString.Invariant(System.FormattableString)
   at Microsoft.Python.Core.Services.ServiceManager.AddService(System.Object, System.Type)
   at Microsoft.Python.LanguageServer.Services.CoreShell..ctor()
   at Microsoft.Python.LanguageServer.Services.CoreShell.Create()
   at Microsoft.Python.LanguageServer.Server.Program.Main(System.String[])
[Error  - 7:34:50 PM] Connection to server got closed. Server will not be restarted.
[Error  - 7:34:50 PM]

This can be prevented by writing/patching Microsoft.Python.LanguageServer.runtimeconfig.json with

{
"runtimeOptions": {
    "configProperties": {
        "System.Globalization.Invariant": true
    }
}
}

(or by adding icu to the buildInputs)

The follow up problem I meet is the server crashing with

##########Linting Output - mypy##########
No usable version of libssl was found

Not sure how to solve that, I guess I could strace ...
It seems like wrapping MPLS in a dotnet environment could solve several of the previous problems
https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore30

Not sure how to progress from there

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/coc-nvim-nvim-stuff/2974/18

@Profpatsch
Copy link
Member

Profpatsch commented Jan 26, 2020

(triage) ping

@teto
Copy link
Member Author

teto commented Apr 23, 2020

@jonringer I feel like there are different ways to complete this and I am not confident enough to modify the dotnet packages I know you are already doing a lot but as a dotnet and python expert, I wonder if you could complete/help with this :) ?

@teto
Copy link
Member Author

teto commented Apr 25, 2020

nevermind closing in favor of #70058

@teto teto closed this Apr 25, 2020
@teto teto deleted the mpls branch September 5, 2021 00:58
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