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

jetbrains rider: backend on .Net Core support #86227

Merged
merged 1 commit into from Jul 29, 2020

Conversation

BananchickPasha
Copy link
Contributor

@BananchickPasha BananchickPasha commented Apr 28, 2020

Motivation for this change

Developers of Rider-2020.1 changed default backend's runtime from mono to netcore, but bundled netcore cannot find libc++ and other dependencies.

Things done

Created symlink to NixOS's build of netcore

  • 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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@BananchickPasha BananchickPasha changed the title jetbrains rider: resharper on dotnet support jetbrains rider: backend on dotnet support Apr 28, 2020
@BananchickPasha BananchickPasha changed the title jetbrains rider: backend on dotnet support jetbrains rider: backend on .Net Core support Apr 28, 2020
@ghost
Copy link

ghost commented May 8, 2020

Hello, I tried this PR, but it seems that rider is still crashing at boot.

@BananchickPasha
Copy link
Contributor Author

BananchickPasha commented May 8, 2020

Hello, I tried this PR, but it seems that rider is still crashing at boot.

It seems strange, because on my computer and on ubuntu 20.04 with nix, rider 2020.1 does not crash.

@ghost
Copy link

ghost commented May 14, 2020

I have checked this PR again today, and I got the following output:

Internal error. Please refer to http://jb.gg/ide/critical-startup-errors

java.util.concurrent.CompletionException: com.intellij.ide.plugins.StartupAbortedException: Fatal error initializing 'com.jetbrains.rider.protocol.ProtocolManagerInitializer'
    at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
    at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1643)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:310)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:80)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:128)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
    at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:184)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:416)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: com.intellij.ide.plugins.StartupAbortedException: Fatal error initializing 'com.jetbrains.rider.protocol.ProtocolManagerInitializer'
    at com.intellij.serviceContainer.ComponentManagerImplKt.handleComponentError(ComponentManagerImpl.kt:955)
    at com.intellij.serviceContainer.ComponentManagerImpl.handleInitComponentError(ComponentManagerImpl.kt:333)
    at com.intellij.serviceContainer.MyComponentAdapter.doCreateInstance(MyComponentAdapter.kt:65)
    at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceUncached(BaseComponentAdapter.kt:115)
    at com.intellij.serviceContainer.BaseComponentAdapter.getInstance(BaseComponentAdapter.kt:69)
    at com.intellij.serviceContainer.BaseComponentAdapter.getInstance$default(BaseComponentAdapter.kt:62)
    at com.intellij.serviceContainer.ComponentManagerImpl.createComponents(ComponentManagerImpl.kt:261)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$loadComponents$5(ApplicationImpl.java:334)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:625)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:570)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
    at com.intellij.openapi.application.impl.ApplicationImpl.loadComponents(ApplicationImpl.java:334)
    at com.intellij.idea.ApplicationLoader$startApp$6$loadComponentInEdtFuture$1.run(ApplicationLoader.kt:184)
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640)
    ... 22 more
Caused by: java.lang.IllegalStateException: No protocolHost for the application
    at com.jetbrains.rider.protocol.ApplicationProtocolKt.a(ApplicationProtocol.kt:41)
    at com.jetbrains.rider.protocol.ApplicationProtocolKt.getProtocolManager(ApplicationProtocol.kt:15)
    at com.jetbrains.rider.protocol.ProtocolManagerInitializer.<init>(ProtocolManager.kt:22)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.intellij.serviceContainer.ConstructorInjectionKt.instantiateUsingPicoContainer(constructorInjection.kt:48)
    at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClassWithConstructorInjection(ComponentManagerImpl.kt:645)
    at com.intellij.serviceContainer.MyComponentAdapter.doCreateInstance(MyComponentAdapter.kt:37)
    ... 35 more

-----
JRE 1.8.0_242-b08 amd64 by Oracle Corporation
/nix/store/fdhw5sn9344w499n16jkwid7w110zrjc-openjdk-8u242-b08/lib/openjdk/jre

@BananchickPasha
Copy link
Contributor Author

@elyhaka, please, try to execute dotnet in /nix/store/{rider}/rider-2020.1.2/lib/ReSharperHost/linux-x64/dotnet/dotnet. If it fails, check wether /nix/store/{rider}/rider-2020.1.2/lib/ReSharperHost/linux-x64/dotnet is symlink or not.

@baracoder
Copy link
Contributor

on NixOS 20.03 it crashed once (i think it deactivated a plugin) then on the next start it worked

ls -l /nix/store/4xipi0l0rpzrdpxxhkiby1dn84h8nqx3-rider-2020.1.0/rider-2020.1.0/lib/ReSharperHost/linux-x64/dotnet
lrwxrwxrwx 1 root root 62  1. Jan 1970  /nix/store/4xipi0l0rpzrdpxxhkiby1dn84h8nqx3-rider-2020.1.0/rider-2020.1.0/lib/ReSharperHost/linux-x64/dotnet -> /nix/store/51zs832qmwqq8j9jimr99iglkmjmkwnc-dotnet-sdk-3.1.102/
.../linux-x64/dotnet/dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.102
 Commit:    573d158fea

