asdfjkl / jfxchess

JFXChess - Chess Program
https://asdfjkl.github.io/jfxchess
GNU General Public License v2.0
100 stars 22 forks source link

Unable to add new engines #138

Open LuxyDuxy opened 1 year ago

LuxyDuxy commented 1 year ago

I have few uci engines and when I try to add them, I select them from the files, nothing happens, it just doesnt show up

tissatussa commented 8 months ago

i have the same here .. i'm on Xubuntu v22.04 .. it happens even when i use the newest git clone : adding an engine leads to this error (i executed Jerry v4.2.1 in terminal) :

java.io.IOException: Stream closed
        at java.base/java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:442)
        at java.base/java.io.OutputStream.write(OutputStream.java:157)
        at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
        at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
        at java.base/sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:318)
        at java.base/sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:153)
        at java.base/java.io.OutputStreamWriter.flush(OutputStreamWriter.java:251)
        at java.base/java.io.BufferedWriter.flush(BufferedWriter.java:257)
        at org.asdfjkl.jerryfx.gui.DialogEngines.btnAddEngineClicked(DialogEngines.java:287)
        at org.asdfjkl.jerryfx.gui.DialogEngines.lambda$show$3(DialogEngines.java:155)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
        at javafx.event.Event.fireEvent(Event.java:198)
        at javafx.scene.Node.fireEvent(Node.java:8886)
        at javafx.scene.control.Button.fire(Button.java:203)
        at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:208)
        at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
        at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
        at javafx.event.Event.fireEvent(Event.java:198)
        at javafx.scene.Scene$MouseHandler.process(Scene.java:3856)
        at javafx.scene.Scene.processMouseEvent(Scene.java:1851)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2584)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
        at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
        at com.sun.glass.ui.View.handleMouseEvent(View.java:556)
        at com.sun.glass.ui.View.notifyMouse(View.java:942)
        at com.sun.glass.ui.gtk.GtkApplication.enterNestedEventLoopImpl(Native Method)
        at com.sun.glass.ui.gtk.GtkApplication._enterNestedEventLoop(GtkApplication.java:347)
        at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:509)

and the engine does NOT appear in the list .. many (good, well-known) engines have this .. only a few rather unknown ones pass ..

asdfjkl commented 8 months ago

Could you help me to reproduce that - which engine? and you build directly from source, don't install via snap, correct?

tissatussa commented 8 months ago

it happens with the snap version and with the git cloned version .. and it happens with MOST engines, also a 'regular' SF binary.

tissatussa commented 8 months ago

and remember : i'm on Xubuntu Linux .. this is my java version :

$ java -version
openjdk version "11.0.20.1" 2023-08-24
OpenJDK Runtime Environment (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

i don't know what happens on Windows.

asdfjkl commented 8 months ago

Unable to reproduce here on Ubuntu 22.04....

stockfish_14053109_x64_modern
stockfish_20090216_x64_ssse
stockfish_8_x64_bmi2
stockfish-ubuntu-x86-64-avx2

Could you help by providing additional input? Where are the binaries located? It is impossible of course to add engines for the snap version, that are outside of the home directory due to the snap isolation.

What is output if you run this:

snap connections jerry

What steps are you using for the git clone version. This?!

git clone ...
cd jfxchess
mvn clean compile assembly:single
cd target
java -jar jfxchess-4.3-jar-with-dependencies.jar 
tissatussa commented 8 months ago

Where are the binaries located?

all my chess engines are inside /home/roelof/Apps/ChessEngines, they have their own subfolder ..

It is impossible of course to add engines for the snap version, that are outside of the home directory due to the snap isolation.

this is unclear to me : why should such restriction exist ? For test i even copied some engine binary (which Jerry is able to add) into /opt (a folder outside /home), and Jerry is able to add that binary and use it ! This is what i expect. I think i understand what you mean by "the snap isolation", but an engine binary can reside anywhere on the OS file tree - i guess this is true for both Windows and Linux.

What is output if you run this: snap connections jerry

$ snap connections jerry
Interface                 Plug                   Slot                             Notes
content[gnome-3-28-1804]  jerry:gnome-3-28-1804  gnome-3-28-1804:gnome-3-28-1804  -
content                   jerry:gtk-3-themes     -                                -
content                   jerry:icon-themes      -                                -
content                   jerry:sound-themes     -                                -
cups-control              jerry:cups-control     -                                -
desktop                   jerry:desktop          :desktop                         -
desktop-legacy            jerry:desktop-legacy   :desktop-legacy                  -
gsettings                 jerry:gsettings        :gsettings                       -
home                      jerry:home             :home                            -
opengl                    jerry:opengl           :opengl                          -
removable-media           jerry:removable-media  :removable-media                 manual
unity7                    jerry:unity7           :unity7                          -
wayland                   jerry:wayland          :wayland                         -
x11                       jerry:x11              :x11                             -

What steps are you using for the git clone version. This?!

Yes. And it works : the compilation of the .jar went without errors and the program runs fine. NOTE: in your file "build_instructions.txt" i find some command to "Run the program (..) by" which includes --module-path and --add-modules but i didn't use that command, because it's unclear to me what the value is of --module-path on my OS installation ..

tissatussa commented 8 months ago

i did some more investigation .. it seems the problem is solved when using the newest 4.3 by command line, as described above : all engines i add ARE excepted! However, doing the same with (snap version) 4.2.1 these fail to add ..

so, i don't know if this is due to the newer version or by not using a snap version.

asdfjkl commented 8 months ago

It is impossible of course to add engines for the snap version, that are outside of the home directory due to the snap isolation.

this is unclear to me : why should such restriction exist ? For test i even copied some engine binary (which Jerry is able to add) into /opt (a folder outside /home), and Jerry is able to add that binary and use it ! This is what i expect. I think i understand what you mean by "the snap isolation", but an engine binary can reside anywhere on the OS file tree - i guess this is true for both Windows and Linux.

A snap is not able to access the filesystem. Exceptions are only for /home/user and removable media, cf. https://snapcraft.io/docs/home-interface, unless you install the snap in --devmode, i.e. there is a different behaviour of manual compilation and running the jar vs. using the snap...

Anyway, I'll probably provide a new snap soon...

tissatussa commented 8 months ago

A snap is not able to access the filesystem. Exceptions are only for /home/user and removable media ..

i didn't know that, thanks for this info !

are you able to reproduce the error with snap version 4.2.1 ? (we don't know the version @LuxyDuxy was using..)

asdfjkl commented 8 months ago

Thanks for you help. I can reprodruce this now on a virtual machine. Will look into it...