Repository navigation
Add PowerPC Tiger port (Mac OS X 10.4) - #13
Merged
Merged
Conversation
Native C reimplementation of rusty-backup for PowerPC Macs running Mac OS X Tiger. Produces a 58KB Mach-O binary with full feature parity: - MBR/APM/EBR partition table support - Gzip compression via zlib - CRC32 and SHA-1 checksums - FAT12/16/32 compaction (only backs up allocated clusters) - Carbon GUI frontend with progress bars - Gzip-aware restore (decompresses .gz files automatically) Tested on Dual G4 Power Mac with Tiger 10.4.11. Built with gcc-4.0 from Xcode 2.x. Created with rust-ppc-tiger transpiler. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
Merged, I'd like to see ext2/3/4 and btrfs working on here as well, along with exfat and ntfs. All of the filesystem access should be managed within the application itself. |
danifunker
added a commit
that referenced
this pull request
May 19, 2026
* Adds `rb-cli inspect IMG` (verb #13): whole-disk aggregate view using `PartitionTable::detect` + `PartitionInfo::type_name`, with optional CHD info appended. Supports --format text/json/yaml via the shared Envelope schema. Phase B/C extend to per-partition volume info via open_filesystem. * Reshapes `put` to keep cp-like positional ordering working when --zero / --boot aren't in play, and adds an explicit `--dst FLAG` for the --zero case. Two positional slots couldn't disambiguate "host_file vs dst" when --zero pulled host_file out of scope. * tests/cli_flat.rs (7 e2e tests against the flat grammar): new / put / mkdir / get / ls / rm / fsck --checkonly round-trip, put --boot byte-exactness, --format json envelope shape, IMG@0 rejection, rm on nonexistent path, completions emit a non-empty script for every supported shell, inspect runs on a raw HFS image. * tests/cli_help_snapshot.rs (6 grammar-drift tripwires): asserts the documented verb names + global flags + show subcommands + put modes + fsck modes + new --fs values are present in --help. Any rename fires the corresponding assert. * example/generate_manpage.rs: clap_mangen-based manpage generator for packagers. Emits OUT_DIR/rb-cli.1. Wired as a Cargo [[example]] so packaging recipes can `cargo run --example generate_manpage -- $DESTDIR/usr/share/man/man1`. Phase A complete. All 959 lib + 118 integration tests green.
danifunker
added a commit
that referenced
this pull request
Jul 31, 2026
`scripts/build-ppc.sh ppclibs` has never set MINICARGO_NO_DEBUG_ASSERTIONS,
so every stdlib it produced aborted before main:
thread panicked while processing panic. aborting.
Abort trap (exit 134)
`debug_assertions` switches on libcore's `assert_unsafe_precondition!`, which
asserts a Rust-level invariant this target's C ABI cannot satisfy. Under the
Darwin/PowerPC "power" alignment rule a member that is not first is capped to
4, so `std::thread::Inner` lays out as
Option<CString> @0 | Parker @8 (76 bytes) | ThreadId @84
with ALIGNOF(Inner) == 4 while ThreadId's own alignment is 8. `ArcInner` puts
Inner at +8, so `id` lands at +92 and `ptr::write`'s precondition fails inside
`Thread::new`. `std::rt::init` calls it, and the panic hook then reads the
current thread's name - reaching `Thread::new` a second time - so the first
panic becomes a double panic and aborts. gdb on the G5:
#21 std::rt::init
#20 std::thread::Thread::new <- panic_nounwind
#13 std::panicking::default_hook
#8 std::thread::Thread::new <- again, during the hook
#1 abort
The emitted C is correct - gcc agrees with mrustc's layout and every
sizeof/alignof assertion compiles - only the Rust-level assertion disagrees.
docs/build-ppc-mrustc.md has documented the flag and the reason since the
stdlib first came up; the script simply never carried it over, and the one
binary that worked was a stale artifact built by the hand-run command in
those docs.
Verified end-to-end: wipe output-1.74.0-powerpc-apple-darwin, rebuild through
the script with no environment override, then a hello-world compiled *with*
`--cfg debug_assertions` (matching the engine) runs on the G5:
hello from powerpc
vec [0, 1, 2, 3, 4] sum 10
exit=0
Also carries the sync_rustc_src_patch guard: a branch switch refreshes
rustc-<ver>-src.patch's mtime without changing its content, which made
minicargo.mk re-apply it to an already-patched tree and fail the build.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Native C port of rusty-backup for PowerPC Macs running Mac OS X Tiger (10.4.x). All source lives in
ppc-tiger/— no changes to existing Rust code.metadata.jsonformat — backups are interchangeableWhat's included
rust_cli_real.c(2,251 lines)rusty_backup_gui.c(853 lines)rust_runtime_v2.c(182 lines)build.shInfo.plistREADME.mdFAT compaction example
Tested on
Related: #10
Test plan
list-devicesshows all disks with sizesbackupwith MBR image — partitions detected, data copiedbackup --compression gzip— gzip output verifiedbackup --checksum crc32— CRC32 sidecar writtenbackup --checksum sha1— SHA-1 sidecar written--sector-by-sector— bypasses compaction correctlyrestorefrom gzip backup — decompresses automaticallyinspect— displays metadata with human-readable sizes--versionshows 0.3.0-ppc with feature list🤖 Generated with Claude Code