-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Emscripten returns with error code 0 if python2 is not found. #763
Comments
How is the test runner invoked on the buildbots? If done by |
I am still thinking about this, and @alanklingman said he would too. But I am not sure there is a better solution - the default must be python or python2, and it will not work on some systems. The only alternatives to having one of those two appear to be
The former looks simple, but will lead to a lot of annoying warnings on half the systems (ones where python is not defined), and the latter adds a lot of complexity (right now, there is no install step at all). We could add compatibility scripts though, like emcc2 that all it does is use the other shebang, and run emcc, would that help? People would need to know to run it though. |
What about splitting the shell script part from the python part? So instead of having just
|
@juj Is it reasonable to invoke emcc or the test runner by passing it to your interpreter instead of relying on the shebang line when the python2 symlink is not present? |
But how does the new file get run? You would need to run it with |
@kripken I was thinking about using separate shell scripts (where we can have more logic than is possible in a shebang) to launch the python scripts, but that won't work well on Windows. @juj, the problem you mentioned where the return code is 0 when the tests fail should be fixed. I will look into it. |
@kripken Something like this may work better than
The code above should run in both the shell and in python, and should fall back to python if python2 isn't found. The downside is that it's not as compact. |
It might be best to do |
Does that actually work? I tried running this
and I got
|
Hmm I am sure I saw this working before. And
works. But in the shebang it does not... |
The other alternative here is to back out the changes I made and I can write up instructions on using virtualenv to set up emscripten. That means zero changes for the emscripten source and a little extra setup one some platforms that I'm happy to add to the emscripten docs. Sadly, the situation with python these days seems to make it necessary to inconvenience at least some users. :/ |
Yeah, there is no perfect solution here. Might as well leave it as is. It slightly annoys me that on some of my machines I need to add a python2 symlink, but it isn't that bad. |
I now got to configuring the OSX buildbot to have the python2 symlink as well. In /usr/bin, I issued sudo ln python python2 to create the python2 executable. But after that, trying to invoke python2 gives the error python2: posix_spawn: /usr/bin/python22.7: No such file or directory python2.7 does however exist, so from that I also monkeyed in /usr/bin
after which calling python2 does work. Is that the thing that I should have done? That felt somehow hackish. We don't currently have a good "Getting started with OSX" page that would have these listed up-to-date :/ |
Can you see where the python22.7 is coming from? Something is appending 2.7, I am curious what. |
I do not know how to check that. I'm setting up a new OSX box, and I'm seeing the exact same issue, but I'm not sure how to fix this properly. The workaround I mention above still works. Any ideas? |
Hmm, only idea is to run the command that generates the python22.7 error, and look at every step of what is called to see where it comes from with debug printouts... |
I got the same problem a few months before. I realized it was the drive fomrat (volume format) which caused issue while transferring large files. I had to set the volume format to "Mac OS Extended" instead of my earlier FAT32. It worked for me. More details here: http://www.optimum-systems.com/2013/07/mac-error-code-0.html |
I know that I have python installed because I use node-gyp. |
@stevenvachon I have just fixed with this on OSX 10.9: |
Similar issue, had to do this to fix: |
For people who encountered the error: Before type the following commands in the terminal, refer to this post to disable System Integrity Protection first. Then use the new commands which at least solved my python2 command not found problem.
|
Fixes in incoming, so closing. |
After the recent mods that require manually setting up a link to python2, if the user has not set up a link, running emscripten tests finish with an exit code 0 (success).
Expected that in such case a failure error code is returned.
See the recent buildbot results on OSX http://clb.demon.fi:8112/waterfall , where the build reports success, even though the output was this http://clb.demon.fi:8112/builders/osx-emcc-master-tests/builds/17/steps/OSX%20test%20emscripten%20master/logs/stdio
(Btw, would it be possible to look at this again if it is possible to automate the 'python' vs 'python2' somehow so that user does not need to do this manually?)
The text was updated successfully, but these errors were encountered: