-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Update upstream URL for libjpeg. NFC #13869
Conversation
The old URL seems to be generating `Forbidden!`. I wonder if we should start maintaining our own mirror to avoid this kind of thing.
Landing TBR to unblock CI |
Yes, if there is no unreliable upstream repo for this, we should create a mirror in emscripten-ports and use that. |
Thanks! The actual error for this was,
in case someone searches for it on Github and is not able to find the relevant issue. |
Are you sure this fixes it though @sbc100 ? I'm still getting the same error with the new URL if >>> from tools import system_libs
>>> system_libs.Ports().fetch_project('libjpeg', 'https://www.ijg.org/files/jpegsrc.v9c.tar.gz', 'jpeg-9c')
system_libs:INFO: retrieving port: libjpeg from https://www.ijg.org/files/jpegsrc.v9c.tar.gz
Traceback (most recent call last):
File "/src/emsdk/emsdk/upstream/emscripten/tools/system_libs.py", line 1707, in retrieve
import requests
ModuleNotFoundError: No module named 'requests'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/src/emsdk/emsdk/upstream/emscripten/tools/system_libs.py", line 1756, in fetch_project
retrieve()
File "/src/emsdk/emsdk/upstream/emscripten/tools/system_libs.py", line 1712, in retrieve
f = urlopen(url)
File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden If |
No requests is not needed. The error here is "urllib.error.HTTPError: HTTP Error 403: Forbidden". Can you run |
All of curl, wget and that URL in the browser work. The issue seems to be with urllib specifically which is used in >>> from urllib.request import urlopen
>>> res = urlopen("https://www.ijg.org/files/jpegsrc.v9c.tar.gz")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden This happens both in CI and locally so it shouldn't be location dependent. If a different user-agent is passed in headers, then the download works. So they seem to be blocking the urllib user agent. |
How odd... seems like maybe misconfigured webserver? |
I'll mirror the archive on google cloud storage |
They probably added it to the deny list for some reason mesonbuild/libjpeg#9 (comment) . Thanks! |
It turns out that the www.ijg.org refused requests from the urllib library for some reason. This issues was being masked by the fact that system_libs.py prefers to use `requests` when it is installed. This change undoes that. This feature was originally added in #8667 to deal with older python installations but these days we supply our own python as part of emsdk so we should be able to depend on a recent/correct version. Having the fallback here just makes testing harder. Fixes: #13869
It turns out that the www.ijg.org refused requests from the urllib library for some reason. This issues was being masked by the fact that system_libs.py prefers to use `requests` when it is installed. This change undoes that. This feature was originally added in #8667 to deal with older python installations but these days we supply our own python as part of emsdk so we should be able to depend on a recent/correct version. Having the fallback here just makes testing harder. Fixes: #13869
It turns out that the www.ijg.org refused requests from the urllib library for some reason. This issues was being masked by the fact that system_libs.py prefers to use `requests` when it is installed. This change undoes that. This feature was originally added in #8667 to deal with older python installations but these days we supply our own python as part of emsdk so we should be able to depend on a recent/correct version. Having the fallback here just makes testing harder. Fixes: #13869
The old URL seems to be generating
Forbidden!
.I wonder if we should start maintaining our own mirror to avoid
this kind of thing.