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

[Bug]: sabnzbd=4.3.1-2 fails to install due to python-sabyenc3=8.2.0 and cffi Android NDK incompatibility #20243

Open
macearl opened this issue May 17, 2024 · 0 comments · May be fixed by #20244
Labels
bug report Something is not working properly.

Comments

@macearl
Copy link

macearl commented May 17, 2024

Problem description

sorry for yet another issue regarding sabnzbd=4.3.1-2 it seems someone has angered some sort of dependency god somewhere...

sabnzd=4.3.1-2 does not install nor run due to some more dependency problems

  • cffi requires a newer ndk or temporary fix from: [Python py project unable to build wheel]:  #20039 to be able to be built.

  • Additionally sabnzbd=4.3.1-2 does not work even after applying that temporary fix as python-sabyenc3 was already updated to 8.2 in d3893d8 but sabnzbd=4.3.1-2 still expects 8.1. The current RC bumped it's requirement of sabctools (python-sabyenc3) to 8.2: sabnzbd/sabnzbd@989e215

As upstream probably still won't always bump those versions at the same time maybe it would be a good idea to exclude both sabnzbd as well as python-sabyenc3 from auto-updates and make sure to not update one of them without the other?

I did have some time to read the build environment documentation and was able to do some testing of my own this time and build sabnzbd=4.3.2RC1 after changing the TERMUX_PKG_VERSION and TERMUX_PKG_SHA256:

diff --git a/packages/sabnzbd/build.sh b/packages/sabnzbd/build.sh
index 98b1dc08a..df8197a6b 100644
--- a/packages/sabnzbd/build.sh
+++ b/packages/sabnzbd/build.sh
@@ -3,10 +3,10 @@ TERMUX_PKG_DESCRIPTION="Fully automated Usenet Binary Downloader"
 TERMUX_PKG_LICENSE="GPL-2.0, GPL-3.0"
 TERMUX_PKG_LICENSE_FILE="LICENSE.txt, GPL2.txt, GPL3.txt"
 TERMUX_PKG_MAINTAINER="@termux"
-TERMUX_PKG_VERSION="4.3.1"
+TERMUX_PKG_VERSION="4.3.2RC1"
-TERMUX_PKG_REVISION=2
+TERMUX_PKG_REVISION=0
 TERMUX_PKG_SRCURL=https://github.com/sabnzbd/sabnzbd/releases/download/${TERMUX_PKG_VERSION}/SABnzbd-${TERMUX_PKG_VERSION}-src.tar.gz
-TERMUX_PKG_SHA256=c9902c212df3e6b7208c850e6ceab244afc4b3e173459c425db9be4df902bd44
+TERMUX_PKG_SHA256=c216d309088a5d3953a1931af3c48160954edaae72b87ac0af8af85d4aa51eda
 TERMUX_PKG_AUTO_UPDATE=true
 TERMUX_PKG_DEPENDS="python, python-cryptography, python-sabyenc3, termux-tools, par2, unrar, p7zip, unzip"
 TERMUX_PKG_PLATFORM_INDEPENDENT=true

I'm not sure if this is expected behaviour but i also had to bootstrap glib according to #20070 (comment) and building some additional packages first as it did not pick them up correctly as dependencies or was not able to build the wheels for them

Here are the steps I had to run in a clean docker build environment:

  1. remove all mentions of gobject-introspection from glib's build.sh and disable it through the flag:
sed -r -i'.bak' 's/TERMUX_PKG_BUILD_DEPENDS/#TERMUX_PKG_BUILD_DEPENDS/;s/-Dintrospection=enabled/-Dintrospection=disabled/;s/(.*)(gobject-introspection-1.0.pc)/echo ""\n#\1\2/g;' packages/glib/build.sh
  1. build glib:
./build-package.sh -a aarch64 glib
  1. build gobject-introspection:
./build-package.sh -a aarch64 gobject-introspection
  1. undo changes from 1:
mv -f packages/glib/build.sh{.bak,}
  1. Remove glib file to force rebuilding:
rm -f /data/data/.built-packages/glib
  1. rebuild glib:
./build-package.sh -a aarch64 glib
  1. build python-pip:
./build-package.sh -a aarch64 python-pip
  • when not separately installed sabnzbd fails with:
