emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

emscripten ports USE_SDL=2 auto compile fails when using multiple emcc processes for the first time.

ankitkk opened this issue · comments

We have threaded build system and starts multiple emcc process, if SDL2 hasn't been compiled before, all emcc processes try to compile SDL2, with many processes ultimately failing.

I think auto compile is not entirely a good option, maybe let emcc download prebuilt .a's SDL2 on demand and limit emscripten ports to prebuilt .a's and header files.

Yes, I tend to agree. We had a discussion on the mailing list, and do want to make this more explicit and less automatic. So there would be a tool to fetch ports and build them, before running emcc, something like that. I'm not sure though when this will be implemented. Meanwhile, it's not too hard to work around I hope.

@kripken are there any design guidelines about how the ports tool should work? I have a project that does something similar and could start working on that right away.

The relevant mailing list post is https://groups.google.com/forum/#!msg/emscripten-discuss/Fsa-VDOHt6Q/SBRocui02lkJ , but it goes into more detail than necessary. For here, I think the following are the main points:

  1. A new tool call emport or emports or something better ;) , that has options to list ports, fetch+build ports, remove ports, etc. (can then remove the list option from emcc).
  2. It would under the hood run emcc -s USE_SDL=2 and such, on say tests/hello_world.c (just to have something to build on). So it is a thin wrapper against existing functionality, and we want to keep current stuff working.
  3. Documentation for the tool under site/
  4. Tests in tests/test_other.py

Compiling a simple test does not resolve the issue on OSX.
Wether you install 1.27, 1.29, 1.30 or master the port compilation of SDL2 ends up spawning multiple processes and breaking the build.
Only the incoming branch seems to resolve the issue for good.

The embuilder.py tool should help avoid this problem. The bots use it, for example.

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.