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

Sparrow doesn’t start on nixOS (aarch64) #1554

Open
theprivacydesigner opened this issue Dec 6, 2024 · 6 comments
Open

Sparrow doesn’t start on nixOS (aarch64) #1554

theprivacydesigner opened this issue Dec 6, 2024 · 6 comments

Comments

@theprivacydesigner
Copy link

I’m trying to run Sparrow on nixOS aarch64.
I’m getting this crash as soon as I launch Sparrow, though:

MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
No display detected. Use Sparrow Server on a headless (no display) system.

2024-12-05 22:48:17,533 ERROR [main] c.s.s.SparrowWallet [null:-1] Unable to launch application
java.lang.UnsupportedOperationException: Unable to load glass GTK library.
at javafx.graphics@22/com.sun.glass.ui.gtk.GtkApplication.lambda$new$5(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at javafx.graphics@22/com.sun.glass.ui.gtk.GtkApplication.(Unknown Source)
at javafx.graphics@22/com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(Unknown Source)
at javafx.graphics@22/com.sun.glass.ui.Application.run(Unknown Source)
at javafx.graphics@22/com.sun.javafx.tk.quantum.QuantumToolkit.startup(Unknown Source)
at javafx.graphics@22/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.graphics@22/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.graphics@22/com.sun.javafx.application.LauncherImpl.startToolkit(Unknown Source)
at javafx.graphics@22/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics@22/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

System

  • Sparrow Wallet 2.0.0
  • nixOS 24.05.6668

Details
NixOS offers a Sparrow package but it isn’t compatible with aarch64.
This means it’s necessary to rely on the generic Sparrow binary and nix-ld.
NixOS cannot run dynamically linked executables and requires instead to create a library path that only applies to Sparrow.
The difficult part is listing out all the libraries Sparrow might need.
So far I have:

  • xorg.libX11
  • libGL
  • gtk4

Could you please help me figure out which other libraries Sparrow relies on?

@sparrowwallet sparrowwallet deleted a comment Dec 6, 2024
@craigraw
Copy link
Collaborator

craigraw commented Dec 9, 2024

Here are the dependencies listed in the .deb control file:

Depends: libasound2, libbsd0, libc6, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxi6, libxrender1, libxtst6, xdg-utils 

Probably, not all of these are actually used, but I haven't tried reducing the set yet as they seem fairly standard.

For the error you encountered, it may be worth prioritising software over hardware rendering with

_JAVA_OPTIONS=-Dprism.order=sw /opt/sparrow/bin/Sparrow

@theprivacydesigner
Copy link
Author

Thank you, Craig.
Let me try and report back.

@craigraw
Copy link
Collaborator

Any feedback?

@theprivacydesigner
Copy link
Author

Here’s where I’m at — for each library listed in the .deb I found the corresponding library in nixOS.

libasound2: alsa-lib
libbsd0: libbsd
libc6: glibc
libx11-6: xorg.libX11
libxau6: xorg.libXau
libxcb1: xorg.libxcb 
libxdmcp6: xorg.libXdmcp
libxext6: xorg.libXext
libxi6: xorg.libXi
libxrender1: xorg.libXrender
libxtst6: xorg.libXtst
xdg-utils: xdg-utils

Which I’ve then listed in my configuration.nix

...
# nix-ld
  programs.nix-ld.enable = true;
  programs.nix-ld.libraries = with pkgs; [
    glibc
    xorg.libX11
    libGL
    gtk4
    pkg-config
    xdg-utils
    xorg.libXtst
    xorg.libXrender
    libextractor
    xorg.libXdmcp
    libbsd
    alsa-lib
    xorg.libXau
    xorg.libxcb
    xorg.libXext
    xorg.libXi
  ];
...

I can get Sparrow to tell me its version or print the help (./Sparrow -v and ./Sparrow -h).

When I try to launch it, though, I still get this error (./Sparrow -t gives the same error):

MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
No display detected. Use Sparrow Server on a headless (no display) system.

I’m unsure of what I’m doing wrong.
Please do let me know if you have any thoughts on what might be going wrong.

@craigraw
Copy link
Collaborator

Did you try prioritising software rendering as per my earlier post?

@theprivacydesigner
Copy link
Author

Apologies for not trying earlier. I just did and I get this:

$ _JAVA_OPTIONS=-Dprism.order=sw ./Sparrow
Picked up _JAVA_OPTIONS: -Dprism.order=sw
No display detected. Use Sparrow Server on a headless (no display) system.

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

No branches or pull requests

2 participants