Git Product home page Git Product logo

Comments (16)

Schmavery avatar Schmavery commented on June 27, 2024 2

@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

from reprocessing-example.

joshmhanson avatar joshmhanson commented on June 27, 2024 1

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.

from reprocessing-example.

Schmavery avatar Schmavery commented on June 27, 2024

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)?

from reprocessing-example.

joshmhanson avatar joshmhanson commented on June 27, 2024

from reprocessing-example.

joshmhanson avatar joshmhanson commented on June 27, 2024

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.

from reprocessing-example.

Schmavery avatar Schmavery commented on June 27, 2024

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 (Schmavery/reprocessing#74 (comment)) 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: bsansouci/reasongl@e664d18
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)

from reprocessing-example.

zploskey avatar zploskey commented on June 27, 2024

I just ran through the basic build process for this repo at a46f1e0 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.

from reprocessing-example.

Schmavery avatar Schmavery commented on June 27, 2024

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

from reprocessing-example.

joshmhanson avatar joshmhanson commented on June 27, 2024

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 switched 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?)

from reprocessing-example.

zploskey avatar zploskey commented on June 27, 2024

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.

from reprocessing-example.

Schmavery avatar Schmavery commented on June 27, 2024

Yeah by all means let us know if some of those aren't required haha

from reprocessing-example.

crakoucas avatar crakoucas commented on June 27, 2024

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

from reprocessing-example.

Schmavery avatar Schmavery commented on June 27, 2024

@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?

from reprocessing-example.

crakoucas avatar crakoucas commented on June 27, 2024

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 [email protected]
3 info using [email protected]
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 ]

from reprocessing-example.

bsansouci avatar bsansouci commented on June 27, 2024

@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?

from reprocessing-example.

crakoucas avatar crakoucas commented on June 27, 2024

@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

from reprocessing-example.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.