Skip to content

Installing Python 3.13.0 on Android proot-chroot (Debian Environment) #125381

Open
@b9Joker108

Description

@b9Joker108

Bug report

Bug description:

Environment:

  • Device: Unrooted Android
  • Container: proot-chroot
  • Distribution: Debian 12
  • Tool: pyenv

Steps and Issues Encountered:

  1. Install Dependencies:

    • apt-get install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev xz-utils tk-dev libgdbm-dev libc6-dev libffi-dev
    • All dependencies installed without issues.
  2. Configure and Compile libtinfo:

    • Downloaded source for libtinfo via apt-get source libtinfo-dev.
    • Recompiled with -fPIC flag using:
      cd ncurses-6.4
      make clean
      CFLAGS="-fPIC" ./configure --host=aarch64-linux-gnu --prefix=/usr --with-shared --with-termlib
      make
      make install
    • Successfully compiled libtinfo.
  3. Configure and Compile Python 3.13.0:

    • Downloaded Python 3.13.0 source:
      wget https://www.python.org/ftp/python/3.13.0/Python-3.13.0.tgz
      tar -xzf Python-3.13.0.tgz
      cd Python-3.13.0
    • In a build directory, ran the configuration script with optimizations:
      ../configure --enable-optimizations --prefix=$HOME/.pyenv/versions/3.13.0
    • Modified Makefile to remove -Werror and fix implicit-function-declaration:
      sed -i 's/-Werror//g' Makefile
      sed -i 's/ =implicit-function-declaration/ /g' Makefile
    • Attempted to compile:
      make
      make install
    • Compilation failed with libtinfo linkage errors.
  4. Revisit libtinfo:

    • Ensured all steps for libtinfo recompile were correctly followed.
    • Reattempted Python build multiple times with no success.
  5. Considered Alternative Approaches:

    • Considered excluding libtinfo with ./configure --without-curses, but concerned about compromised functionality.
    • Explored Docker, but ruled out due to root privileges requirement.
    • Tried to find a pre-compiled binary for aarch64 from s reputable source, without success.

Current Status:

  • Compilation repeatedly fails with dangerous relocation errors when linking libtinfo.
  • Seeking guidance or solutions from community or developers experienced with Python on ARM architecture, particularly Android environments.

Termux Info

(base) root@localhost:~ # termux-info
Termux Variables:
unsupported
Packages CPU architecture:
arm64
Subscribed repositories:
# sources.list
deb https://mirrors.middlendian.com/termux/termux-main stable main
# sources.list.d/pointless.list
deb https://its-pointless.github.io/files/21 termux extras
# sources.list.d/ivam3-termux-packages.list
deb [trusted=yes arch=all] https://ivam3.github.io/termux-packages stable extras
# sources.list.d/x11.list
deb https://mirrors.middlendian.com/termux/termux-x11 x11 main
# sources.list.d/tur.list
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# sources.list.d/root.list
deb https://mirrors.middlendian.com/termux/termux-root root stable
# sources.list.d/rendiix.list
deb https://rendiix.github.io android-tools termux
Updatable packages:
Running as root. Cannot check package updates.
termux-tools version:
1.43.6
Android version:
14
Kernel build information:
Linux localhost 6.2.1-PRoot-Distro #1 SMP PREEMPT Thu Jul 11 02:48:07 UTC 2024 aarch64 GNU/Linux
Device manufacturer:
samsung
Device model:
SM-X910
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=
Installed termux plugins:
com.termux.widget versionCode:13
com.termux.x11 versionCode:14
com.termux.api versionCode:51
com.termux.window versionCode:15
com.termux.styling versionCode:1000

Logs:

TBP

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixesOS-androidbuildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions