dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.9k stars 4.63k forks source link

Cannot download EMSDK in mono-wasm when running on Linux aarch64 #75589

Closed hwoodiwiss closed 1 month ago

hwoodiwiss commented 1 year ago

Description

When running make provision-wasm in src/mono/wasm on Linux on ARM64, the build fails with a 404 while trying to get the emscripten SDK.

Reproduction Steps

On Linux on ARM64, set src/mono/wasm as current directory and run make provision-wasm

Expected behavior

The EMSDK and its dependencies should be installed and activated in the current shell.

Actual behavior

Emsdk fails to download version 3.1.12 with error:

Installing tool 'releases-upstream-a8c3b314d61e2bb98581d522f858132b2fc21488-64bit'..
Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/a8c3b314d61e2bb98581d522f858132b2fc21488/wasm-binaries-arm64.tbz2': HTTP Error 404: Not Found
error: installation failed!

This is because EMSDK binaries are not always generated for linux arm64 builds.

Known Workarounds

Temporarily changing the value in emscripten-version.txt to 3.1.21 makes this work.

Proposed Solution

Given that at current emscripten does not have linux arm64 binaries generated for every version of emsdk, we can either update the emscripten-version.txt to 3.1.21, or conditionally select latest when building on linux arm64.

ghost commented 1 year ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

Issue Details
### Description When running `make provision-wasm` in `src/mono/wasm` on Linux on ARM64, the build fails with a 404 while trying to get the emscripten SDK. ### Reproduction Steps On Linux on ARM64, set `src/mono/wasm` as current directory and run `make provision-wasm` ### Expected behavior The EMSDK and its dependencies should be installed and activated in the current shell. ### Actual behavior Emsdk fails to download version `3.1.12` with error: ``` Installing tool 'releases-upstream-a8c3b314d61e2bb98581d522f858132b2fc21488-64bit'.. Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/a8c3b314d61e2bb98581d522f858132b2fc21488/wasm-binaries-arm64.tbz2': HTTP Error 404: Not Found error: installation failed! ``` This is because EMSDK binaries are not always generated for linux arm64 builds. ### Known Workarounds Temporarily changing the value in `emscripten-version.txt` to `3.1.21` makes this work. ### Proposed Solution Given that at current emscripten does not have linux arm64 binaries generated for every version of emsdk, we can either update the emscripten-version.txt to `3.1.21`, or conditionally select latest when building on linux arm64.
Author: hwoodiwiss
Assignees: -
Labels: `arch-wasm`, `untriaged`, `area-Build-mono`, `in-pr`
Milestone: -
lewing commented 1 year ago

Thanks for the contribution! How important is this for you? While this patch will work to build runtime it won't properly update dotnet/icu and dotnet/emsdk so you may run into other problems. If you can wait a bit we're working on plans to support arm64 properly and I expect that work to start soon.

hwoodiwiss commented 1 year ago

Hey, I'm happy to work around this, I'm just using it for hobby things at the moment, so waiting's no issue for me.

ilonatommy commented 3 months ago

@lewing, we have emscripten=3.1.34 and I can reproduce.

ilonatommy commented 1 month ago

While I can still reproduce when running make provision-wasm separately, after emscripten=3.1.54 bump, I also checked the overall build process and it succeeds (./build.sh mono+libs -c release -os browser). Emsdk is provisioned correctly as the part of build process and looks correct:

emsdk/bin/wasm-opt --version
wasm-opt version 117

Tested OS: Ubuntu 22.04.4 LTS (GNU/Linux 6.5.0-1024-azure aarch64) @radekdoulik, do you think we can close it? What could be the reasons why running provisioning as a separate command fail? Should we fix it?