[PR #19] [MERGED] rbuild + apk-tools Rhapsody port (apk switchover, phase 1) #85

Closed
opened 2026-11-03 22:04:29 -07:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/RhapsodiOS/RhapsodiOS/pull/19
Author: @raynorpat
Created: 7/24/2026
Status: ✅ Merged
Merged: 7/24/2026
Merged by: @raynorpat

Base: master ← Head: rbuild-c89


📝 Commits (10+)

  • c42da45 rbuild: project scaffolding, test harness, Makefile
  • 2c94508 rbuild: strutil sbuf + strlist + alloc wrappers
  • 97bfbc8 rbuild: strutil string helpers (split/trim/cats/path_join)
  • e9da3c7 rbuild: link each unit test against only the modules it needs
  • af54856 rbuild: document ownership conventions on strutil string helpers
  • a3c017c rbuild: package metadata parse/unparse/canon
  • 89a68c1 rbuild: fail loudly when package has both revision fields; drop dead include
  • 905539f rbuild: builder dir2name + pkgname
  • 525a5ae rbuild: builder package-file matching (exists/resolve)
  • 15c068f rbuild: manifest reader (file + directory)

📊 Changes

4369 files changed (+10428 additions, -1032091 deletions)

View changed files

➕ src/apk-tools-1/.gitignore (+4 -0)
➕ src/apk-tools-1/Makefile (+20 -0)
➕ src/apk-tools-1/PORTING.md (+89 -0)
➕ src/apk-tools-1/apk-tools/AUTHORS (+2 -0)
➕ src/apk-tools-1/apk-tools/Make.rules (+276 -0)
➕ src/apk-tools-1/apk-tools/Makefile (+36 -0)
📝 src/apk-tools-1/apk-tools/NEWS (+0 -0)
📝 src/apk-tools-1/apk-tools/README (+0 -0)
➕ src/apk-tools-1/apk-tools/TODO (+39 -0)
➕ src/apk-tools-1/apk-tools/src/Makefile (+20 -0)
➕ src/apk-tools-1/apk-tools/src/add.c (+203 -0)
➕ src/apk-tools-1/apk-tools/src/apk.c (+229 -0)
➕ src/apk-tools-1/apk-tools/src/apk_applet.h (+45 -0)
➕ src/apk-tools-1/apk-tools/src/apk_archive.h (+31 -0)
➕ src/apk-tools-1/apk-tools/src/apk_blob.h (+52 -0)
➕ src/apk-tools-1/apk-tools/src/apk_database.h (+139 -0)
➕ src/apk-tools-1/apk-tools/src/apk_defines.h (+274 -0)
➕ src/apk-tools-1/apk-tools/src/apk_hash.h (+55 -0)
➕ src/apk-tools-1/apk-tools/src/apk_io.h (+75 -0)
➕ src/apk-tools-1/apk-tools/src/apk_package.h (+97 -0)

...and 80 more files

📄 Description

Moves the build/packaging toolchain toward apk, in two parts.

rbuild — C89 build tool (replaces the Perl build scripts)

Single C89 executable replacing darwin-buildpackage / darwin-buildall / darwin-missing and the Dpkg::Package::* engine. Produces/consumes apk packages (.PKGINFO + gzipped tar) instead of dpkg .deb, while preserving the Rhapsody build machinery (chroot buildroot, DSTROOT/OBJROOT/… roots, RC_CFLAGS, chroot make, dependency install, object harvest, hdrs/obj sub-packages).

  • Subcommands buildpackage / buildall / missing; --dir source only (--cvs dropped); -n/--dry-run.
  • Build-Depends travels in .PKGINFO as a custom builddepends field.
  • Verified: unit tests for the pure functions, and a command-trace comparison that confirms byte-for-byte parity with the unmodified Perl for the chroot make invocation and flags (TRACE MATCH).

apk-tools Rhapsody port (phase 1 of the apk switchover)

Ports vendored Alpine apk-tools 2.0_pre12 to build/run off-Linux, proven on a dev-host proxy for Rhapsody's Apple gcc 2.95.

  • Portable build flags + zlib linkage; compat shims (malloc.h→stdlib.h, endian.h, mknod/makedev, memrchr fallback).
  • Applet registration reworked from GNU-ld/ld64 linker-section magic to an explicit apk_applets[] table — no section-boundary symbols, so it links on cctools ld for both i386 and ppc of a fat build.
  • RhapsodiOS project Makefile (maps DSTROOT→DESTDIR); host smoke tests proving apk⇄rbuild .apk format compatibility.
  • src/apk-tools-1/PORTING.md documents every change and a target-validation checklist for final verification on real Rhapsody (old-gcc acceptance, native libc/headers, fat-binary link, chroot install).

Notes

  • The branch also carries infrastructure commits (mercurial removal, apk-tools vendoring, netinfo folder move).
  • Host = clang proxy; the remaining OS-level pieces (apk bootstrap chain, .deb→.apk repo conversion) are deferred to later phases.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/RhapsodiOS/RhapsodiOS/pull/19 **Author:** [@raynorpat](https://github.com/raynorpat) **Created:** 7/24/2026 **Status:** ✅ Merged **Merged:** 7/24/2026 **Merged by:** [@raynorpat](https://github.com/raynorpat) **Base:** `master` ← **Head:** `rbuild-c89` --- ### 📝 Commits (10+) - [`c42da45`](https://github.com/RhapsodiOS/RhapsodiOS/commit/c42da4579b68296d11972cf65608e8ad4b490d98) rbuild: project scaffolding, test harness, Makefile - [`2c94508`](https://github.com/RhapsodiOS/RhapsodiOS/commit/2c94508e00d2497e574ff6cee714c954c4027491) rbuild: strutil sbuf + strlist + alloc wrappers - [`97bfbc8`](https://github.com/RhapsodiOS/RhapsodiOS/commit/97bfbc8a9ba31b3fa49dac8565bf5be54f78e539) rbuild: strutil string helpers (split/trim/cats/path_join) - [`e9da3c7`](https://github.com/RhapsodiOS/RhapsodiOS/commit/e9da3c71c5bbc75b99da8f79bbda03636ab5379b) rbuild: link each unit test against only the modules it needs - [`af54856`](https://github.com/RhapsodiOS/RhapsodiOS/commit/af548568611271a25d8c4cca84752e2326ae98fc) rbuild: document ownership conventions on strutil string helpers - [`a3c017c`](https://github.com/RhapsodiOS/RhapsodiOS/commit/a3c017c4c26eef28cee5a3fc74a921a847588797) rbuild: package metadata parse/unparse/canon - [`89a68c1`](https://github.com/RhapsodiOS/RhapsodiOS/commit/89a68c16d273836aaea50a94ab52baa98dd243d8) rbuild: fail loudly when package has both revision fields; drop dead include - [`905539f`](https://github.com/RhapsodiOS/RhapsodiOS/commit/905539f965a3a6b046653cdc75dbe7b61fadfaf9) rbuild: builder dir2name + pkgname - [`525a5ae`](https://github.com/RhapsodiOS/RhapsodiOS/commit/525a5aeb3d1651a85b8a019ff02f133d71937f05) rbuild: builder package-file matching (exists/resolve) - [`15c068f`](https://github.com/RhapsodiOS/RhapsodiOS/commit/15c068fd8b2b4e29097a5e593b5784425a6653b5) rbuild: manifest reader (file + directory) ### 📊 Changes **4369 files changed** (+10428 additions, -1032091 deletions) <details> <summary>View changed files</summary> ➕ `src/apk-tools-1/.gitignore` (+4 -0) ➕ `src/apk-tools-1/Makefile` (+20 -0) ➕ `src/apk-tools-1/PORTING.md` (+89 -0) ➕ `src/apk-tools-1/apk-tools/AUTHORS` (+2 -0) ➕ `src/apk-tools-1/apk-tools/Make.rules` (+276 -0) ➕ `src/apk-tools-1/apk-tools/Makefile` (+36 -0) 📝 `src/apk-tools-1/apk-tools/NEWS` (+0 -0) 📝 `src/apk-tools-1/apk-tools/README` (+0 -0) ➕ `src/apk-tools-1/apk-tools/TODO` (+39 -0) ➕ `src/apk-tools-1/apk-tools/src/Makefile` (+20 -0) ➕ `src/apk-tools-1/apk-tools/src/add.c` (+203 -0) ➕ `src/apk-tools-1/apk-tools/src/apk.c` (+229 -0) ➕ `src/apk-tools-1/apk-tools/src/apk_applet.h` (+45 -0) ➕ `src/apk-tools-1/apk-tools/src/apk_archive.h` (+31 -0) ➕ `src/apk-tools-1/apk-tools/src/apk_blob.h` (+52 -0) ➕ `src/apk-tools-1/apk-tools/src/apk_database.h` (+139 -0) ➕ `src/apk-tools-1/apk-tools/src/apk_defines.h` (+274 -0) ➕ `src/apk-tools-1/apk-tools/src/apk_hash.h` (+55 -0) ➕ `src/apk-tools-1/apk-tools/src/apk_io.h` (+75 -0) ➕ `src/apk-tools-1/apk-tools/src/apk_package.h` (+97 -0) _...and 80 more files_ </details> ### 📄 Description Moves the build/packaging toolchain toward apk, in two parts. ## rbuild — C89 build tool (replaces the Perl build scripts) Single C89 executable replacing `darwin-buildpackage` / `darwin-buildall` / `darwin-missing` and the `Dpkg::Package::*` engine. Produces/consumes **apk** packages (`.PKGINFO` + gzipped tar) instead of dpkg `.deb`, while preserving the Rhapsody build machinery (chroot buildroot, DSTROOT/OBJROOT/… roots, RC_CFLAGS, `chroot make`, dependency install, object harvest, hdrs/obj sub-packages). - Subcommands `buildpackage` / `buildall` / `missing`; `--dir` source only (`--cvs` dropped); `-n/--dry-run`. - `Build-Depends` travels in `.PKGINFO` as a custom `builddepends` field. - Verified: unit tests for the pure functions, and a **command-trace comparison** that confirms byte-for-byte parity with the unmodified Perl for the `chroot make` invocation and flags (`TRACE MATCH`). ## apk-tools Rhapsody port (phase 1 of the apk switchover) Ports vendored Alpine `apk-tools` 2.0_pre12 to build/run off-Linux, proven on a dev-host proxy for Rhapsody's Apple gcc 2.95. - Portable build flags + zlib linkage; compat shims (`malloc.h`→`stdlib.h`, `endian.h`, `mknod`/`makedev`, `memrchr` fallback). - Applet registration reworked from GNU-ld/ld64 **linker-section magic to an explicit `apk_applets[]` table** — no section-boundary symbols, so it links on cctools `ld` for both **i386 and ppc** of a fat build. - RhapsodiOS project Makefile (maps `DSTROOT`→`DESTDIR`); host smoke tests proving apk⇄rbuild `.apk` format compatibility. - `src/apk-tools-1/PORTING.md` documents every change and a **target-validation checklist** for final verification on real Rhapsody (old-gcc acceptance, native libc/headers, fat-binary link, chroot install). ## Notes - The branch also carries infrastructure commits (mercurial removal, apk-tools vendoring, netinfo folder move). - Host = clang proxy; the remaining OS-level pieces (apk bootstrap chain, `.deb`→`.apk` repo conversion) are deferred to later phases. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-11-03 22:04:29 -07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github-starred/RhapsodiOS#85
No description provided.