bvibber / emsdk-npm

emscripten SDK helper module for npm projects
5 stars 7 forks source link

emsdk & emsdk_set_env not found #4

Open FreezePhoenix opened 5 years ago

FreezePhoenix commented 5 years ago

The code is hosted at https://repl.it/@FreezePhoenix/ParchedUnnaturalRam

The issue is it doesn't seem to be able to find the emsdk command:

runner@repl.it:~$ npx emsdk-run emcc hello.cc -o hello.html
/home/runner/node_modules/emsdk-npm/bin/emsdk-run: 26: /home/runner/node_modules/emsdk-npm/emsdk/emsdk_env.sh: ./emsdk: not found
/home/runner/node_modules/emsdk-npm/bin/emsdk-run: 27: .: Can't open ./emsdk_set_env.sh

Seems to work fine on a raspberry pi, but this still takes eons, so there may be bugs later:

npx emsdk install latest

However, on the above, I did copy an older version of the emsdk repo into it. Not sure if that makes a difference.

FreezePhoenix commented 5 years ago
/home/runner/node_modules/emsdk-npm/bin/emsdk-run: 27: .: Can't open ./emsdk_set_env.sh

Perhaps this should be... ./../emsdk/emsdk_set_env.sh

No, this doesn't exist either. That's the issue.

FreezePhoenix commented 5 years ago

Problem found!

FreezePhoenix commented 5 years ago

that line should be: . ./..emsdk/emsdk_env.sh

cc @brion

bvibber commented 5 years ago

Hmmmmm, so this seems like a problem with emsdk itself, where the emsdk_env.sh script is trying to set the directory of the script and having trouble. Not quite sure why it's failing yet.

bvibber commented 5 years ago

Think I've found it, it's a bug in emsdk's emsdk_env.sh script on non-bash shells. Reported upstream as https://github.com/emscripten-core/emsdk/issues/234

I think I can work around it. :)

bvibber commented 5 years ago

Ok, so with 0.2.2 it should find ./emsdk BUT it still comes up with "not found" error because it calls through to /usr/bin/env which does not exist in the REPL.it environment. (Python 2 is present as /usr/bin/python, but it can't be found because "env" is used to find it!)

I'm pretty sure the remaining python scripts in emscripten assume that /usr/bin/env python works; though I might be able to force them to run through python manually I'm not sure I'd recommend it.

FreezePhoenix commented 5 years ago

Well, the question that we are left with:

Do we report this as an REPL.it bug?

bvibber commented 5 years ago

Yeah, I'd recommend reporting it to REPL.it; unless they have a specific reason for not installing env it would be very helpful, especially for Python scripts where the convention is generally to use #!/usr/bin/env python.

FreezePhoenix commented 5 years ago

https://repl.it/talk/ask/REPLit-should-have-a-usrbinenv-installed/14181

Guess i'll see how this goes.

FreezePhoenix commented 5 years ago

@brion Supposedly, it is a limit to their linux VM's. Dunno if that means it will be fixed, but... /shrug