Skip to content

jetbrains-jdk: add JCEF support#196738

Merged
K900 merged 1 commit intoNixOS:masterfrom
GenericNerdyUsername:jetbrains-jcef
Jan 14, 2023
Merged

jetbrains-jdk: add JCEF support#196738
K900 merged 1 commit intoNixOS:masterfrom
GenericNerdyUsername:jetbrains-jcef

Conversation

@GenericNerdyUsername
Copy link
Contributor

@GenericNerdyUsername GenericNerdyUsername commented Oct 19, 2022

Description of changes

Update the jetbrains jdk, but also add JCEF support, allowing the markdown plugin in jetbrains IDEs to work correctly.
Closes #160468 and #143122. Also updates the IDEs.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.11 Release Notes (or backporting 22.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 8.has: clean-up This PR removes packages or removes other cruft 8.has: package (new) This PR adds a new package labels Oct 19, 2022
@ofborg ofborg bot requested a review from edwtjo October 19, 2022 10:44
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Oct 19, 2022
@GenericNerdyUsername GenericNerdyUsername force-pushed the jetbrains-jcef branch 2 times, most recently from 7399335 to 6f0a186 Compare October 23, 2022 16:33
@ifropc
Copy link

ifropc commented Nov 2, 2022

Thank you for the fix!
Can confirm it fixes mardown rendering issues in IDEA.
Would be happy to see it merged @edwtjo

@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/1402

@GenericNerdyUsername GenericNerdyUsername changed the title jetbrains-jdk: 17.0.3-b469.37 -> 17.0.4.1-b629.2, add JCEF support jetbrains-jdk: 17.0.3-b469.37 -> 17.0.5-b653.14, add JCEF support Dec 6, 2022
@ifropc
Copy link

ifropc commented Dec 6, 2022

After upgrading to the latest version opening project containing kotlin files make idea to be stuck on "looking up kotlin script definition..." background task @GenericNerdyUsername can you take a look please? (as alternative, I'd just rollback the sdk)

@GenericNerdyUsername
Copy link
Contributor Author

GenericNerdyUsername commented Dec 7, 2022

Does this still happen on the main branch, without jcef? Can you diff the logs with/without jcef and show me the result?

@GenericNerdyUsername GenericNerdyUsername changed the title jetbrains-jdk: 17.0.3-b469.37 -> 17.0.5-b653.14, add JCEF support jetbrains-jdk: add JCEF support Dec 7, 2022
@GenericNerdyUsername
Copy link
Contributor Author

@ifropc

@l0b0
Copy link
Contributor

l0b0 commented Dec 13, 2022

Does this close #150579 as well?

@niknetniko
Copy link
Contributor

If I run this (using the latest NixOS unstable), I get this error when running Intellij IDEA:

image

Do I need to change something else?

@GenericNerdyUsername
Copy link
Contributor Author

Does this close #150579 as well?

I can view markdown files in clion with this

@GenericNerdyUsername
Copy link
Contributor Author

If I run this (using the latest NixOS unstable), I get this error when running Intellij IDEA:

image

Do I need to change something else?

I fixed this in my overlay, forgot to push changes here

@GenericNerdyUsername
Copy link
Contributor Author

Should be working now

Copy link
Contributor

@niknetniko niknetniko left a comment

Choose a reason for hiding this comment

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

Tested with both Intellij and Clion, both work. Very nice work!

@ifropc
Copy link

ifropc commented Dec 21, 2022

@GenericNerdyUsername sorry for the late response, for some reason I didn't received a notification on my mail.
I had the same issue with 4c5a2e44561f4991d568d7bb7dc68d56a73a5d6c version. The one from unstable works just fine. 6f0a18633d59a73c90d29446e1f85e4f1a233e86 also works just fine.
Very strange error. Tried to clean caches, didn't really help. I got the log from the unsuccessful run if you are curious: https://paste.apache.org/u6jua
ClassCastException is what causes this behavior is my guess.
The last IllegalStateException can be ignored, it happens when I close IDE.

FYI: could be related to https://youtrack.jetbrains.com/issue/IDEA-304608/Background-tasks-get-stuck-with-custom-Boot-Java-Runtime : build is 222 and jbr is (my guess) 223

Result of about section

4c5a2e44561f4991d568d7bb7dc68d56a73a5d6c:

IntelliJ IDEA 2022.2.3 (Community Edition)
Build #IC-222.4345.14, built on October 4, 2022
Runtime version: 17.0.5+8-nixos amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.0.11
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 20
Non-Bundled Plugins:
    wu.seal.tool.jsontokotlin (3.7.4)
    org.jetbrains.kotlin (222-1.7.21-release-272-IJ4167.29)
    com.facebook.ktfmt_idea_plugin (1.1.0.42)
    IdeaVIM (1.11.1)
    com.godwin.kdocer (1.6)

Kotlin: 222-1.7.21-release-272-IJ4167.29
Current Desktop: sway

And unstable:

IntelliJ IDEA 2022.2.3 (Community Edition)
Build #IC-222.4345.14, built on October 4, 2022
Runtime version: 17.0.5+8-nixos amd64
VM: OpenJDK 64-Bit Server VM by N/A
Linux 6.0.11
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 20
Non-Bundled Plugins:
    wu.seal.tool.jsontokotlin (3.7.4)
    org.jetbrains.kotlin (222-1.7.21-release-272-IJ4167.29)
    com.facebook.ktfmt_idea_plugin (1.1.0.42)
    IdeaVIM (1.11.1)
    com.godwin.kdocer (1.6)

Kotlin: 222-1.7.21-release-272-IJ4167.29
Current Desktop: sway

@GenericNerdyUsername
Copy link
Contributor Author

@ifropc what happens if you use the latest IntelliJ?

@ifropc
Copy link

ifropc commented Dec 21, 2022

@GenericNerdyUsername Do you mean from unstable? It works just fine

@GenericNerdyUsername
Copy link
Contributor Author

I mean using this jdk with intellij 2022.3.1

@ifropc
Copy link

ifropc commented Dec 21, 2022

It will probably work, but version in master is 222, so if PR is merged as is, it will break things for somebody else too (potentially)
I would say it's a good idea to either rollback SDK or upgrade IDEA in this PR to 223

@GenericNerdyUsername GenericNerdyUsername force-pushed the jetbrains-jcef branch 3 times, most recently from fb4f921 to d2231fc Compare December 23, 2022 09:41
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Dec 23, 2022
@GenericNerdyUsername
Copy link
Contributor Author

@ifropc do things work now?

@ifropc
Copy link

ifropc commented Dec 23, 2022

@GenericNerdyUsername yes, everything is working now, thank you very much for your patience!

@K900
Copy link
Contributor

K900 commented Jan 8, 2023

Can confirm PyCharm Professional builds and runs fine with this, including the web stuff. I'm inclined to merge this unless someone objects.

@tlipinski
Copy link

I've just fixed Gitlab Merge Request plugin with it - thanks!:)

@K900
Copy link
Contributor

K900 commented Jan 13, 2023

Can you please fix the merge conflict?

@GenericNerdyUsername
Copy link
Contributor Author

Done

@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. and removed 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. labels Jan 14, 2023
@K900 K900 merged commit bc4afb6 into NixOS:master Jan 14, 2023
@GenericNerdyUsername GenericNerdyUsername deleted the jetbrains-jcef branch January 14, 2023 17:03
@l0b0
Copy link
Contributor

l0b0 commented Jan 15, 2023

Fantastic work, all! Is anyone working on porting this to 22.11?

@GenericNerdyUsername
Copy link
Contributor Author

GenericNerdyUsername commented Jan 15, 2023

Cherry picking this commit on top of the 22.11 branch lets it compile if you apply this patch

diff --git a/pkgs/development/compilers/jetbrains-jdk/default.nix b/pkgs/development/compilers/jetbrains-jdk/default.nix
index 3d1e8a30434..ebeb218c1b5 100644
--- a/pkgs/development/compilers/jetbrains-jdk/default.nix
+++ b/pkgs/development/compilers/jetbrains-jdk/default.nix
@@ -29,8 +29,8 @@
 
 openjdk17.overrideAttrs (oldAttrs: rec {
   pname = "jetbrains-jdk-jcef";
-  javaVersion = "17.0.5";
-  build = "653.14";
+  javaVersion = "17.0.3";
+  build = "653";
   # To get the new tag:
   # git clone https://github.com/jetbrains/jetbrainsruntime
   # cd jetbrainsruntime
@@ -88,7 +88,7 @@ openjdk17.overrideAttrs (oldAttrs: rec {
     runHook preInstall
 
     rm -rf build/linux-x86_64-server-${buildType}/images/jdk
-    mv build/linux-x86_64-server-${buildType}/images/jbrsdk${jcefSuffix}-${javaVersion}-linux-x64${debugSuffix}-b${build} build/linux-x86_64-server-${buildType}/images/jdk
+    mv build/linux-x86_64-server-${buildType}/images/jbrsdk${jcefSuffix}-${javaVersion}-x64${debugSuffix}-b${build} build/linux-x86_64-server-${buildType}/images/jdk
   '' + oldAttrs.installPhase + "runHook postInstall";
 
   postInstall = ''

All that should be needed is testing and making a pr, but I'm too tired to do that rn. Would you be ok with doing that @l0b0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: clean-up This PR removes packages or removes other cruft 8.has: package (new) This PR adds a new package 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: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JetBrains JDK does not support JCEF

7 participants