Open jdeisenberg opened 6 years ago
Ah ok, this looks like this issue: https://github.com/bsansouci/reprocessing-example/issues/7 Sorry we didn't get around to fixing it! haha
Do you mind trying to edit your node_modules/sdl2/postinstall.js
at line 135:
platformspecificargs = `"-lasound", "-lm", "-ldl", "-lpthread", "-lrt"`
and remove the "-lasound",
like so:
platformspecificargs = `"-lm", "-ldl", "-lpthread", "-lrt"`
and then try to bsb -clean-world
and bsb -make-world
?
If that works, we should be able to just remove that from master and you should be good to go :)
If this doesn't work, we'll probably need to add a note to the README for people with this issue to sudo apt install libasound2-dev
or similar, but I'd love to avoid that if we can :)
As usual, we apologize for the flakiness of our linux support and greatly appreciate the troubleshooting help :)
Still has a problem:
david@linux:~/reasonml-playground/reprocessing01> bsb -clean-world
ninja: error: loading 'build.ninja': No such file or directory
ninja clean failed
ninja: error: loading 'build.ninja': No such file or directory
ninja clean failed
ninja: error: loading 'build.ninja': No such file or directory
ninja clean failed
ninja: error: loading 'build.ninja': No such file or directory
ninja clean failed
ninja: error: loading 'build.ninja': No such file or directory
ninja clean failed
ninja: error: loading 'build.ninja': No such file or directory
ninja clean failed
david@linux:~/reasonml-playground/reprocessing01> bsb -make-world
[2/2] Building fake_src/sdl_index.mlast.d
[1/1] Building fake_src/sdl_index.cmj
[2/2] Building src/tsdl_new.mlast.d
[1/1] Building src/tsdl_new.cmj
FAILED: src/tsdl_new.cmj /home/david/reasonml-playground/reprocessing01/node_modules/Tsdl/lib/js/src/tsdl_new.js src/tsdl_new.cmi
/home/david/.nvm/versions/node/v10.1.0/lib/node_modules/bs-platform/lib/bsc.exe -bs-package-name Tsdl -bs-package-output commonjs:lib/js/src -bs-assume-no-mli -bs-no-builtin-ppx-ml -bs-no-implicit-include -I /home/david/reasonml-playground/reprocessing01/node_modules/sdl2/lib/ocaml -I src -w -30-40+6+7+27+32..39+44+45+101 -nostdlib -I '/home/david/reasonml-playground/reprocessing01/node_modules/bs-platform/lib/ocaml' -no-alias-deps -color always -bs-re-out -bs-super-errors -o src/tsdl_new.cmj -c src/tsdl_new.mlast
ninja: build stopped: subcommand failed.
Failure: /home/david/.nvm/versions/node/v10.1.0/lib/node_modules/bs-platform/lib/ninja.exe
Location: /home/david/reasonml-playground/reprocessing01/node_modules/Tsdl/lib/bs
(Also, my version of OpenSUSE doesn’t appear to have libasound2-dev
or its equivalent)
Sorry, I should have been clearer with the commands, if you have a global bs-platform install, bsb -make-world
is going to be using that instead of the (bsb-native) local one.
Does npm run clean
followed by npm run build
work any better?
./node_modules/.bin/bsb -make-world
seems to have worked (after npm run clean
) -- at least there are no errors, but there is no lib/js
directory, which index.html
seems to want [further edit: I need to do npm build:web
]
@jdeisenberg so it sounds like removing that -lasound
flag fixed your problem (once you built using the local bsb)? If so I'll remove it in https://github.com/bsansouci/SDL-mirror/blob/fast/postinstall.js#L135 and hopefully we'll be able to take care of this issue for good 😄
Yeah, with bsb-native you specify whether you want to build to native/bytecode or to js separately. Since the first "target" in the bsconfig.json is a bytecode target, it defaults to that if you don't specify a backend (like what the npm build:web
script does).
When trying to load the index.html
file in the browser from File > Open
menu, I get these errors in the web console:
XML Parsing Error: not well-formed
Location: file:///home/david/reasonml-playground/reprocessing01/lib/js/src/index.js
Line Number 1, Column 1: index.js:1:1
Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead[Learn More] require_polyfill.js:82
XML Parsing Error: not well-formed
Location: file:///home/david/reasonml-playground/reprocessing01/node_modules/Reprocessing/lib/js/src/Reprocessing.js
Line Number 1, Column 1: Reprocessing.js:1:1
Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead[Learn More] require_polyfill.js:368
XML Parsing Error: not well-formed
Location: file:///home/david/reasonml-playground/reprocessing01/node_modules/bs-platform/lib/js/sys.js
Line Number 1, Column 13: sys.js:1:13
[[ snip many repetitions]]
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///home/david/reasonml-playground/reprocessing01/node_modules/Reasongl/lib/js/src/RGLConstants.js. (Reason: CORS request not http).
The last error tells me that I have to run the code from a server (cross-site scripting error), so I did that, and get this set of errors:
Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead[Learn More] require_polyfill.js:82
Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead[Learn More] require_polyfill.js:368
[[snip many similar errors]]
SyntaxError: expected expression, got '<'[Learn More] require_polyfill.js:48
loadScript
http://roombook.evc.test/reprocessing01/require_polyfill.js:146:10
require node_modules/Reprocessing/lib/js/src/Reprocessing.js:36:18 <anonymous> node_modules/Reprocessing/lib/js/src/Reprocessing.js:55:34 loadScript
http://roombook.evc.test/reprocessing01/require_polyfill.js:146:10
require lib/js/src/index.js:36:18 <anonymous> lib/js/src/index.js:51:30 loadScript
http://roombook.evc.test/reprocessing01/require_polyfill.js:146:10
<anonymous>
http://roombook.evc.test/reprocessing01/require_polyfill.js:149:1
@jdeisenberg the issue you were originally experiencing should have nothing to do with the web build of reprocessing and should only occur when building to native or bytecode. You can try running npm run start
or ./lib/bs/bytecode/indexhot.byte
to test after running npm run build
or ./node_modules/.bin/bsb -make-world
I'm not sure what's going on in your web build, seems like maybe require_polyfill is getting confused somehow. Can you share what browser you're using and how you're running the server? To test, we frequently just use python -m SimpleHTTPServer
or similar. @bsansouci have you seen this before?
npm run start
appeared to work nicely.
I am using Server version: Apache/2.4.23 (Linux/SUSE), testing on browsers: Firefox Developer Edition 61.0b6 (64-bit) and Version 66.0.3359.170 (Official Build) (64-bit)
Mmmh weird, why is the -lasound
still there? https://github.com/bsansouci/SDL-mirror/blob/eb7279c6f7235ca03b40775b64de7f04ed29fdfc/postinstall.js#L21
@bsansouci I think you were looking at the wrong branch ;P
As far as the web errors, I don't know much about the inner workings of require-polyfill, it's possible it has some issues under certain scenarios. The python server has worked for us in the past. Maybe there's some issue with the setup of that project? @codekiln have you had any problems running on web?
I've only done a few examples for web, and they have all worked.
Cloned
https://github.com/codekiln/reasonml-playground
and went to thereprocessing01
directory, didnpm install
then./node_modules/.bin/bsb -make-world
and got the following output:Files in
node_modules
directory: