Skip to content

ADFA-6386: Build terminal packages for org.appdevforall.codeonthego - #3

Open
jimturner-adfa wants to merge 7 commits into
mainfrom
ADFA-6386-terminal-package-rebuild-for-renaming
Open

jimturner-adfa wants to merge 7 commits into
mainfrom
ADFA-6386-terminal-package-rebuild-for-renaming

Conversation

@jimturner-adfa

@jimturner-adfa jimturner-adfa commented Oct 14, 2026 •

Copy link
Copy Markdown

ADFA-6386

Important

Merge together with the Code On The Go application-id flip. These packages have /data/data/org.appdevforall.codeonthego/files/usr baked into every binary, so they only run under the new application id. The source rename is appdevforall/CodeOnTheGo#2136 (ADFA-174); the id flip itself is Phase 3 of CoGo's ADR 0017.

Builds the terminal packages for org.appdevforall.codeonthego instead of com.itsaky.androidide, and fixes the issues that stopped the build.

Commit What it is
fce4362 COTG_PACKAGE_NAME -> org.appdevforall.codeonthego - the only place the package name is set; build.sh derives everything else from it
35e30fb foot source checksum: Codeberg regenerated the 1.25.0 archive. Its contents were checked against the 1.25.0 git tag and are identical.
5aff857 dos2unix now downloads from SourceForge: the XS4ALL homepage host is gone. The SourceForge file matches the pinned SHA-256, so the checksum is unchanged.
b899e1d CI builds its builder image from the pinned submodule's own Dockerfile instead of package-builder:latest, which no longer matches the pinned recipes (it has NDK r30 where they need r29, and python3.14 where they need 3.12)
4932d9c apr-util, nano and giflib download from the URLs their releases moved to; the files match the pinned SHA-256s. Every remaining source in the build order was checked the same way up front.
4ad2773 requires brotli before generating bootstraps - without it, generate-bootstraps.sh deleted the JDK's ct.sym (breaking javac --release) and still reported success. Also fixes scribe_check_command, which called an undefined err.
40b0ac6 COTG_REPO -> https://packages.appdevforall.org/apt/codeonthego-main

The new paths are within termux-packages' length limits, which the build checks: data dir 39 of 69, rootfs 45 of 86, prefix 49 of 90.

Package repository

COTG_REPO now defaults to https://packages.appdevforall.org/apt/codeonthego-main, separate from termux-main, which existing installs keep using. Before publishing, re-patch termux-packages and rebuild termux-tools: the repo URL is written into its sources.list at setup time, and the packages built so far still carry termux-main.

CI note

The repo is on GitHub, but its only CI config is this .gitlab-ci.yml (inherited from Scribe), so no pipeline runs for this repo today. b899e1d makes that config correct; wiring it up, or porting it to GitHub Actions, is a separate decision.

Verification

  • Local aarch64 build of all 176 packages in a builder image built from the pinned Dockerfile; the bootstrap is generated from a local file:// repo. Package contents use the new prefix, e.g. ./data/data/org.appdevforall.codeonthego/files/usr/bin/bash.
  • On a Pixel 6 Pro, with CoGo built for org.appdevforall.codeonthego (CodeOnTheGo#2179):
    • setup unpacks the bootstrap;
    • bash, git, python3 (with ssl and sqlite3), java/javac 21 (javac --release 17), apt and curl run from the new prefix;
    • a project syncs and builds to an APK in-app.
  • Not tested: apt install from inside the terminal, which needs the new repository published.

🤖 Generated with Claude Code

yaturner and others added 4 commits October 13, 2026 13:45
Code On The Go is moving its application id from com.itsaky.androidide
to org.appdevforall.codeonthego (CodeOnTheGo ADR 0017, ADFA-174). The
package name is baked into every package's prefix
(/data/data/<pkg>/files/usr), so packages built for one id do not run
under the other - this must ship together with the app's id flip.

COTG_PACKAGE_NAME is the single source: build.sh rewrites com.termux to
it across termux-packages and generates the termux-tools patch from it.
New paths are within termux-packages' length limits (data dir 39/69,
rootfs 45/86, prefix 49/90), which the build validates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ncurses pulls foot's terminfo from the foot 1.25.0 source archive.
Codeberg regenerated that archive, so its SHA-256 no longer matches the
one pinned in termux-packages and every build fails at ncurses.

Verified the new archive's extracted tree is identical to the foot 1.25.0
git tag (b44a62724cd5); only the archive packaging changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dos2unix's upstream URL (waterlan.home.xs4all.nl) is dead: the XS4ALL
homepage service shut down and returns an HTML not-found page, so every
build fails the checksum at dos2unix.

SourceForge hosts the same 7.5.2 release tarball; it matches the pinned
SHA-256, so the checksum is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ghcr.io/termux/package-builder only publishes :latest, which follows
upstream termux-packages and drifts from our pinned submodule. Against
the current image every build fails: NDK r29 is missing (image has r30)
and recipes such as xcb-proto and vim call python3.12 (image has 3.14).

Add an image stage that builds the builder from the submodule's own
scripts/Dockerfile via docker-in-docker, cached in the project registry
per submodule commit, and run build-packages in it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yaturner and others added 3 commits October 22, 2026 08:05
Each pinned source URL now 404s: apr-util 1.6.3 left downloads.apache.org
for archive.apache.org, nano 8.7 is no longer dist/latest, and giflib
moved into a giflib-5.x folder on SourceForge. The files at the new URLs
match the pinned SHA-256s, so checksums are unchanged.

Checked every remaining source in the bootstrap build order the same way;
these were the only dead URLs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generate-bootstraps.sh repacks the JDK's ct.sym with brotli without
checking the result. With no brotli on the host it deletes ct.sym, prints
"ct.sym repacked" and produces a bootstrap whose javac cannot use
--release. brotli is not in the termux builder image.

Check for it up front, and fix scribe_check_command, which called an
undefined 'err' function and so reported "err: command not found"
instead of naming the missing tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Packages built for org.appdevforall.codeonthego do not run under the old
com.itsaky.androidide install, so they must not land in termux-main, which
existing installs keep using. Default COTG_REPO to apt/codeonthego-main.

The URL is baked into termux-tools' sources.list at setup time: re-patch
termux-packages and rebuild termux-tools before publishing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Daniel-ADFA Daniel-ADFA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 40b0ac6. terminal-packages has no written review rules (no CLAUDE.md, REVIEW.md or CONTRIBUTING.md), so the default severity rules applied.

IMPORTANT

  • common.sh:23 - a previously patched termux-packages tree keeps the old package name

MINOR

  • .gitlab-ci.yml:4 - the publish job still pushes to Scribe's repository
  • .gitlab-ci.yml:30 - the build matrix still builds x86_64, which build.sh rejects
  • generate-bootstrap-archive.sh:114 - other ct.sym repack failures still pass silently

NITPICK - 3 inline, not listed

Checked and fine: scribe_error exists, so the utils.sh fix is right; docker:27 ships git; the Docker build context matches termux's own (scripts/); every new patch's pre-image matches the pinned submodule 8b23d78; dos2unix, foot, giflib and nano download from the new URLs and match their pinned SHA-256. Not verified: the apr-util archive.apache.org URL, which was unreachable from the review machine.

Comment thread common.sh

# The package name of the intended application
COTG_PACKAGE_NAME="com.itsaky.androidide"
COTG_PACKAGE_NAME="org.appdevforall.codeonthego"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMPORTANT: On a termux-packages tree that was patched before this change, the new package name, repo URL and the three new patches never take effect.

build.sh:249 skips setup_termux_packages whenever termux-packages/.scribe-patched exists. Even without the marker, the package-name sed only matches com.termux, which the earlier run already rewrote to com.itsaky.androidide. So anyone who built before pulls this, runs ./build.sh -a aarch64, and gets packages with the /data/data/com.itsaky.androidide prefix and termux-main sources, with no error. Those packages don't run under the new app id.

Fix: record the package name, repo URL and patch list in .scribe-patched, and fail (or reset the submodule and re-patch) when they differ from the current config.

Comment thread .gitlab-ci.yml
stages:
- image
- build
- publish

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR: publish-packages still pushes to Scribe's GitLab repository, not to the codeonthego-main repository this PR points COTG_REPO at.

The job, outside this diff, clones scribe-oss/core/scribe-packages-repo and commits as "Scribe CI". Once CI is wired up, a green pipeline would publish the CoGo packages there and leave packages.appdevforall.org/apt/codeonthego-main empty, so apt inside the app finds nothing. No pipeline runs today, but it contradicts the description's claim that the config is now correct.

Fix: point the publish job at the CoGo package host, or remove it until CI is wired up.

Comment thread .gitlab-ci.yml
- docker tag "$CI_REGISTRY_IMAGE/package-builder:$SUBMODULE_TAG" "$CI_REGISTRY_IMAGE/package-builder:$CI_COMMIT_SHA"
- docker push "$CI_REGISTRY_IMAGE/package-builder:$CI_COMMIT_SHA"

build-packages:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR: The build matrix still lists x86_64, which build.sh rejects, so this config still can't produce a full build.

The defect is at .gitlab-ci.yml:44, outside this diff. common.sh only allows aarch64 and arm, so build-packages [x86_64] exits at build.sh:222 with "Unsupported arch", arm is never built, and publish-packages, which needs every build job, never runs. No pipeline runs for this repo today, so nothing hits it yet, but the description says b899e1d makes this config correct.

Fix: change the matrix, and ARCHS in the publish job, to aarch64 and arm, or narrow the claim in the description.


# generate-bootstraps.sh repacks the JDK's ct.sym with brotli and does not
# check the result: without brotli it deletes ct.sym and still reports success.
scribe_check_command "brotli"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR: The brotli check covers only a missing binary; any other failure while repacking ct.sym still deletes it and reports success.

The defect is in patches/scripts-generate-bootstraps-CoGo-changes.patch, outside this diff: the subshell runs rm "$ctsym" before brotli -Zo, and sits in a ( ... ) && ... list, so its status is that of the final rm ct.sym. A failing unzip, zip or brotli (disk full, corrupt input) still prints "ct.sym repacked", and the bootstrap ships without ct.sym, which breaks javac --release on device. With brotli installed no current run hits this, but the check doesn't close it.

Fix: in the patch, fail the subshell on any step (|| exit 1 per step) and only replace ct.sym once brotli has written a complete file.

Comment thread .gitlab-ci.yml
# termux-packages and drifts from our pinned submodule (e.g. NDK r30 vs r29,
# python3.14 vs python3.12). Build the builder image from the pinned
# submodule's own Dockerfile instead, cached per submodule commit.
builder-image:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NITPICK: builder-image has no runner tag or timeout, unlike build-packages, which pins saas-linux-xlarge-amd64 and 6h.

On a cache miss this job builds the whole package-builder image (Ubuntu, Android SDK, NDK) in docker:dind on GitLab's default runner and default timeout. I couldn't verify whether that fits; the build job's explicit choice suggests it may not.

Fix: give it the same tag and an explicit timeout.

Comment thread .gitlab-ci.yml
docker push "$CI_REGISTRY_IMAGE/package-builder:$SUBMODULE_TAG"
fi
# job images can't use runtime variables, so also tag with the pipeline's commit
- docker tag "$CI_REGISTRY_IMAGE/package-builder:$SUBMODULE_TAG" "$CI_REGISTRY_IMAGE/package-builder:$CI_COMMIT_SHA"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NITPICK: On a cache hit, every pipeline still pulls the full builder image only to add a per-commit tag, and those tags are never cleaned up.

Each pipeline spends minutes and runner disk on a multi-GB docker pull, and the registry gains one tag per commit.

Fix: retag at the manifest level (docker buildx imagetools create -t ...:$CI_COMMIT_SHA ...:$SUBMODULE_TAG) and add a cleanup policy for the per-commit tags.

TERMUX_PKG_VERSION="1.25.0"
TERMUX_PKG_SRCURL=https://codeberg.org/dnkl/foot/archive/${TERMUX_PKG_VERSION}.tar.gz
-TERMUX_PKG_SHA256=442a42d576ec72dd50f2d3faea8a664230a47bac79dc1eb6e7c9125ee76c130f
+TERMUX_PKG_SHA256=ee9d0e51295945157ecb33119cb2c79b276093d0fd342d959d78d772d505571c

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NITPICK: This checksum pins an archive Codeberg generates on demand, and it has already been regenerated once.

The next regeneration breaks foot again, and ncurses, which takes foot's terminfo from the same tarball, with it.

Fix: if foot publishes a release tarball for 1.25.0, point SRCURL there; otherwise say in the patch comment that this checksum may drift again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants