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

WASM build #3

Closed
EliSnow opened this issue Mar 19, 2017 · 6 comments
Closed

WASM build #3

EliSnow opened this issue Mar 19, 2017 · 6 comments

Comments

@EliSnow
Copy link
Contributor

EliSnow commented Mar 19, 2017

With WASM now supported in Firefox and Chrome it would be good to see a WASM build. I spent a few hours trying to get it work, but had no luck when using the trzeci/emscripten:sdk-tag-1.37.3-64bit docker image.

@lfittl
Copy link
Member

lfittl commented Mar 19, 2017

Good idea, I'd love to get a working WebAssembly build. Was there any particular error you ran into with your testing?

@EliSnow
Copy link
Contributor Author

EliSnow commented Mar 19, 2017

It's possible I was doing something wrong, but I added -s WASM=1 to the end of line 40 of the Makefile and I was getting a non-descriptive python file not found error while attempting to build. Without that added the normal asm.js would build fine.

@EliSnow
Copy link
Contributor Author

EliSnow commented Mar 21, 2017

Here's the exact error I'm seeing:

Traceback (most recent call last):
  File "/usr/local/bin/em++", line 16, in <module>
    emcc.run()
  File "/emsdk_portable/emscripten/tag-1.37.3/emcc.py", line 2146, in run
    subprocess.check_call(cmd)
  File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
Makefile:39: recipe for target 'update_source' failed

@EliSnow
Copy link
Contributor Author

EliSnow commented Mar 21, 2017

I was able to resolve the error I was seeing by adding a line to my ~/.emscripten file, and got the WASM code to build!

One question which remains is how is it best to distribute the WASM build alongside the asm.js? There are ways to build WASM so it will fall back to asm.js but that has it's downsides.

@lfittl
Copy link
Member

lfittl commented Mar 25, 2017

@EliSnow Thats a good question - I don't have any preference there, so if you have a suggestion happy to take that.

I guess we could just have a pg_query_wasm.js build output along the current one (which requires WebAssembly, i.e. no asm.js compatibility layer), and then its left to the user to implement some kind of browser feature selection?

@lfittl
Copy link
Member

lfittl commented Sep 4, 2024

Resolved via #9's inclusion of a "pg_query_wasm.js" file in the published package.

@lfittl lfittl closed this as completed Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants