AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 18 Bitcoin

android build: patch hostpython3 to not install setuptools

Public commit record

What the developer wrote

Authored by f321x

100/100 · Strong
android build: patch hostpython3 to not install setuptools

Add a patch to the hostpython3 p4a recipe to prevent it from
installing setuptools as part of the ensurepip invocation.
Setuptools is later installed from a hash-pinned recipe.

---

NOTE(ghost43): this is a workaround for reproducible-build issues we ran into
during the 4.8.0 release. see https://github.com/spesmilo/electrum/pull/10739#issuecomment-4904680121

Since the last p4a rebase, p4a is installing some python packages using "pip install --target". We noticed that hostpython had two different versions of setuptools installed at the same time (two dist-info folders in site-packages/). This is due to the `--target` option for `pip install`. We are calling it with `--upgrade` too, but even then apparently it does not remove old versions. Indeed, when testing locally in a venv it leaves all .dist-infos there hanging. According to https://github.com/pypa/pip/issues/13763#issuecomment-3783977222, `--target` is not suitable or intended for this usecase at all.

Current patch is only focused on setuptools, as a minimal workaround. Ultimately the same issue could arise with any other package. For example, still with ensurepip itself, we could be left with multiple versions of pip installed. Or anything we install via hostpython_prerequisites could have duplicate versions installed...
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This change adjusts how the Electrum Android app is built so that the build process installs only one specific, checked version of a helper library called setuptools, instead of accidentally ending up with two copies. Having two copies could make builds unpredictable from one run to the next. The patch itself is a build-hygiene fix aimed at reproducibility, not a direct fix for an active security flaw.

Recommended action

Treat as a normal build-maintenance patch. Reviewers can verify the patch matches the upstream CPython 3.12 change (gh-95299 / PR 101039) and that the pinned setuptools dependency remains hash-pinned. No urgent security response is indicated by the commit itself.

Security signals we found

01

Build reproducibility / deterministic build hardening

02

Supply-chain adjacent: prevents co-installation of unpinned and pinned versions of setuptools during Android build

03

No runtime code change to Electrum wallet logic

04

No CVE, advisory, or exploit referenced in commit

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.