emscripten-core / emsdk

Emscripten SDK
http://emscripten.org
Other
2.92k stars 660 forks source link

[Bazel] [Potential solution] Cannot build multiple emscripten binaries in parallel with bazel #1386

Closed kalmard0 closed 1 week ago

kalmard0 commented 1 month ago

On bazel with sandboxing disabled (or when not available, e.g. Windows), multiple parallel binaries will fail to build due to a shared file being written by the compiler: tmp.tar.

This filename comes from https://github.com/emscripten-core/emsdk/blob/ce74ca2b1c968f897150bdc55daa9e3c12a3fefc/bazel/emscripten_toolchain/link_wrapper.py#L162

I believe this can be easily solved by changing tmp.tar to a filename that includes the current build rule's name, to make it unique. But I haven't managed to test this.

walkingeyerobot commented 3 weeks ago

That sounds like a reasonable solution. I'm happy to accept a PR that renames tmp.tar.