Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error downloading wasm-binaries for <= 3.1.45 (if using main with ./emsdk install <version>) #1441

Closed
sogaiu opened this issue Aug 29, 2024 · 2 comments

Comments

@sogaiu
Copy link

sogaiu commented Aug 29, 2024

I'm not having luck retrieving wasm-binaries when running ./emsdk install <version> for <version> <= 3.1.45. This is when on the main branch (at the time of writing the commit is at d09b3c3).

It looks like if I checkout a tag that matches the version (e.g. tag 3.1.45 for version 3.1.45), things can work...

Any chance of some changes in the direction of not having to checkout a matching tag?

I've come across the possibly related issue:

Some transcripts follow.

Basic info:

$ git checkout main
Already on 'main'
Your branch is up to date with 'origin/main'.
$ git rev-parse HEAD
d09b3c3815479d80117d070882a91310f35c52b3

Download error for 3.1.45:

$ ./emsdk install 3.1.45
Resolving SDK version '3.1.45' to 'sdk-releases-2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1-64bit'
Installing SDK 'sdk-releases-2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1-64bit'..
Skipped installing node-18.20.3-64bit, already installed.
Installing tool 'releases-2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1-64bit'..
Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1/wasm-binaries.tar.xz': HTTP Error 404: Not Found
^C

Download success for 3.1.46:

$ ./emsdk install 3.1.46
Resolving SDK version '3.1.46' to 'sdk-releases-21644188d5c473e92f1d7df2f9f60c758a78a486-64bit'
Installing SDK 'sdk-releases-21644188d5c473e92f1d7df2f9f60c758a78a486-64bit'..
Skipped installing node-18.20.3-64bit, already installed.
Installing tool 'releases-21644188d5c473e92f1d7df2f9f60c758a78a486-64bit'..
Downloading: /tmp/emsdk/downloads/21644188d5c473e92f1d7df2f9f60c758a78a486-wasm-binaries.tar.xz from https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/21644188d5c473e92f1d7df2f9f60c758a78a486/wasm-binaries.tar.xz, 257708108 Bytes
Unpacking '/tmp/emsdk/downloads/21644188d5c473e92f1d7df2f9f60c758a78a486-wasm-binaries.tar.xz' to '/tmp/emsdk/upstream'
Done installing tool 'releases-21644188d5c473e92f1d7df2f9f60c758a78a486-64bit'.
Done installing SDK 'sdk-releases-21644188d5c473e92f1d7df2f9f60c758a78a486-64bit'.
@sbc100
Copy link
Collaborator

sbc100 commented Aug 29, 2024

I think prior to 3.1.46 the file extension used was .tbz2 and not .tar.xz. However we have code in emsdk that is supposed to fall back to the old filename when the new one fails.

When I try to install 3.1.45 is see the error, but then I see successs:

$ ./emsdk install 3.1.45
Resolving SDK version '3.1.45' to 'sdk-releases-2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1-64bit'
Installing SDK 'sdk-releases-2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1-64bit'..
Skipped installing node-18.20.3-64bit, already installed.
Installing tool 'releases-2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1-64bit'..
Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1/wasm-binaries.tar.xz': HTTP Error 404: Not Found
Downloading: /usr/local/google/home/sbc/dev/wasm/emsdk/downloads/2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1-wasm-binaries.tbz2 from https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1/wasm-binaries.tbz2, 344484986 Bytes
Unpacking '/usr/local/google/home/sbc/dev/wasm/emsdk/downloads/2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1-wasm-binaries.tbz2' to '/usr/local/google/home/sbc/dev/wasm/emsdk/upstream'
Done installing tool 'releases-2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1-64bit'.
Done installing SDK 'sdk-releases-2b7c5fb8ffeac3315deb1f82ab7bf8da544f84a1-64bit'.

Note the failed attempt to fownload the .tar.xz followed by the successful download of the .tbz2.

The code for this fallback is here:

emsdk/emsdk.py

Lines 1399 to 1409 in d09b3c3

# Special hack for the wasm-binaries we transitioned from `.bzip2` to
# `.xz`, but we can't tell from the version/url which one to use, so
# try one and then fall back to the other.
success = False
if 'wasm-binaries' in archive and os.path.splitext(archive)[1] == '.xz':
success = try_download(url, silent=True)
if not success:
alt_url = url.replace('.tar.xz', '.tbz2')
success = try_download(alt_url, silent=True)
if success:
url = alt_url

I'm not sure how that code doesn't seem to be running for you.

@sogaiu
Copy link
Author

sogaiu commented Aug 30, 2024

My bad.

I misintrepreted the output (in my original post I have a manual interruption after the initial failure). I confirm there is a subsequent download that succeeds (also tried for lower versions such as 3.1.3 where I see similar behavior).

Sorry for the trouble!

@sogaiu sogaiu closed this as completed Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants