Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment: JS + WebGL build #1

Merged
merged 5 commits into from
Oct 11, 2019
Merged

Experiment: JS + WebGL build #1

merged 5 commits into from
Oct 11, 2019

Conversation

bryphe
Copy link
Contributor

@bryphe bryphe commented Oct 11, 2019

Hey @kyldvs ! chesster is looking great 😄

I went through the exercise of adding the JS build back to our revery-quick-start - and thought it'd be fun to see if your app worked in the browser too.

chesster

There's a couple minor workarounds I needed due to bugs in Revery:

  • Had to remove the borderRadius in the WebGL builds - there's a crash when compiling the shader in WebGL 1.0 (should not be necessary once we have Skia)
  • Add some stubs around mutex operations (this should not be necessary w/ latest Revery - was fixed in this commit: revery-ui/revery@8bc39ee#diff-408517755d2be7cfcd9deb0bfd4e8a0d)
  • Maximize the canvas in WebGL so it wouldn't be confined to a small square
  • Add a js.json sandbox plus a few assets specific to the JS build

To run the JS build:

  • esy '@js' install
  • esy '@js' run

And then you'll get a URL to test from http-server.

No pressure to bring this in - just fun to experiment with!

@kyldvs
Copy link
Owner

kyldvs commented Oct 11, 2019

Awesome! Thanks for hooking this up

@kyldvs kyldvs merged commit be0b7af into kyldvs:master Oct 11, 2019
@bryphe bryphe deleted the js-build branch October 11, 2019 17:08
@kyldvs
Copy link
Owner

kyldvs commented Oct 11, 2019

It looks like I can install '@js' fine, but have a build error when running. I'll investigate a bit more

File "_none_", line 1:
Error: Error on dynamically loaded library: /Users/kad/.esy/3_____________________________________________________________________/i/reason_glfw-3.2.1029-6ac332ac/lib/stublibs/dllreglfw_stubs.so: dlopen(/Users/kad/.esy/3_____________________________________________________________________/i/reason_glfw-3.2.1029-6ac332ac/lib/stublibs/dllreglfw_stubs.so, 10): Symbol not found: _glfwGetProcAddress
  Referenced from: /Users/kad/.esy/3_____________________________________________________________________/i/reason_glfw-3.2.1029-6ac332ac/lib/stublibs/dllreglfw_stubs.so
  Expected in: flat namespace
 in /Users/kad/.esy/3_____________________________________________________________________/i/reason_glfw-3.2.1029-6ac332ac/lib/stublibs/dllreglfw_stubs.so
error: command failed: 'dune' 'build' '--root' '.' '-j4' '--profile' 'release' (exited with 1)
esy-build-package: exiting with errors above...
error: build failed with exit code: 1

esy: exiting due to errors above

@bryphe
Copy link
Contributor Author

bryphe commented Oct 11, 2019

Ah, I suspect it's missing an LD_LIBRARY_PATH... Looks like we don't have it set in the esy-glfw package.json.

We moved Revery to SDL2 recently, and the esy-sdl2 library does have that properly set: https://github.com/revery-ui/esy-sdl2/blob/a648d63643913e79efc29f257407783eec7e46ad/package.json#L25 - so it might be worth upgrading revery to a newer commit to pick that up.

@bryphe
Copy link
Contributor Author

bryphe commented Oct 11, 2019

Was able to repro on my Mac; trying out the upgrade

@kyldvs
Copy link
Owner

kyldvs commented Oct 11, 2019

I just updated to latest revery commit in 41a3472, doesn't seem to fix it though

@kyldvs
Copy link
Owner

kyldvs commented Oct 11, 2019

(Also cmd+q no longer quits after upgrading to latest revery btw)

@bryphe
Copy link
Contributor Author

bryphe commented Oct 11, 2019

Hmm, ya - it seems like we're missing a path we need still in the CAML_LD_LIBRARY_PATH variable for esy-sdl2 or reason-sdl2.

And thanks for catching the cmd+q bug!

@bryphe
Copy link
Contributor Author

bryphe commented Oct 11, 2019

It's interesting - it looks like the esy '@js' run works with revery-quick-start works for on me Mac. So I guess there is something different with the build configuration here that is exposing this bug.

@kyldvs
Copy link
Owner

kyldvs commented Oct 12, 2019

Okay cool, I can investigate what those differences are. I'll track it in: #2

@bryphe
Copy link
Contributor Author

bryphe commented Oct 12, 2019

Cool thank you @kyldvs ! Curious what the delta is that is causing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants