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

Trouble rendering fonts in IntelliJ when using OpenJDK from nixpkgs #29151

Closed
bbarker opened this issue Sep 9, 2017 · 7 comments · Fixed by #29634
Closed

Trouble rendering fonts in IntelliJ when using OpenJDK from nixpkgs #29151

bbarker opened this issue Sep 9, 2017 · 7 comments · Fixed by #29634

Comments

@bbarker
Copy link
Contributor

bbarker commented Sep 9, 2017

I initially posted this on StackOverflow in case it was something I was doing wrong, but as I wrote and tested I became convinced that the issue wasn't with Docker or using X in some way special, but with nixpkgs, most likely the openjdk.

Issue description

I have not tested in NixOS, but only using nixpkgs in Ubuntu 16.04. Characters in IntelliJ appear to randomly render - sometimes they do, sometimes they don't.

Steps to reproduce

Using Docker

  1. Clone this repo
  2. source build.sh
  3. ./idea.sh This will start the container
  4. idea-ultimate This should be run inside the container

Compare to https://github.com/kurron/docker-intellij which has a similar setup that this is based on, including an Ubuntu 16.04 base image but no nixpkgs, and works.

Note that idea.sh runs xhost + and performs some volume mounts, so please inspect before running if you are concerned.

Technical details

  • System: (NixOS: nixos-version, Ubuntu/Fedora: lsb_release -a, ...)
[nix-shell:~]$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
  • Nix version: (run nix-env --version)
[nix-shell:~]$ nix-env --version
nix-env (Nix) 1.11.14
  • Nixpkgs version: (run nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)
[nix-shell:~]$ nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion
"18.03pre114739.d0d905668c"
  • Sandboxing enabled: (run grep build-use-sandbox /etc/nix/nix.conf)
[nix-shell:~]$ grep build-use-sandbox /etc/nix/nix.conf
grep: /etc/nix/nix.conf: No such file or directory
@bbarker
Copy link
Contributor Author

bbarker commented Sep 11, 2017

@domenkozar @NeQuissimus @obadz (sorry if I'm pinging the wrong guys) I tried a different OpenJDK build than the one packaged with nix in the same environment, and it resolved the issue, further leading support to the idea that something in the OpenJDK build included in nixpkgs is causing the problem.

Steps to reproduce "fix":

  1. Download Zulu JDK .deb file linked above and install (e.g. in docker as root)
  2. Make sure idea.sh (e.g. /nix/store/cdrsg5p3nv7ybp1xn50z61fyp76kyc2n-idea-ultimate-2017.2.2/idea-ultimate-2017.2.2/bin/idea.sh) has JDK set to the new JDK correctly - I hacked idea.sh in the container to guarantee this, setting JDK=/usr/lib/jvm/zulu-8-amd64.
  3. run idea-ultimate as the normal user from nix-shell as above. Run ps -ga from another terminal to verify the right java is being used.

I'll plan to move ahead with my work using this workaround for now, but will note the commit that describes this issue in the above repo is 2302d4cf0a7d78c46c891548467bf8e03c9956a7.

@bbarker
Copy link
Contributor Author

bbarker commented Sep 11, 2017

Regarding step 2 in my last post, you can run idea.sh directly (same directory as idea-ultimate but not linked into path), which will run with the specified IDEA_JDK in the environment - idea-ultimate doesn't work because it overwrites these variables

@bbarker
Copy link
Contributor Author

bbarker commented Sep 14, 2017

Related: #23115

@NeQuissimus
Copy link
Member

So, I know the IDEA guys have an OpenJDK fork. I wonder if they do things they rely on. I don't have a lot of time for this right now, unfortunately...

@bbarker
Copy link
Contributor Author

bbarker commented Sep 15, 2017

Not sure - but I'm sure I've used various flavors of the OpenJDK (including Zulu but also just standard Ubuntu builds) previously with the -noJDK version of IntelliJ without this issue. At least the linked issue above proposes some nix-oriented workarounds as well.

Getting a bit off topic, but I sort of like the idea of not depending on hardcoded version values for IntelliJ anyway - though they can be updated, the 'update.pl' script is not run regularly or in an automated fashion as might be desired by a CI/CD system, so one is at the mercy of both JetBrains not keeping old versions up, and of nixpkgs not necessarily keeping up with the latest versions. Is there any sort of CI system for nixpkgs that could automatically run update.pl and generate a PR using the github hub command?

@matklad
Copy link
Member

matklad commented Sep 21, 2017

So, I know the IDEA guys have an OpenJDK fork. I wonder if they do things they rely on. I don't have a lot of time for this right now, unfortunately...

Confirmed, font rendering on Linux is one of the reasons behind JetBrains JDK existence.

@JonnyHaystack
Copy link

I'm getting what seems to be this exact same issue on 22.05 channel, and I am using the jetbrains.jdk package for IDEA 😕 appears to mostly happen with italic font or bold+italic font, but sometimes other things too. Like in this breakpoint condition text box when you expand it the rendering becomes bugged even though it's fine when not expanded.

Not expanded:
image
Expanded:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants