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

"emsdk install latest" fails when downloading something due to SSL stuff #140

Open
damu opened this issue Apr 24, 2018 · 8 comments
Open

Comments

@damu
Copy link

damu commented Apr 24, 2018

So I wanted to try Webassembly and followed the instructions at https://github.com/juj/emsdk.
First emsdk failed because I had no Python, so I installed Python (3.6.5).
"emsdk update" seemed to work (no output) but "emsdk install latest" failed, output:

C:\Users\damu\Downloads\emsdk-portable>emsdk install latest
Update complete, however skipped fetching the Emscripten tags, since git was not found.
If you want to compile one of the tagged releases from source, please install git by typing 'emsdk install git-1.9.4', o
r alternatively by installing it manually from http://git-scm.com/downloads . If you install git manually, remember to a
dd it to PATH.
If you are not looking to build Emscripten from source, you can safely ignore this message.
Installing SDK 'sdk-1.37.1-64bit'..
Installing tool 'clang-e1.37.1-64bit'..
The contents of file 'llvm/tag/win_64bit/emscripten-llvm-e1.37.1.zip' already exist in destination 'C:/Users/damu/Downl
oads/emsdk-portable/clang/e1.37.1_64bit', skipping.
Done installing tool 'clang-e1.37.1-64bit'.
Installing tool 'node-4.1.1-64bit'..
The contents of file 'node_4.1.1_64bit.zip' already exist in destination 'C:/Users/damu/Downloads/emsdk-portable/node/4
.1.1_64bit', skipping.
Done installing tool 'node-4.1.1-64bit'.
Installing tool 'python-2.7.5.3-64bit'..
The contents of file 'python_2.7.5.3_64bit.zip' already exist in destination 'C:/Users/damu/Downloads/emsdk-portable/py
thon/2.7.5.3_64bit', skipping.
Done installing tool 'python-2.7.5.3-64bit'.
Installing tool 'emscripten-1.37.1'..
Traceback (most recent call last):
  File "C:\Users\damu\Downloads\emsdk-portable\\emsdk", line 2149, in <module>
    sys.exit(main())
  File "C:\Users\damu\Downloads\emsdk-portable\\emsdk", line 2132, in main
    success = tool.install()
  File "C:\Users\damu\Downloads\emsdk-portable\\emsdk", line 1229, in install
    success = tool.install()
  File "C:\Users\damu\Downloads\emsdk-portable\\emsdk", line 1244, in install
    success = download_and_unzip(url, self.installation_path(), download_even_if_exists, filename_prefix=self.zipfile_pr
efix if hasattr(self, 'zipfile_prefix') else '')
  File "C:\Users\damu\Downloads\emsdk-portable\\emsdk", line 850, in download_and_unzip
    dst_file = download_file(urljoin(emsdk_packages_url, zipfile), 'zips/', download_even_if_exists, filename_prefix)
  File "C:\Users\damu\Downloads\emsdk-portable\\emsdk", line 416, in download_file
    u = urlopen(url)
  File "C:\Users\damu\Downloads\emsdk-portable\python\2.7.5.3_64bit\lib\urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "C:\Users\damu\Downloads\emsdk-portable\python\2.7.5.3_64bit\lib\urllib2.py", line 404, in open
    response = self._open(req, data)
  File "C:\Users\damu\Downloads\emsdk-portable\python\2.7.5.3_64bit\lib\urllib2.py", line 422, in _open
    '_open', req)
  File "C:\Users\damu\Downloads\emsdk-portable\python\2.7.5.3_64bit\lib\urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "C:\Users\damu\Downloads\emsdk-portable\python\2.7.5.3_64bit\lib\urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "C:\Users\damu\Downloads\emsdk-portable\python\2.7.5.3_64bit\lib\urllib2.py", line 1184, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 1] _ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert pr
otocol version>

I'm using Windows 7 btw.
Git is not in my path but it doesn't seem to require it (which would be weird).

So my first impression was not good and some suggestions from my perspective I guess (mostly C++ developer who has also done web stuff with Javascript&Typescript):
Why is the script apparently installing Python 2.7.5.3? I just installed a new(er) Python version.
Why is it downloading stuff? Why is there no simple installer with everything it needs?

At first I was on http://webassembly.org/getting-started/developers-guide/ but it seems to be a build from source which I don't really want, I just want to use it and that should be made easy. The instruction on this Github page are apparently for the prebuild version which seemed easier. But apparently Webassembly still can't be used for anything 😉, at least not without a lot of hassle and on Windows.
Is there any IDE for it or some instruction to integrate it (like use the normal run hotkey to build it and open it in a browser)? I think I've heard of something but neither this Github nor webassembly.org list one, would be nice to have a more "out of the box" solution.
Is there a way to access the DOM to do typical Javascript stuff with Webassembly? Or can I call Javascript functions? It's often advertised as kinda replacing JS but I can't find anything that easily, though would expect it in a "Getting Started" guide. This kinda sounded like it but seems to be something else:
http://webassembly.org/getting-started/js-api/
I'm checking out Emscripten and Webassembly occasionally for years already and love the idea but it still seems to be in the "Let's check that out again in a few years"-stage...

@kripken
Copy link
Member

kripken commented Apr 24, 2018

This looks like it might be emscripten-core/emscripten#6275 , which was caused by a github update to SSL, which requires a quite recent python version. You might want to try running emsdk.bat using that newer python directly, that works on other platforms at least.

Why is it downloading stuff? Why is there no simple installer with everything it needs?

Sorry about that! It used to be better, bundling Python in the windows download, but sadly we no longer have a windows person helping with releases. None of the active devs, myself included, are on windows, which is definitely bad :( I'm trying to get help to improve our windows support, but so far no luck.

@damu
Copy link
Author

damu commented Apr 24, 2018

I commented those four "@if EXIST ..." blocks in the emsdk.bat out and it seemed to work.
It apparently also installed a JRE. Those requirements are strange.

One more reason to hate SSL. There's so much hassle with certificates running out, version incompatibilities, ...

Strange that no one uses Windows since a lot of (probably the most) software is developed for Windows. Maybe it's just that most of that is closed source and most open source contributors use Linux.

@juj
Copy link
Collaborator

juj commented Apr 27, 2018

The root issue here I think is that after we migrated emsdk on Windows from Python 2.7.5.3 to 2.7.13.1, we did not kick off the emsdk deployment script (mentioned this here emscripten-core/emscripten#6275 (comment) as well), so the emsdk-portable.zip hosted on Amazon for download still has the old version of that lying around.

@juj
Copy link
Collaborator

juj commented Apr 27, 2018

I commented those four "@if EXIST ..." blocks in the emsdk.bat out and it seemed to work.

The fix to this SSL oddiness is in https://github.com/juj/emsdk/blob/master/emsdk.bat, but due to the above, the emsdk-portable.zip you downloaded was outdated. Try going via the manual git clone https://github.com/juj/emsdk.git route to bootstrap (or wait until we get an up to date emsdk-portable.zip deployed).

One more reason to hate SSL. There's so much hassle with certificates running out, version incompatibilities,

A particularly nasty thing here was also that since this problem affected downloading from Python, and the updater mechanism also needs to download, it means that one can't use emsdk to update to newer fixed version, since the issue broke the updating mechanism as well, but need to bootstrap from scratch.

It apparently also installed a JRE. Those requirements are strange.

If you install a "full sdk" via emsdk, it will install JRE, since the Closure minifier/compiler uses JRE. (that is the only feature that we use Java for). For Emscripten though, JRE is optional, and if not present, Closure minification is then not available. Installing a full SDK via emdk is a convenience that installs a full set of packages, for example, emdsk install latest will install clang, node.js, python, java, and emscripten. If you wanted to explicitly not install python or java, the workflow is then instead to explicitly specify only the packages that you want, e.g. emsdk install clang-e1.37.36-64bit emscripten-tag-1.37.36-64bit node-8.9.1-64bit if you only want clang, node.js and emscripten, but want to omit python and java. That is, a "SDK" in emsdk is in itself just a shorthand alias to a list of predetermined set of good packages.

@kripken
Copy link
Member

kripken commented Apr 27, 2018

Thanks @juj, now I see where part of the confusion here arose - the emsdk readme was not in sync with the emscripten docs. I opened #141.

Hillsie added a commit to Hillsie/emsdk that referenced this issue Sep 17, 2019
…es issue to reduce the number of future git issues being raised about the Python ... urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate ... exception. This issue has resulted in continuous stream of issues with common problems in: emscripten-core#133 emscripten-core#136 emscripten-core#140 emscripten-core#176 #6275 #6548 #6723 #9036 ...
Hillsie added a commit to Hillsie/emsdk that referenced this issue Sep 21, 2019
Hillsie added a commit to Hillsie/emsdk that referenced this issue Sep 24, 2019
…tes issue to reduce the number of issues raised.

The OSX message is [SSL: CERTIFICATE_VERIFY_FAILED] while trying to download files.
While, the Linux Python message is less descriptive.
Error downloading URL 'https://xxxx.xxx.xxx': <urlopen error unknown url type: https>.

This hopefully reduces the stream of common issues raised during installation as a result of the change of Python TLS certs to 2048 or greater.
This change relates to  emscripten-core#133 emscripten-core#136 emscripten-core#140 emscripten-core#176 #6275 #6548 #6723 #9036 … and possibly more.
Hillsie added a commit to Hillsie/emsdk that referenced this issue Sep 29, 2019
…tes to reduce the number of issues raised during SDK installation.

The OSX message is [SSL: CERTIFICATE_VERIFY_FAILED] while trying to download files.
While, the Linux Python message is less descriptive.
Error downloading URL 'https://xxxx.xxx.xxx': <urlopen error unknown url type: https>.

This hopefully reduces the stream of common issues raised during installation as a result of the change of Python TLS certs to 2048 or greater.
This change relates to  emscripten-core#133 emscripten-core#136 emscripten-core#140 emscripten-core#176 #6275 #6548 #6723 #9036 … and possibly more.

Installation can be accomplished by installing the latest Python certificates (pip install certifi), symbolic linking a new python version, and relying on the python shebang line to run $ ./emsdk.py install latest.
Hillsie added a commit to Hillsie/emsdk that referenced this issue Oct 2, 2019
…tes to reduce the number of issues raised during SDK installation.

The OSX message is [SSL: CERTIFICATE_VERIFY_FAILED] while trying to download files.
While, the Linux Python message is less descriptive.
Error downloading URL 'https://xxxx.xxx.xxx': <urlopen error unknown url type: https>.

This hopefully reduces the stream of common issues raised during installation as a result of the change of Python TLS certs to 2048 or greater.
This change relates to  emscripten-core#133 emscripten-core#136 emscripten-core#140 emscripten-core#176 #6275 #6548 #6723 #9036 … and possibly more.

Installation can be accomplished by installing the latest Python certificates (pip install certifi), symbolic linking a new python version, and relying on the python shebang line to run $ ./emsdk.py install latest.
kripken pushed a commit that referenced this issue Oct 7, 2019
The OSX message is [SSL: CERTIFICATE_VERIFY_FAILED] while trying to download files.
While, the Linux Python message is less descriptive.
Error downloading URL 'https://xxxx.xxx.xxx': <urlopen error unknown url type: https>.

This hopefully reduces the stream of common issues raised during installation as a result of the change of Python TLS certs to 2048 or greater.
This change relates to  #133 #136 #140 #176 #6275 #6548 #6723 #9036 … and possibly more.

Installation can be accomplished by installing the latest Python certificates (pip install certifi), symbolic linking a new python version, and relying on the python shebang line to run $ ./emsdk.py install latest.
@yait-202
Copy link

(I'm sorry for my awful English, Im not a native speaker :)) I'm trying to install an emsdk and getting this:

ADMIN@DESKTOP-8VJMACF MINGW64 /c/emsdk (main)
$ ./emsdk install 1.39.8
Python
ADMIN@DESKTOP-8VJMACF MINGW64 /c/emsdk (main)
$

Does anyone know how to solve it?

@sbc100
Copy link
Collaborator

sbc100 commented Feb 15, 2022

Your issue looks unrelated to this one. Can you open a new issue perhaps? I would say that since you are using mingw you might need to be able to investigate and fix any issues you find since its not one of our primary 3 targets and we don't test in that environment (If somebody wanted to take it on they could add testing to out CI). The first thing to try is to run with bash -x to see what the emsdk bash script ends up running for example can you run $ bash -x ./emsdk install 1.39.8 and see which version of python is being used?

@yait-202
Copy link

Oh, sure, I'm sorry. As you can see I'm a new in GitHub, so I should just learn some rules. Thanks a lot for your comment

vargaz pushed a commit to vargaz/emsdk that referenced this issue Nov 22, 2023
…-d7da-47ac-bbc2-badee5bda104

[main] Update dependencies from dotnet/arcade
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

5 participants