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

Failed to build from source. openssl-1.1.1s.tar.gz not available #8838

Closed
Giszmo opened this issue Jan 21, 2024 · 2 comments
Closed

Failed to build from source. openssl-1.1.1s.tar.gz not available #8838

Giszmo opened this issue Jan 21, 2024 · 2 comments

Comments

@Giszmo
Copy link

Giszmo commented Jan 21, 2024

I'm trying to reproduce the apk from Google for version 4.4.6.0 and building as I always build it, I run into:

[INFO]:    Downloading openssl from https://www.openssl.org/source/openssl-1.1.1s.tar.gz
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/python-for-android/pythonforandroid/toolchain.py", line 1275, in <module>
    main()
  File "/opt/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/opt/python-for-android/pythonforandroid/toolchain.py", line 724, in __init__
    getattr(self, command)(args)
  File "/opt/python-for-android/pythonforandroid/toolchain.py", line 152, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/opt/python-for-android/pythonforandroid/toolchain.py", line 211, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/opt/python-for-android/pythonforandroid/build.py", line 598, in build_recipes
    recipe.download_if_necessary()
  File "/opt/python-for-android/pythonforandroid/recipe.py", line 362, in download_if_necessary
    self.download()
  File "/opt/python-for-android/pythonforandroid/recipe.py", line 412, in download
    self.download_file(self.versioned_url, filename)
  File "/opt/python-for-android/pythonforandroid/recipe.py", line 216, in download_file
    urlretrieve(url, target, report_hook)
  File "/usr/lib/python3.9/urllib/request.py", line 239, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.9/urllib/request.py", line 523, in open
    response = meth(req, response)
  File "/usr/lib/python3.9/urllib/request.py", line 632, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.9/urllib/request.py", line 561, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
Download failed: HTTP Error 404: Not Found; retrying in 1 second(s)...Download failed: HTTP Error 404: Not Found; retrying in 2 second(s)...Download failed: HTTP Error 404: Not Found; retrying in 4 second(s)...Download failed: HTTP Error 404: Not Found; retrying in 8 second(s)...# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=Electrum --bootstrap=qt5 --requirements=hostpython3,python3,android,openssl,plyer,libffi,libsecp256k1,cryptography,pyqt5sip,pyqt5,pillow,libzbar --arch x86_64 --copy-libs --local-recipes /home/user/wspace/electrum/contrib/android/p4a_recipes --color=always --storage-dir="/home/user/wspace/electrum/.buildozer/android/platform/build-x86_64" --ndk-api=21 --ignore-setup-py
@SomberNight
Copy link
Member

SomberNight commented Jan 21, 2024

I guess openssl.org does not host historical packages... That's a bit disappointing. :/
I wonder how this was not noticed before, for earlier versions. (though I guess not many people attempt reproducible builds for old versions)


I have a local backup of the missing file, uploaded here: openssl-1.1.1s.tar.gz

url_version = "1.1.1s"
sha512sum = "2ef983f166b5e1bf456ca37938e7e39d58d4cd85e9fc4b5174a05f5c37cc5ad89c3a9af97a6919bcaab128a8a92e4bdc8a045e5d9156d90768da8f73ac67c5b9"


As a temp fix, a patch like this might work, though I haven't tested it:

diff --git a/contrib/android/p4a_recipes/openssl/__init__.py b/contrib/android/p4a_recipes/openssl/__init__.py
index ae022020fa..616e539b10 100644
--- a/contrib/android/p4a_recipes/openssl/__init__.py
+++ b/contrib/android/p4a_recipes/openssl/__init__.py
@@ -13,6 +13,7 @@ assert OpenSSLRecipe.python_depends == []
 class OpenSSLRecipePinned(util.InheritedRecipeMixin, OpenSSLRecipe):
     url_version = "1.1.1s"
     sha512sum = "2ef983f166b5e1bf456ca37938e7e39d58d4cd85e9fc4b5174a05f5c37cc5ad89c3a9af97a6919bcaab128a8a92e4bdc8a045e5d9156d90768da8f73ac67c5b9"
+    url = 'https://github.com/spesmilo/electrum/files/14001922/openssl-1.1.1s.tar.gz'
 
 
 recipe = OpenSSLRecipePinned()

@Giszmo
Copy link
Author

Giszmo commented Jan 21, 2024

Yeah, I guess a provider hosting a binary blob is kind of not great to check if the product can be trusted. That said, I just realized I had not gotten the latest version from Google Play so I was testing 4.4.6.0 again which I had reproduced successfully earlier.

Sorry for the noise. On to checking 4.5.1.0 that I just received now.

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

No branches or pull requests

2 participants