oakes / Paravim

A Vim-based editor for Clojure
https://sekao.net/paravim/
The Unlicense
181 stars 6 forks source link

[Solved] Failed to start on Linux #6

Closed mdrobulis closed 4 years ago

mdrobulis commented 4 years ago

Ran this

clojure -Sdeps "{:deps {paravim {:mvn/version \""RELEASE\""}}}" -m paravim.start

got an exception (stacktrace below )

looks like libvim-clj is using /tmp/lwjgl + $username' + /3.2.3-build-13/libvim.so
path to load the binary and is failing.

{:clojure.main/message
 "Execution error (UnsatisfiedLinkError) at org.lwjgl.system.linux.LinuxLibrary/loadLibrary (LinuxLibrary.java:32).\nFailed to dynamically load library: /tmp/lwjglmdrobulis/3.2.3-build-13/libvim.so(error = null)\n",
 :clojure.main/triage
 {:clojure.error/class java.lang.UnsatisfiedLinkError,
  :clojure.error/line 32,
  :clojure.error/cause
  "Failed to dynamically load library: /tmp/lwjglmdrobulis/3.2.3-build-13/libvim.so(error = null)",
  :clojure.error/symbol
  org.lwjgl.system.linux.LinuxLibrary/loadLibrary,
  :clojure.error/source "LinuxLibrary.java",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.lang.UnsatisfiedLinkError,
    :message
    "Failed to dynamically load library: /tmp/lwjglmdrobulis/3.2.3-build-13/libvim.so(error = null)",
    :at
    [org.lwjgl.system.linux.LinuxLibrary
     loadLibrary
     "LinuxLibrary.java"
     32]}],
  :trace
  [[org.lwjgl.system.linux.LinuxLibrary
    loadLibrary
    "LinuxLibrary.java"
    32]
   [org.lwjgl.system.linux.LinuxLibrary <init> "LinuxLibrary.java" 19]
   [org.lwjgl.system.APIUtil apiCreateLibrary "APIUtil.java" 123]
   [org.lwjgl.system.Library loadNative "Library.java" 360]
   [org.lwjgl.system.Library
    loadNativeFromLibraryPath
    "Library.java"
    349]
   [org.lwjgl.system.Library loadNative "Library.java" 264]
   [org.lwjgl.system.Library loadNative "Library.java" 222]
   [org.lwjgl.system.Library loadNative "Library.java" 203]
   [org.lwjgl.system.Library loadNative "Library.java" 185]
   [libvim_clj.core$__GT_vim$fn__6534 invoke "core.clj" 64]
   [libvim_clj.core$__GT_vim invokeStatic "core.clj" 63]
   [libvim_clj.core$__GT_vim invoke "core.clj" 53]
   [paravim.vim$__GT_vim invokeStatic "vim.clj" 271]
   [paravim.vim$__GT_vim invoke "vim.clj" 270]
   [paravim.start$init invokeStatic "start.clj" 241]
   [paravim.start$init invoke "start.clj" 239]
   [paravim.start$start invokeStatic "start.clj" 266]
   [paravim.start$start invoke "start.clj" 264]
   [paravim.start$_main invokeStatic "start.clj" 285]
   [paravim.start$_main doInvoke "start.clj" 283]
   [clojure.lang.RestFn invoke "RestFn.java" 397]
   [clojure.lang.AFn applyToHelper "AFn.java" 152]
   [clojure.lang.RestFn applyTo "RestFn.java" 132]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.core$apply invokeStatic "core.clj" 665]
   [clojure.main$main_opt invokeStatic "main.clj" 514]
   [clojure.main$main_opt invoke "main.clj" 510]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause
  "Failed to dynamically load library: /tmp/lwjglmdrobulis/3.2.3-build-13/libvim.so(error = null)"}}
oakes commented 4 years ago

What distro are you using? If it's Arch, please try the solution in #5

mdrobulis commented 4 years ago
$ uname -a
Linux yoga 5.0.0-23-generic #24-Ubuntu SMP Mon Jul 29 15:36:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
mdrobulis commented 4 years ago

could be related Library error

oakes commented 4 years ago

If you want to test whether it is failing to load any LWJGL native library, you could clone play-cljc-examples and try running clj -A:dev native in one of the subfolders. If it fails to run the game at all, then maybe the problem is with LWJGL's native library loader (which libvim-clj uses).

mdrobulis commented 4 years ago

dungeon-crawler

2019-11-26 00:30:43.050:INFO::main: Logging initialized @7038ms to org.eclipse.jetty.util.log.StdErrLog
Execution error (LineUnavailableException) at com.sun.media.sound.DirectAudioDevice$DirectDL/implOpen (DirectAudioDevice.java:503).
line with format PCM_SIGNED 44100.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian not supported.

Super-koalio

2019-11-26 00:31:39.350:INFO::main: Logging initialized @6567ms to org.eclipse.jetty.util.log.StdErrLog
java.lang.UnsatisfiedLinkError: Failed to dynamically load library: /tmp/lwjglmdrobulis/3.2.3-build-13/libvim.so(error = null)
        at org.lwjgl.system.linux.LinuxLibrary.loadLibrary(LinuxLibrary.java:32)
oakes commented 4 years ago

Did a window not launch in either case? Paravim is built into the dev command but it's surrounded by a try/catch so it shouldn't prevent the game from launching...

mdrobulis commented 4 years ago

The game launched but Paravim did not... source of the message in LWJGL

mdrobulis commented 4 years ago

the path used to load the libvim.so on my system is /tmp/lwjglmdrobulis/3.2.3-build-13/libvim.so

oakes commented 4 years ago

Just a shot in the dark, but in case it's the same problem as the Arch issue, can you check if you have libtinfo5 installed? sudo apt install libtinfo5

The unsatisfiedlinkerrors from java are difficult because they don't say what system library it couldn't find. AFAIK the only reliable way to get a more specific error is to try to build libvim.so yourself via this repo...

mdrobulis commented 4 years ago
sudo apt install libtinfo5

and it works. I thoght it's due to 3.2.3 RELEASE

Core: The Library.loadSystem & Library.loadNative methods now require a module name parameter. (S)

SOURCE

oakes commented 4 years ago

Yeah the loadNative method had a breaking change which was annoying, but libvim-clj should be calling it correctly as of 3.2.3. So it works now? Maybe I should add a note to the website so more people see it.

mdrobulis commented 4 years ago

Worked fine... till

(slurp "http://google.com")

thats one long line :rofl:

oakes commented 4 years ago

Oh yeah the REPL prints really slowly, I plan on working on that soon. It basically locks up the editor while it prints.

oakes commented 4 years ago

I added a note to the readme. I'll put it on the website as well when i get the chance.