1

When I run emconfigure ./configure I get the following error:

ERROR:root:Exception thrown when invoking Popen in configure with 

args: "./configure"!
Traceback (most recent call last):
  File "/usr/local/bin/emconfigure", line 13, in <module>
    emconfigure.run()
  File "/usr/local/Cellar/emscripten/1.37.21/libexec/emconfigure.py", line 46, in run
    shared.Building.configure(sys.argv[1:])
  File "/usr/local/Cellar/emscripten/1.37.21/libexec/tools/shared.py", line 1533, in configure
    process = Popen(args, stdout=None if EM_BUILD_VERBOSE_LEVEL >= 2 else stdout, stderr=None if EM_BUILD_VERBOSE_LEVEL >= 1 else stderr, env=env)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
prismspecs
  • 1,482
  • 6
  • 20
  • 35

2 Answers2

1

Break-down:

This one can be tricky to track down because of the depth of the call stack. Let's break it apart:

At the "next-to-top level": a file you're trying to execute cannot be found.

One level lower than that things become clear: subprocess.Popen is trying to execute args.

What's in args? - basically ./configure (as passed by emscripten). export the EM_BUILD_VERBOSE=3 environmental variable and then stderr should display this.

So, the next-to-top level ./configure is directing things in an invalid fashion. Now it's time for a guess at the top level (not knowing what's in the ./configure script): is some line of the shell command in the ./configure script file itself trying to execute something non-existent? E.g.: some point after #! /bin/sh ? - try debugging just ./compile.

It is worth noting that a subprocess can have issues with relative paths (not getting PATH), and permissions (./configure is locked-down), but your error very well may persist even after /you/make/an/absolute/call/to/configure and 777 the permissions of configure. - In that case the previous paragraph is the likeliest culprit.

Editorializing:

The reason this error is interesting as a general one for emscripten is that part (much) of emscripten's raison d'etre is to port [legacy] C/++ code to new JS apps. Well, old C/++ builds get old in the sense of this question. If that's true, this is will be a generally-occurring problem, and, if it is general the community could use a general pattern for resolution.

H.P.
  • 11
  • 2
0

If you're using Docker, your host computer is Windows, and you mounted it to a Windows directory, make sure that your files aren't \r\n line endings but instead \n line endings. Changing this fixed it for me.

In this case, if you're using git, you might try setting git config core.autocrlf input to stop checking out to \r\n. If you need to convert a file, try this answer out.

Cobertos
  • 1,953
  • 24
  • 43