Runtime Environment:
 OS Name:     nixos
 OS Version:  20.09pre226012.b47873026c7
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /nix/store/51zs832qmwqq8j9jimr99iglkmjmkwnc-dotnet-sdk-3.1.102/sdk/3.1.102/

Host (useful for support):
  Version: 3.1.2
  Commit:  916b5cba26

.NET Core SDKs installed:
  3.1.102 [/nix/store/51zs832qmwqq8j9jimr99iglkmjmkwnc-dotnet-sdk-3.1.102/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.2 [/nix/store/51zs832qmwqq8j9jimr99iglkmjmkwnc-dotnet-sdk-3.1.102/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.2 [/nix/store/51zs832qmwqq8j9jimr99iglkmjmkwnc-dotnet-sdk-3.1.102/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

@ghost
Copy link

ghost commented Jun 17, 2020

I believe I may have an issue that is unrelated to the fix of this PR.
Is something else blocking this PR right now ?

@BananchickPasha
Copy link
Contributor Author

BananchickPasha commented Jun 17, 2020

Is something else blocking this PR right now ?

Only @edwtjo's absence I think. Is there a way to change reviewer?

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/prs-ready-for-review/3032/196

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/prs-in-distress/3604/27

@mausch
Copy link
Member

mausch commented Jul 1, 2020

Works On My Machine ™️ 🎉 (NixOS 19.09 linux-x64)

@2-bits
Copy link

2-bits commented Jul 3, 2020

I have sad to report that this does not work on my machine. I get the same error, and sadly, the splash screen for whatever reason no longer respects my DPI settings.

@mausch
Copy link
Member

mausch commented Jul 4, 2020

I just tested this also on Windows 10 WSL2 + Ubuntu 16.04 + VcXsrv 1.20.8.1 + Nix 2.3.6 and it works.
For people that still get a crash, what's your platform? Maybe try deleting ~/.local/share/JetBrains ?
Just to be super clear I'm testing this with nix run -f https://github.com/NixOS/nixpkgs/archive/b90dfdab83c196f479c2eb2209031585e7d961fc.tar.gz jetbrains.rider -c rider

FWIW I think this should be merged. It has passed all tests and it has fixed the crash at least for some people, whereas without this patch it crashes for everyone.

@2-bits
Copy link

2-bits commented Jul 4, 2020

@mausch

My platform is NixOS 20.03 and Nix 2.3.6.

So, I got the idea that if it's working for somebody else, it might be something in my local configuration that's causing the problem. I tried nuking basically any directory that looked like it might have some JetBrains stuff in it so rm -rf .cache/JetBrains/ .java/.userPrefs/jetbrains/ .local/share/JetBrains .config/JetBrains/. Unfortunately, it didn't fix it for me.

But then... I tried it your way, by which I mean I ran the command your provided ... annnnnd it worked.

So, I'm afraid I might have been muddying the waters here. I'm new to Nix and NixOS, and I was trying to get my preferred dotnet IDE running. The way I tested this pull request was to download this files changed in this pull request (the default.nix, and I also nabbed common.nix) and added this

 rider = pkgs.callPackage ~/.nix/pkgs/rider {}; 

to my packageOverrides, where .nix/pkgs/rider was where I stuck the files. I am getting the feeling that this might have not been a comprehensive or accurate way of doing things.

@ghost
Copy link

ghost commented Jul 5, 2020

I confirm that executing directly with nix run -f https://github.com/NixOS/nixpkgs/archive/b90dfdab83c196f479c2eb2209031585e7d961fc.tar.gz jetbrains.rider -c rider does work under NixOS but not if imported using an overlay.

I'm not quite sure why, I will investigate this later today.

@baracoder
Copy link
Contributor

Is there anything, that can be done to bring this PR forward?

@ghost
Copy link

ghost commented Jul 28, 2020

Is there anything, that can be done to bring this PR forward?

Figuring out why it works from a shell but not from an overlay so the fix can be used for Nix and NixOS setups might be a good start I believe ? Could not figure out the reason yet.

@baracoder
Copy link
Contributor

@elyhaka
From the crash log output you posted,

-----
JRE 1.8.0_242-b08 amd64 by Oracle Corporation
/nix/store/fdhw5sn9344w499n16jkwid7w110zrjc-openjdk-8u242-b08/lib/openjdk/jre

In the about dialogue of rider version from this pull request I get

Runtime version: 11.0.6-internal+0-adhoc..source amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

It looks like you are using a different version of the jre dependency. Is the new dependency version maybe missing in the overlay?

@Mic92 Mic92 merged commit c285657 into NixOS:master Jul 29, 2020
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

6 participants