emscripten-core / emsdk

Emscripten SDK
http://emscripten.org
Other
2.96k stars 676 forks source link

cannot build on mac #1266

Open peggyxia-alj opened 1 year ago

peggyxia-alj commented 1 year ago

I try to build the https://github.com/emscripten-core/emsdk/tree/main/bazel/test_external in bazel on mac os. I got an error which complains cannot find nodejs_darwin_arm64. (emcc: error: '/private/var/tmp/_bazel_xxx/acd75223ca090e63788b206bd2b63cfc/sandbox/darwin-sandbox/3/execroot/main/external/nodejs_darwin_arm64/bin/node /private/var/tmp/_bazel_xxx/acd75223ca090e63788b206bd2b63cfc/external/emscripten_bin_mac/emscripten/src/compiler.js /var/folders/fj/k9ny2mbx6hz4t1sqvghtd3wc0000gn/T/tmpujmelng5.json --symbols-only' failed: [Errno 2] No such file or directory: '/private/var/tmp/_bazel_xxx/acd75223ca090e63788b206bd2b63cfc/sandbox/darwin-sandbox/3/execroot/main/external/nodejs_darwin_arm64/bin/node' )

But I found in the bazel build external folder, there is a nodejs_darwin_amd64(windows version?)

All my other wasm_cc_binary rules are broken due to similar error and I can build them successfully one month ago.

Screen Shot 2023-08-11 at 9 37 49 AM
walkingeyerobot commented 1 year ago

I'll look into this.

What kind of processor do you have in your mac?

peggyxia-alj commented 1 year ago

it is Apple M1 Max.

The wasm bazel rule works well one month ago.

walkingeyerobot commented 1 year ago

I managed to get ahold of an M1 mac and I was able to build on it just fine. You could blow away your cache at /private/var/tmp/_bazel_xxx and try to rebuild. once you do that, checkout a fresh copy of emsdk, go into the bazel folder and just run bazel build hello-world:hello-world-wasm. if that fails, let me know what the error is and we can try to debug from there.

I'll also note that I'm running bazel 6.3.2.