trzecieu / emscripten-docker Goto Github PK
View Code? Open in Web Editor NEWDocker image with Emscripten to compile ASM.js and WebAssembly
License: MIT License
Docker image with Emscripten to compile ASM.js and WebAssembly
License: MIT License
Hi!
It seems emscripten v1.38.1 has been released but the latest tagged container available is 1.38.0. Could a container with the tag 1.38.1 be uploaded?
Thanks!
Could you please update the base image from jessie to stretch?
Jessie no longer receives official support and thus using this image as a basis for webservices is problematic.
I'm having problems enabling C++ exception catching when compiling code against the emscripten-upstream:sdk-tag-1.38.43-64bit
container. Exceptions used to work fine with the fastcomp-based emscripten
containers.
Details:
-s DISABLE_EXCEPTION_CATCHING=0
when building as documented in https://emscripten.org/docs/optimizing/Optimizing-Code.html#c-exceptionscatch
statements are not reached after throwing. Instead, the program aborts with either a "exception thrown" or "uncaught exception" error.Is this a known issue?
Hi there,
I'm trying to build with trzeci/emscripten:sdk-tag-1.37.16-64bit
but it won't work because wget
is missing. wget
was fine in previous builds, is there a specific reason to remove it?
Regards,
Hi @asria!
I am using your docker image to compile a project based on magnum which supports emscripten builds through a cmake toolchain.
The toolchain requires at least CMake 3.7, though (https://github.com/mosra/toolchains/blob/master/generic/Emscripten-wasm.cmake#L48 for explanation), but the image only provides 3.6.
I already built a custom version of your image where I simply updated the cmake download link and that works great, but it would be amazing to not have to maintain that myself with every emscripten update.
Would you be okay with increasing the CMake version? Which version would you suggest (3.7/3.10)? I can provide a PR, if you're fine with it.
Thanks in advance and thanks for actively maintaining this docker image!
Cheers, Jonathan.
To make git tool fully useful, it requires also ssh tool to clone via SSH protocol.
After refactoring there is no more trzeci/emscripten:sdk-incoming-64bit
being being build and uploaded.
Triggered by: WebAssembly/binaryen#2464
Having entry point adds a risk that a user can override it (or CI).
I cannot compile gsl library because
configure:9010: checking whether the /emsdk_portable/sdk/emcc linker (/emsdk_portable/sdk/emcc) supports shared libraries \
configure:10163: result: no \
configure:10403: checking dynamic linker characteristics
configure:10914: /emsdk_portable/sdk/emcc -o conftest conftest.c >&5
configure:10914: $? = 0
configure:11140: result: GNU/Linux ld.so
configure:11247: checking how to hardcode library paths into programs
configure:11272: result: unsupported
configure:11812: checking whether stripping libraries is possible
configure:11817: result: yes
configure:11852: checking if libtool supports shared libraries
configure:11854: result: no
configure:11857: checking whether to build shared libraries
configure:11878: result: no
configure:11881: checking whether to build static libraries
configure:11885: result: yes
i am trying to build ubuntu version to chceck if this also happens
Hi,
Thanks for your work on this image!
I'm attempting to use this for building the javascript port of micropython but on the latest images it throws a long list of
In file included from ../../extmod/moduwebsocket.c:27:
/emsdk_portable/emscripten/tag-1.38.42/system/include/libc/stdio.h:22:10: fatal error: 'bits/alltypes.h' file not found
#include <bits/alltypes.h>
^~~~~~~~~~~~~~~~~
1 error generated.
Which looks very similar to emscripten-core/emscripten#9205
I tried a couple of versions back, trzeci/emscripten:sdk-tag-1.38.42-64bit
had the same compile error, but trzeci/emscripten:sdk-tag-1.38.41-64bit
so this lines up with the versions in the above issue.
Based on that issue, I suspect llvm may need updating?
Problem:
Currently MD file points at the master blob from this repository, what's not entirely true for every historical release, as the Dockerfiles files change.
Hello,
When I'm trying to use this docker image on travis I'm getting the following error:
Makefile:2: *** You need to install/source emscripten and run with "emmake make". Stop.
5 days ago was working ok: https://travis-ci.org/image-js/stroke-width-transform/builds/336607121
but right now is not working: https://travis-ci.org/image-js/stroke-width-transform/builds/338482076
I just change the way that it runs the docker container but still get the same error
original repo: https://github.com/image-js/stroke-width-transform
Please state what is missing: Need guide to run this on windows based system
I'm hitting to command and it's looks like invalid for windows.
``$ docker run \
--rm
-v$(pwd):$ (pwd)
-u$(id -u):$ (id -g)
trzeci/emscripten
emcc helloworld.cpp -o helloworld.js;``
How can we re-format for windows?
This prevents to reuse cached *.bc libs
Hi, I just want to give you a big thank to @trzecieu running this project. It really makes it much easier to start experimenting with WebAssembly for Windows users.
One request though is upgrading to a more recent version of CMake. I'm working on a project that could really benefit from the new add_link_options
and target_link_options
commands that were introduced in CMake 3.13 (https://cmake.org/cmake/help/latest/release/3.13.html). The current 3.12 version therefore doesn't support these commands.
None : wrong submission. Moved to the correct projet : emscripten core
A nice-to-have, but not essential. It would allow make to do more bundling/packaging.
I've just changed from trzeci/emscripten:sdk-incoming-64bit
to trzeci/emscripten:1.39.2-fastcomp
and now make is saying there are no targets:
sdk-incoming-64bit: https://travis-ci.org/curiousdannii/emglken/builds/580095103
1.39.2-fastcomp: https://travis-ci.org/curiousdannii/emglken/builds/610665756
docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:1.39.2-fastcomp bash
docker exec -it emscripten make
make: *** No targets specified and no makefile found. Stop.
I had been running
$(pwd):/src
But I've noticed the docs now say
`pwd`:`pwd` or $(pwd):$(pwd)
I also tried both of those, but no success:
https://travis-ci.org/curiousdannii/emglken/builds/610671596
https://travis-ci.org/curiousdannii/emglken/builds/610672121
Any ideas?
We'll also have to update the Emscripten docs.
Hi,
we're setting --closure 1
to optimize the wrapper code.
It causes the following error:
WARNING:root:java does not seem to exist, required for closure compiler, which is optional (define JAVA in /root/.emscripten if you want it)
ERROR:root:fatal: closure compiler is not configured correctly
Maybe we should add java to the Docker images?
ATM emscripten
image compiles all ports, but do not preserve output (due a size ~1GB), this might be done as a separated image emscripten-full
Attempting to access https://jenkins.trzeci.eu/job/public/job/emscripten-docker.release/ returns a 502. It's been like that for a couple of days.
Just in case you weren't aware I figured I'd open an issue.
Hi, this is a very useful image. Thanks for creating it!
It worked for me on my Mac, but when I tried to run it on Travis CI, I got a permission error as soon as emcc
tried to write to the file system:
command: "docker" "run" "--rm" "--volume" "/home/travis/build/tree-sitter/tree-sitter/test/fixtures/grammars/javascript:/src" "--user" "emscripten" "trzeci/emscripten-slim" "emcc" "-o" "tree-sitter-javascript.wasm" "-Os" "-s" "WASM=1" "-s" "SIDE_MODULE=1" "-s" "EXPORTED_FUNCTIONS=[\"_tree_sitter_javascript\"]" "-I" "src"
emcc command failed - Unable to find image 'trzeci/emscripten-slim:latest' locally
latest: Pulling from trzeci/emscripten-slim
e79bb959ec00: Pulling fs layer
67c164866f5d: Pulling fs layer
f3b772b4e21c: Pulling fs layer
f3b772b4e21c: Verifying Checksum
f3b772b4e21c: Download complete
e79bb959ec00: Download complete
e79bb959ec00: Pull complete
67c164866f5d: Verifying Checksum
67c164866f5d: Download complete
67c164866f5d: Pull complete
f3b772b4e21c: Pull complete
Digest: sha256:9fcec955b3174a78b0422e6dde4c9e58e9a68e5646102b11b1ecb0f358987571
Status: Downloaded newer image for trzeci/emscripten-slim:latest
Traceback (most recent call last):
File "/emsdk_portable/sdk/emcc.py", line 3308, in <module>
sys.exit(run(sys.argv))
File "/emsdk_portable/sdk/emcc.py", line 2066, in run
src = re.sub(shared.JS.memory_initializer_pattern, repl, open(final).read(), count=1)
File "/usr/lib/python2.7/re.py", line 155, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "/emsdk_portable/sdk/emcc.py", line 2057, in repl
open(memfile, 'wb').write(bytearray(membytes))
IOError: [Errno 13] Permission denied: 'tree-sitter-javascript.wasm.mem'
After reading about permissions issues with docker volumes, I replaced --user emscripten
with --user $(id -u)
(specifying my user id on the host, rather than a username). This fixed the problem for me.
I think this might be a better suggestion to make in the docs. What do you think?
printf '#include <iostream>\nint main(){std::cout<<"HELLO FROM DOCKER C++"<<std::endl;return 0;}' > test.cpp
docker run --rm -v $(pwd):/src trzeci/emscripten:sdk-tag-1.35.4-64bit emcc src/test.cpp -o src/test.js -s WASM=1
Will fail to compile binaryen
The docker image is two releases and ~2 months behind the latest Emscripten releases.
I get that you're on holidays, but is there any estimate on when you think you can work on this?
I'm not trying to rush you, just trying to organise my time.
Current readme files are store too much information and cause lots of confusion.
Currently the latest tag is sdk-tag-1.38.32-64bit
. Emscripten is up to 1.38.42.
Is there any plan to update this image for the latest Emscripten?
It would be nice to keep the git package installed.
Moreover, git-core package is obsolete. Use git. https://packages.debian.org/pl/jessie/git-core.
1 warning generated.
configure: error: Namespace support is required to build ICU.
make[5]: *** [icu-build/Makefile] Error 1
make[5]: Target 'rebuild' not remade because of errors.
make[4]: *** [../../libs/icu/include/unicode/uversion.h] Error 2
How to solve this?
trzeci/emscripten-slim:sdk-tag-1.38.38-64bit-64bit)[][%]()
The command '/bin/bash -c cd ${EMSDK} && echo "## Clean-up Emscripten Installation" && shopt -s globstar && _file=`echo ./emscripten/*/site/build/text/docs/tools_reference/emcc.txt` && _content=`cat ${_file}` && rm -fr ./emscripten/*/docs ./emscripten/*/media ./emscripten/*/site && mkdir -p `dirname ${_file}` && echo ${_content} >> ${_file} && _file=`echo clang/*/src/emscripten-version.txt` && _content=`cat ${_file}` && rm -fr clang/*/src && mkdir -p `dirname ${_file}` && echo ${_content} >> ${_file} && rm -fr binaryen/*/src && rm -fr binaryen/**/test && rm -fr binaryen/**/*.cmake && rm -fr binaryen/**/Makefile && rm -fr clang/*/*/docs && rm -fr clang/*/*/tools && rm -fr clang/*/*/projects && rm -fr clang/*/*/cmake && rm -fr clang/**/*.cmake && rm -fr clang/**/Makefile && find . -name "*.pyc" -exec rm {} \; && find . -name "CMakeFiles" -type d -prune -exec rm -fr {} \; && find . -name "CMakeCache.txt" -exec rm {} \; && find . -name "*.o" -exec rm {} \; && find . -name "*.a" -exec rm {} \; && find . -name "*.inc*" -exec rm {} \; && find . -name "*.gen.tmp" -exec rm {} \; && find clang -type d -depth -empty -exec rmdir "{}" \; && find binaryen -type d -depth -empty -exec rmdir "{}" \; && rm -fr **/*_32bit && rm -rf **/.git && rm -rf **/tests && rm -fr zips/* && rm -fr /opt/cmake /usr/local/bin/cmake /cmake* && sleep 2 && echo "## Done"' returned a non-zero code: 1
[INFO] Compiled [trzeci/emscripten-slim:sdk-tag-1.38.38-64bit] in: 0:00:01.159364
trzeci/emscripten-slim:sdk-tag-1.38.38-64bit - FAIL
At least one compilation set has failed to compile
Problematic Docker Image: N/A
Please state what is missing:
Per #28 (comment), I would like to see an Alpine Linux based image.
I am willing to collaborate on this, since I recently worked on upgrading the emcripten
package upstream, but it had some issues failing the tests and was disabled, (See: https://gitlab.alpinelinux.org/alpine/aports/issues/10995).
Hi,
similarly to #23 I ran into CMake version issue. LevelDB needs at least 3.9.
In the source of the installer I found the option: --skip-license
So my upgrader now consists of:
version=3.13
build=0
wget https://cmake.org/files/v$version/cmake-$version.$build-Linux-x86_64.sh
mkdir /opt/cmake
sh cmake-$version.$build-Linux-x86_64.sh --skip-license --prefix=/opt/cmake
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
ln -s /opt/cmake/bin/ctest /usr/local/bin/ctest
It works for me now but it might be convenient for others.
Cheers,
Hans
Get some good practices from https://github.com/nodejs/docker-node and use only one dockerhub project https://hub.docker.com/r/trzeci/emscripten/
That means a new schema will be introduced:
trzeci/emscripten:{version
}-{variant
}, where:
*none*
- a default version of Emscripten with predefined base tools for developmentslim
- lightweight version of Emscripten - Debian basedfull
- future version for holding: #8If env var EMCC_WASM_BACKEND=1
When calling any of emconfigure or emcc, etcc ...
emcc: WASM_BACKEND selected but could not find lld (wasm-ld): /emsdk_portable/llvm/clang/bin/wasm-ld
My server was suspended, as the provided suspect fishy utilization of VPS - so that I need to bump releases manually, and this will temporarily add some delay.
Docker runs 64 bit arch by default, compiling by default 32bit versions seems pointless.
I'm attempting to build an emscripten-based project that uses the -s EXPORTED_FUNCTIONS
option to emcc but it fails with:
perl -MJSON -ne '$f{"_$1"}=1 if /(olm_[^( ]*)\(/; END { @f=sort keys %f; print encode_json \@f }' [header files] > javascript/exported_functions.json.tmp
Can't locate JSON.pm in @INC (you may need to install the JSON module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .).
It looks like adding libjson-perl
to the list of installed apt packages is necessary to use the -s EXPORTED_FUNCTIONS
option?
Hi,
I'm using trzeci/emscripten:sdk-tag-1.37.3-64bit on GitLab CI.
I get the following error:
make: command not found
I don't understand how èmake` is not in the image.
Please advise,
(transcription below w/ extra trace removed)
stderr: WARNING:root:retrieving port: zlib from https://github.com/emscripten-ports/zlib/archive/version_1.zip
Traceback (most recent call last):
...
File "/usr/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>
I get the above error when I try to build a library (ARToolkit) only in a emscripten-slim
container but not in a emscripten
container. This is my first time working with Docker so I'm not sure if I can provide more help.
I'm running Docker on Windows 10. If I navigate to the url in the issue normally I don't get any error in Chrome and I can download it fine in my host OS.
Hi!
With the emcc command as documented in the emscripten guide, I am getting an error, and seems like the paths are incompatible: https://travis-ci.org/shlomif/fc-solve/builds/318344223 - see the last "LAST" lines of echo '${path}*'
. I am following the instructions here: https://kripken.github.io/emscripten-site/docs/compiling/Travis.html . Please help.
No idea what's gone wrong, but the build status is failing and the image hasn't been updated to 1.39.4.
[5/5](****/emscripten-fastcomp:1.39.1)[19/36][%](Create symbolic links)
The command '/bin/sh -c echo "## Create symbolic links"
&& . ${EMSDK}/emsdk_set_env.sh
&& mkdir -p ${EMSDK}/llvm ${EMSDK}/emscripten ${EMSDK}/binaryen
&& ln -s $(dirname $(which node))/.. ${EMSDK}/node/current
&& ln -s $(dirname $(which clang))/.. ${EMSDK}/llvm/clang
&& ln -s $(dirname $(which emcc)) ${EMSDK}/emscripten/sdk
&& ln -s $(dirname $(which asm2wasm)) ${EMSDK}/binaryen/bin
&& echo "## Done"' returned a non-zero code: 1
From the changelog it looks like there used to be an Ubuntu version. Is it possible to make an Ubuntu version of the images? Thanks!
Emsdk allows you to install Node 8.9 now. That would be very useful.
Locally, when running docker run -it
, the PATH env var is set correctly. But I also tried to use this image on Circle CI, and emscripten binaries are not in the PATH there. Where is the PATH set?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.