Building dependency python-pip if necessary...
termux - building python-pip for arch aarch64...
Downloading https://github.com/pypa/pip/archive/24.0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 9177k    0 9177k    0     0  9480k      0 --:--:-- --:--:-- --:--:-- 23.0M
Applying patch: conf.py.patch
Applying patch: fix-hardcoded-paths.patch
Applying patch: install_py_preventing_pip_from_installing.patch
Processing /home/builder/.termux-build/python-pip/src
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
  Building wheel for UNKNOWN (pyproject.toml) ... done
  Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-py3-none-any.whl size=8094 sha256=532c6152d21fea6090bb25ad017aefbc1102d5e53efc0d555d3b7a51050a3847
  Stored in directory: /tmp/pip-ephem-wheel-cache-lnl3n7aj/wheels/f7/7f/bf/a4cc90ed8eb0a7691b7a2d68de29550d8893bc4e88f9637ac1
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
Successfully installed UNKNOWN-0.0.0
ERROR: Package python-pip doesn't build properly.
  1. build python-cryptography:
./build-package.sh -a aarch64 python-cryptography
  • when not separately installed sabnzbd fails with:
Caused by:
        process didn't exit successfully: `/home/builder/.termux-build/python-cryptography/src/src/rust/target/release/build/cryptography-cffi-406b6fe7f725d8e6/build-script-build` (exit status: 101)
        --- stdout
        cargo:rustc-check-cfg=cfg(python_implementation, values("CPython", "PyPy"))
        cargo:rerun-if-env-changed=PYO3_PYTHON
        cargo:rerun-if-changed=../../_cffi_src/
        cargo:rerun-if-changed=../../cryptography/__about__.py
      
        --- stderr
        thread 'main' panicked at cryptography-cffi/build.rs:39:9:
        failed to run build_openssl.py, stdout:
      
        stderr:
        Traceback (most recent call last):
          File "/home/builder/.termux-build/python-cryptography/src/src/rust/cryptography-cffi/../../_cffi_src/build_openssl.py", line 18, in <module>
            ffi = build_ffi_for_binding(
                  ^^^^^^^^^^^^^^^^^^^^^^
          File "/home/builder/.termux-build/python-cryptography/src/src/rust/cryptography-cffi/../../_cffi_src/utils.py", line 49, in build_ffi_for_binding
            return build_ffi(
                   ^^^^^^^^^^
          File "/home/builder/.termux-build/python-cryptography/src/src/rust/cryptography-cffi/../../_cffi_src/utils.py", line 61, in build_ffi
            ffi = FFI()
                  ^^^^^
          File "/tmp/pip-build-env-3dc6tmkn/overlay/lib/python3.11/site-packages/cffi/api.py", line 48, in __init__
            import _cffi_backend as backend
        ModuleNotFoundError: No module named '_cffi_backend'
  1. build sabnzbd:
./build-package.sh -a aarch64 sabnzbd

I would have assumed that everything except maybe glib, due to the bootstrapping stuff, should have been picked up automatically and no additional build steps would be required. But then again maybe I did something wrong. After reading the Order of build steps my first guess would be that the problem is the -s for the installation/build of the dependencies?

Otherwise obtain the dependency build order from script ./scripts/buildorder.pyand execute ./build-package.sh with argument -s for each dependency package.

-s - Skip dependency check.

which then would prevent the installation of the dependencies of all packages on which sabnzbd depends?

Anyways: This 4.3.2RC1 package then installs and runs without a problem with my termux installation, where I had already applied the temporary fix from: #20039 to be able to install sabnzbd=4.3.1-2 while pinning python-sabyenc3 to 8.1

4.3.2 probably will be released soon and we probably can't really fix the NDK problem until there is a new release for it as well, so there are probably two options:

  1. downgrade sabnzbd and python-sabyenc3 to the latest working versions with the old ndk and without the temporary fix.
  2. wait for a new release of sabnzbd and a new Android NDK and leave sabnzdb broken for now.

What steps will reproduce the bug?

Installing sabnzbd with the newest package base

What is the expected behavior?

sabnzbd should be installed and run without problems

System information

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=12866
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://ftp.fau.de/termux/termux-main stable main
# root-repo (sources.list.d/root.list)
deb https://ftp.fau.de/termux/termux-root root stable
Updatable packages:
All packages up to date
termux-tools version:
1.42.1
Android version:
14
Kernel build information:
Linux localhost 4.9.337-perf-g56f4118d056c #1 SMP PREEMPT Fri May 3 21:35:49 UTC 2024 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
POCO F1
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
@macearl macearl added bug report Something is not working properly. untriaged labels May 17, 2024
@tqfx tqfx linked a pull request May 17, 2024 that will close this issue
@licy183 licy183 removed the untriaged label May 17, 2024
tqfx added a commit to tqfx/termux-packages that referenced this issue May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants