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

Make it easier to use emscripten tools #65

Open
olilarkin opened this issue Feb 29, 2020 · 1 comment
Open

Make it easier to use emscripten tools #65

olilarkin opened this issue Feb 29, 2020 · 1 comment

Comments

@olilarkin
Copy link

i need to be able to call file_packager.py directly, but EMSDK env var doesn't seem to be set in the docker image as it would be with a direct install.

sorry to post a query like this here, but how is it possible to call file_packager.py

ideally something like this would just work in the docker image

python $EMSDK/upstream/emscripten/tools/file_packager.py

but "upstream" is variable depending on the tag and as mentioned EMSDK is not set

@trzecieu
Copy link
Owner

trzecieu commented Jun 6, 2020

Hi!
Can you please tell me which image do you use? All images have $EMSDK variable being set.

> docker run --rm -it trzeci/emscripten:1.39.16-fastcomp bash -c 'echo $EMSDK'
/emsdk_portable

> docker run --rm -it trzeci/emscripten:1.39.16-upstream bash -c 'echo $EMSDK'
/emsdk_portable

And:

> docker run --rm -it trzeci/emscripten:1.39.16-upstream bash -c ' $EMSDK/upstream/emscripten/tools/file_packager.py --help'
Remember to build the main file with  -s FORCE_FILESYSTEM=1  so that it includes support for loading this file package
Nothing to do!

Just a sanity check:
There is a difference between single quote:

docker run --rm -it trzeci/emscripten:1.39.16-upstream bash -c 'echo $EMSDK'

and double quote:

docker run --rm -it trzeci/emscripten:1.39.16-upstream bash -c "echo $EMSDK"

In case of double quote - the bash interpreter resolves variable before executing the command - effectively it will look for $EMSDK on the host machine, so effectively it will be the same like:

docker run --rm -it trzeci/emscripten:1.39.16-upstream echo $EMSDK

In case of single quote - the string is not interpolated and passed in a raw form to the bash interpreter inside the docker image, and there it will be evaluated - effectively $EMSDK will be resolved to the correct value.

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

No branches or pull requests

2 participants