Commit b707af9a authored by Bjørn Forsman's avatar Bjørn Forsman
Browse files

apache-directory-studio: fix startup by creating /tmp/SWT-GDBusServer

Before:

  $ ./result/bin/ApacheDirectoryStudio
  SWT WebKitGDBus: error creating DBus server Error binding to address (GUnixSocketAddress): No such file or directory
  SWT WebKit: error initializing DBus server, dBusServer == 0

  (Apache Directory Studio:1218305): GLib-GIO-CRITICAL **: 15:17:33.727: g_dbus_server_get_client_address: assertion 'G_IS_DBUS_SERVER (server)' failed
  #
  # A fatal error has been detected by the Java Runtime Environment:
  #
  #  SIGSEGV (0xb) at pc=0x00007fe033c36f48, pid=1218305, tid=1218306
  #
  # JRE version: OpenJDK Runtime Environment (21.0.5+1) (build 21.0.5+1-nixos)
  # Java VM: OpenJDK 64-Bit Server VM (21.0.5+1-nixos, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
  # Problematic frame:
  # C  [libswt-gtk-4940r23.so+0x36f48]  Java_org_eclipse_swt_internal_C_strlen+0xf
  #
  # Core dump will be written. Default location: Core dumps may be processed with "/nix/store/jz45idky1nhvf3c9gz20ds2py19kdvgf-systemd/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/bf/nixpkgs/core.1218305)
  #
  # An error report file with more information is saved as:
  # /home/bf/nixpkgs/hs_err_pid1218305.log
  [2.073s][warning][os] Loading hsdis library failed
  #
  # If you would like to submit a bug report, please visit:
  #   https://bugreport.java.com/bugreport/crash.jsp
  # The crash happened outside the Java Virtual Machine in native code.
  # See problematic frame for where to report the bug.
  #

After:

  $ ./result/bin/ApacheDirectoryStudio
  ** (WebKitWebProcess:1221467): ERROR **: 15:18:35.064: Failed to create server: Error binding to address (GUnixSocketAddress): No such file or directory

...but the GUI opens and the application seems fine.
Tested on NixOS with GNOME (Wayland).

Fixes https://github.com/nixos/nixpkgs/issues/333377.
parent 83d69521
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -56,6 +56,10 @@ stdenv.mkDerivation rec {
    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
        "$dest/ApacheDirectoryStudio"

    # About `/tmp/SWT-GDBusServer`, see
    # https://github.com/adoptium/adoptium-support/issues/785#issuecomment-1866680133
    # and
    # https://github.com/adoptium/adoptium-support/issues/785#issuecomment-2387481967.
    makeWrapper "$dest/ApacheDirectoryStudio" \
        "$out/bin/ApacheDirectoryStudio" \
        --prefix PATH : "${jdk}/bin" \
@@ -64,7 +68,8 @@ stdenv.mkDerivation rec {
            glib
            webkitgtk_4_0
          ])
        }
        } \
        --run "mkdir -p /tmp/SWT-GDBusServer"
    install -D icon.xpm "$out/share/pixmaps/apache-directory-studio.xpm"
    install -D -t "$out/share/applications" ${desktopItem}/share/applications/*
  '';