emscripten-core/emscripten

emconfigure issue on windows

ILOVEPIE opened this issue · 10 comments

In order to compile most projects with emscripten on windows you have to use the Linux makefiles, however the Linux makefiles for many projects are generated by a bash configure script, the issue lies in that emscripten's emconfigure doesn't work with windows versions of bash, the paths defined by emconfigure and the emscripten sdk get all messed up. It is possible to work around this with some cygwin trickery but it causes a massive headaches when you go to compile with the makefiles, we need to find some way to fix this. This issue is only partially related to issue #607

juj commented

Are you looking at some project specifically?

I had some success with cygwin make on some unix makefiles in the past, although any issues in those were mostly with the assumptions that the project-specific configure had been built. Are you seeing something we could fix in Emscripten side, as opposed to being project-specific issues that their build configure systems should be more generic.

Put another way, if a project with unix configure script successfully builds on Windows natively with cygwin, then I think it should also build on Windows for Emscripten with cygwin. Do we have some bugs that prevent this parity? Since I think that's something that we should be able to work on in Emscripten side.

It's not a specific project in particular, most do have issues when running through emconfigure and emmake in cygwin. In general there a few annoying bugs with cygwin such as the roundabout way you have to run emconfigure in cygwin ("emconfigure C:\cygwin\bin\mintty.exe -h always ./configure" instead of "emconfigure ./configure" or even "emconfigure sh ./configure") and the problem with emmake launching the windows version of make instead of the cygwin version of make when you do "emmake make", but the larger issue is that emconfigure won't work with msys-bash (MinGW bash), git-bash or win-bash. The python script fails to run in each and when you try doing "emconfigure bash ./configure" in the windows command prompt to get around that issue, the environment variables get reset somehow and it just makes normal Linux makefiles. It would be simpler if the SDK just ran in cygwin or mingw-bash by default and we just focused on getting it working in that environment.

juj commented

Fixing issues with cygwin support is welcome, those sounds like bugs stemming from individual cases somewhere in the toolchain. However migrating the Emscripten SDK to use cygwin or msys by default is not something that we are interested in doing, since the SDK currently works already without it, and we don't want to introduce any unnecessary dependencies.

This happens on every computer I have installed emscripten on that uses windows, either manually or by using the sdk installer. Also i'm not nessisarily saying to depend upon cygwin or msys but maybe to include a bash executable like win-bash that would allow execution of configure scripts on windows.

juj commented

Ok, sounds good. If there's enough public interest, then adding a unix-like interpreter as an optionally installable package to the SDK is something we can definitely consider. But first, we should see about fixing the toolchain to support those. Feel free to raise bug reports for specific issues. Do you have an example project you are trying to build that fails here?

Perhaps we could include a *nix shell (bash or zsh or something) precompiled to JS?

a good example of something needing a *nix shell configure script would be
less
On Mar 8, 2014 11:32 AM, "juj" notifications@github.com wrote:

Ok, sounds good. If there's enough public interest, then adding a
unix-like interpreter as an optionally installable package to the SDK is
something we can definitely consider. But first, we should see about fixing
the toolchain to support those. Feel free to raise bug reports for specific
issues. Do you have an example project you are trying to build that fails
here?

Reply to this email directly or view it on GitHubhttps://github.com//issues/2208#issuecomment-37107239
.

ip commented

This is really important. How one is supposed to use make while even this doesn't work?

clean:
    rm -rf ./obj ./bin

makedirs:
    mkdir -p obj/some/dir

I also tried to run emmake make from msys (mingw terminal) but encountered the same issue with Python. Using windows-specific commands in GNU makefile is not a solution. Correct me if I miss something.
Now I decided to just install Ubuntu VM and use Emscripten from there.

The problem with relying on "public interest" to decide to fix these types of issues is that this is often a show stopper for each developer who encounters this problem, and waiting for a fix is not an option. I imagine most developers don't typically spend 100% of their time using emscripten but rather have a one-off use case for this. So a fix that's done later on isn't ever going to help them.

So that begs the question: Are those developers going to even bother coming here to ask for the feature when it's apparent that these tools are broken in Windows?

stale commented

This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.