Skip to content

[Bug]: bzip2 not found when building bootstrap — bzip2 is a subpackage of libbz2 (should depend on/build libbz2) #27093

@wuxianggujun

Description

@wuxianggujun

Problem description

When building a custom bootstrap with scripts/build-bootstraps.sh (aarch64), the process fails on step “Building dependency bzip2” with:

ERROR: No package bzip2 found in any of the enabled repositories. Are you trying to set up a custom repository?

In Termux, bzip2 is not a top-level package; it is a subpackage of libbz2. Putting bzip2 into the bootstrap PACKAGES=(...) list (or into TERMUX_PKG_DEPENDS) causes the builder to look for a non-existent “bzip2” top-level package.

Impact: Bootstrap builds (or package builds) fail if bzip2 is referenced directly instead of libbz2.

Minimal fix (works in practice):

  • In bootstrap/package scripts, replace bzip2 with libbz2. Building/depending on libbz2 produces the bzip2 subpackage (command) alongside the library.
Image

What steps will reproduce the bug?

  1. Edit scripts/build-bootstraps.sh and include bzip2 in:

    PACKAGES=( ... bzip2 )
  2. Run:

    ./scripts/build-bootstraps.sh --architectures aarch64
  3. Observe:

    ERROR: No package bzip2 found in any of the enabled repositories.
    

What is the expected behavior?

  • Bootstrap and package builds should succeed when referencing the correct package name.
  • If bzip2 is needed, depending on/building libbz2 should provide both the library and the bzip2 subpackage (CLI).

Actual behavior

  • Builder aborts with “No package bzip2 found …” because bzip2 is not a top-level package in the Termux repo.

Proposed fix / suggestions

  • Documentation & examples: Clarify in bootstrap docs and relevant recipes that bzip2 is delivered via the libbz2 package (subpackage bzip2), so scripts should reference libbz2.

  • Optional UX improvements:

    • In scripts/list-packages.sh or error messages, hint that "bzip2 is a subpackage of libbz2".
    • A lint check to warn when bzip2 appears in PACKAGES or TERMUX_PKG_DEPENDS (suggest libbz2 instead).

Workaround used: Replace bzip2 with libbz2 in bootstrap PACKAGES=(...), then rebuild:

# Clean any old marks/artifacts
rm -rf ~/.termux-build/libbz2* ~/.termux-build/*bzip2*
rm -f /data/data/.built-packages/libbz2 /data/data/.built-packages/bzip2

# Build libbz2 (produces bzip2 subpackage)
./build-package.sh -a aarch64 libbz2

# Rebuild bootstrap
./scripts/build-bootstraps.sh --architectures aarch64

System information

Not running on device; reproduced in Termux package-builder Docker container.

Builder image: ghcr.io/termux/package-builder
Host OS: Docker on Windows (PowerShell) 
Arch: aarch64
Repo: termux/termux-packages (HEAD: 90304dd649)

Build command:
  ./scripts/build-bootstraps.sh --architectures aarch64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug reportSomething is not working properlypackagingIssue related to building packages, not affecting end users directly

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions