Repository navigation
ADFA-6386: Build terminal packages for org.appdevforall.codeonthego - #3
jimturner-adfa wants to merge 7 commits into
Conversation
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>
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
left a comment
There was a problem hiding this comment.
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.
|
|
||
| # The package name of the intended application | ||
| COTG_PACKAGE_NAME="com.itsaky.androidide" | ||
| COTG_PACKAGE_NAME="org.appdevforall.codeonthego" |
There was a problem hiding this comment.
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.
| stages: | ||
| - image | ||
| - build | ||
| - publish |
There was a problem hiding this comment.
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.
| - 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: |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
| # 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: |
There was a problem hiding this comment.
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.
| 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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
ADFA-6386
Important
Merge together with the Code On The Go application-id flip. These packages have
/data/data/org.appdevforall.codeonthego/files/usrbaked 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.codeonthegoinstead ofcom.itsaky.androidide, and fixes the issues that stopped the build.fce4362COTG_PACKAGE_NAME->org.appdevforall.codeonthego- the only place the package name is set;build.shderives everything else from it35e30fbfootsource checksum: Codeberg regenerated the 1.25.0 archive. Its contents were checked against the1.25.0git tag and are identical.5aff857dos2unixnow downloads from SourceForge: the XS4ALL homepage host is gone. The SourceForge file matches the pinned SHA-256, so the checksum is unchanged.b899e1dDockerfileinstead ofpackage-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)4932d9capr-util,nanoandgiflibdownload 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.4ad2773brotlibefore generating bootstraps - without it,generate-bootstraps.shdeleted the JDK'sct.sym(breakingjavac --release) and still reported success. Also fixesscribe_check_command, which called an undefinederr.40b0ac6COTG_REPO->https://packages.appdevforall.org/apt/codeonthego-mainThe 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_REPOnow defaults tohttps://packages.appdevforall.org/apt/codeonthego-main, separate fromtermux-main, which existing installs keep using. Before publishing, re-patchtermux-packagesand rebuildtermux-tools: the repo URL is written into itssources.listat setup time, and the packages built so far still carrytermux-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.b899e1dmakes that config correct; wiring it up, or porting it to GitHub Actions, is a separate decision.Verification
aarch64build of all 176 packages in a builder image built from the pinnedDockerfile; the bootstrap is generated from a localfile://repo. Package contents use the new prefix, e.g../data/data/org.appdevforall.codeonthego/files/usr/bin/bash.org.appdevforall.codeonthego(CodeOnTheGo#2179):bash,git,python3(withsslandsqlite3),java/javac21 (javac --release 17),aptandcurlrun from the new prefix;apt installfrom inside the terminal, which needs the new repository published.🤖 Generated with Claude Code