Open joshmhanson opened 6 years ago
Do any of the executables exist in the lib folder? ex: lib/bs/native/index.native
or lib/bs/bytecode/indexhot.byte
?
If so, I'm guessing you get the same result when invoking those binaries directly (taking npm out of the equation)?
Yep that's correct. When attempting to run the files directly, I got the plain "operation not supported" error without all the surrounding npm-generated noise.
On Tue, Oct 23, 2018, 6:39 PM Avery Morin notifications@github.com wrote:
Do any of the executables exist in the lib folder? ex: lib/bs/native/index.native or lib/bs/bytecode/indexhot.byte? If so, I'm guessing you get the same result when invoking those binaries directly (taking npm out of the equation)?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bsansouci/reprocessing-example/issues/13#issuecomment-432447277, or mute the thread https://github.com/notifications/unsubscribe-auth/AFbnYlBgx7urvm8J6ATwYt4HmzkOd2FSks5un5qTgaJpZM4X0wdl .
To follow up on this: I tried it on a different computer (also Ubuntu 18.04) but one that didn't have OCaml installed. I made a fresh install of ReasonML and followed the exact instructions for the reprocessing-example.
This time, I got almost exactly the same result except that the error is different. Under Wayland, it would say "wayland not available", and underxorg, it says that there's no graphics device available.
Hmm, thanks for following up. The issue with an existing ocaml install might be something @bsansouci is interested in for bsb-native, whereas the graphics device issue seems like more complications with how we're building sdl2 on linux (which has ended up being very picky).
You can see we've tried to fix this a couple of different ways (https://github.com/Schmavery/reprocessing/issues/74#issuecomment-390326310) but it looks like there's something we've overlooked, so thanks for pointing it out! Likely we will need as much of your help as we can get to help debug it as we're pretty much guessing when it comes to some of this linux configuration stuff.
We do this hack to try and detect and enable wayland support: https://github.com/bsansouci/reasongl/commit/e664d18961a49960fbedb8fcaa941a7b45276fe3
but maybe it isn't getting detected properly on your machine. Can you try setting the environment variable SDL_VIDEODRIVER=wayland
manually before running the reprocessing binary? If we're lucky, that will work.
If that doesn't work and you want to fiddle with how we invoke the configure command for building sdl2, you can find that here: https://github.com/bsansouci/SDL-mirror/blob/fast/postinstall.js#L74
cc @zploskey fwiw as he was invaluable last time we had issues like this (in case you're interested)
I just ran through the basic build process for this repo at a46f1e0d32a4e1f122ce092f6ecd57e3d968071d on Ubuntu 18.04 running Xorg. It does not deal well with having an ocaml compiler in the path (at least not the 4.06.1 opam switch I was on), complaining about a DLL. Once I removed my opam binaries from the path, though, everything built fine and I was able to run them demo for both bytecode and native.
I would suggest perhaps installing the same packages that we pull in to run the Travis build: https://github.com/Schmavery/reprocessing/blob/master/.travis.yml
sudo apt install libsdl2-dev fcitx-libs-dev libibus-1.0-dev
I have these installed and it works. I think the goal is to be able to build without having to manually install additional packages, so we may need to work on making sure we install all required dependencies in one way or another. I've said before I don't think Linux users would mind having to install their system SDL library rather than building it ourselves as long as its spelled out in the instructions. Currently I think we're missing some required dependencies on Linux.
Thanks for trying it on your machine! If that's what it takes, we can definitely add a note about that and then potentially look into fixing it
Thanks for your feedback @Schmavery and @zploskey.
I did try it again quickly this morning with the SDL_VIDEODRIVER=wayland
and this did not change anything under Wayland.
Regarding having OCaml in the path, I originally had OCaml 4.07 installed and encountered the same Fatal error: cannot load shared library dllunix
issue as was experienced in #8. I opam switch
ed to the BuckleScript fork of the OCaml compiler, which resolved this particular issue on the machine where I had OCaml installed.
I'll also note that opam 2.0 supports local switches so this should hypothetically make it possible to work around the global OCaml installation issue by having a local OCaml switch set to the BuckleScript fork. I haven't tested this yet.
When I get the chance I will make another attempt after installing the dependencies you mention above on both my system with OCaml and my system without OCaml. (By the way, libsdl2-dev
is unsurprising, but why fcitx and ibus?)
Feel free to try it without fcitx and/or ibus and see if you have any issues. That list came out of some experimentation when setting up TravisCI for Reprocessing.
Yeah by all means let us know if some of those aren't required haha
You were right: SDL2 wasn't enough. sudo apt install libsdl2-dev fcitx-libs-dev libibus-1.0-dev
and then rebuilding reprocessing was necessary to get it working in both native and bytecode. At some point I will attempt testing a local opam switch as well.
@hanjiexi for now, I added a note to the reprocessing repo that linux users may need those deps. Thanks for following up. https://github.com/Schmavery/reprocessing/blob/master/README.md#getting-started
Same error - Ubuntu 18.10 - Gnome - Wayland
Fatal error: exception Failure("Unknown error while loading plugin: Failure(\"wayland not available\")")
Works well under Ubuntu 18.10 - Gnome - Xorg
@crakoucas sorry to hear that, can you give a couple more details and let us know what happens when you try the debugging steps above?
I Follow the Readme for the install with
sudo apt install libsdl2-dev fcitx-libs-dev libibus-1.0-dev
Everything works fine on Ubuntu 18.10 Opengl but in Wayland =>
npm start
> reprocessing-example@ start /home/renaud/Dev/reprocessing-example
> ./lib/bs/bytecode/indexhot.byte
ninja: no work to do.
bsb running with pid: 19522
Reloading hotloaded module
Successfully changed functions
Fatal error: exception Failure("Unknown error while loading plugin: Failure(\"wayland not available\")")
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! reprocessing-example@ start: `./lib/bs/bytecode/indexhot.byte`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the reprocessing-example@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/renaud/.npm/_logs/2019-01-30T17_16_10_342Z-debug.log
Debug.log
❯ cat /home/renaud/.npm/_logs/2019-01-30T17_21_23_335Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli '/home/renaud/.npm-packages/bin/npm',
1 verbose cli 'run',
1 verbose cli 'start' ]
2 info using npm@6.7.0
3 info using node@v10.15.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle reprocessing-example@~prestart: reprocessing-example@
6 info lifecycle reprocessing-example@~start: reprocessing-example@
7 verbose lifecycle reprocessing-example@~start: unsafe-perm in lifecycle true
8 verbose lifecycle reprocessing-example@~start: PATH: /home/renaud/.npm-packages/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/renaud/Dev/reprocessing-example/node_modules/.bin:/home/renaud/go/bin:/home/renaud/.rbenv/plugins/ruby-build/bin:/home/renaud/.rbenv/shims:/home/renaud/.rbenv/shims:/home/renaud/.rbenv/bin:/home/renaud/.npm-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/renaud/Android/Sdk/tools:/home/renaud/Android/Sdk/tools/bin:/home/renaud/Android/Sdk/platform-tools:/home/renaud/Android/Sdk/emulator:/home/renaud/.fzf/bin
9 verbose lifecycle reprocessing-example@~start: CWD: /home/renaud/Dev/reprocessing-example
10 silly lifecycle reprocessing-example@~start: Args: [ '-c', './lib/bs/bytecode/indexhot.byte' ]
11 silly lifecycle reprocessing-example@~start: Returned: code: 2 signal: null
12 info lifecycle reprocessing-example@~start: Failed to exec start script
13 verbose stack Error: reprocessing-example@ start: `./lib/bs/bytecode/indexhot.byte`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (/home/renaud/.npm-packages/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (/home/renaud/.npm-packages/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid reprocessing-example@
15 verbose cwd /home/renaud/Dev/reprocessing-example
16 verbose Linux 4.18.0-13-generic
17 verbose argv "/usr/bin/node" "/home/renaud/.npm-packages/bin/npm" "run" "start"
18 verbose node v10.15.1
19 verbose npm v6.7.0
20 error code ELIFECYCLE
21 error errno 2
22 error reprocessing-example@ start: `./lib/bs/bytecode/indexhot.byte`
22 error Exit status 2
23 error Failed at the reprocessing-example@ start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
@crakoucas Thanks for the debug info. Do you have the WAYLAND_DISPLAY
env variable set to something? We'd added this hack to fix Wayland support but it might not be reliable. Can you try setting SDL_VIDEODRIVER=wayland
before running the executable?
Does this also happen in native?
Alternatively do you have XDG_SESSION_TYPE
set to anything?
@bsansouci WAYLAND_DISPLAY is set to
WAYLAND_DISPLAY=wayland-0
and when i try with SDL_VIDEODRIVER=wayland
=> Same error also in native
npm run start:native
> reprocessing-example@ start:native /home/renaud/Dev/reprocessing-example
> ./lib/bs/native/index.native
Fatal error: exception Failure("wayland not available")
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! reprocessing-example@ start:native: `./lib/bs/native/index.native`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the reprocessing-example@ start:native script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/renaud/.npm/_logs/2019-01-30T20_46_38_552Z-debug.log
And finally XDG_SESSION_TYPE
is set to wayland
System: Ubuntu 18.04. Note that I happen to have an OCaml compiler installed (the BuckleScript version), but this shouldn't make a difference.
All three
build
commands worked fine, but the two of the threestart
commands are not working, as you can see below.start:native
Referenced debug log:
start
Referenced debug log:
Appreciate any help!