Skip to content

refactor(dyld): unify DSC plan, extract RosettaOS by default#1252

Merged
blacktop merged 2 commits into
masterfrom
fix/dsc-rosetta-followups
Jun 11, 2026
Merged

refactor(dyld): unify DSC plan, extract RosettaOS by default#1252
blacktop merged 2 commits into
masterfrom
fix/dsc-rosetta-followups

Conversation

@blacktop

Copy link
Copy Markdown
Owner

Summary

Follow-ups from the #1250 review:

  • Unified planner: pkg/dyld now exports DscExtractionPlan and the remote path in internal/commands/extract uses it, replacing the near-verbatim duplicate helpers (remoteDscExtractionSteps, remoteDscArchUsesRosetta, remoteX86DscRequiresRosetta). DMG-path resolution stays per-callsite since local and remote want different fallbacks/error messages.
  • Dead code removed: both planners carried an unreachable SystemOS fallback after the missing-RosettaOS error (requiresRosetta was invariantly true past the first early return).
  • Behavior change: default ipsw extract --dyld (no --dyld-arch) on macOS 27+ now extracts from both SystemOS and RosettaOS DMGs. Previously it silently produced no x86_64 caches on 27+, where pre-27 IPSWs included them. When a 27+ BuildManifest lacks Cryptex1,RosettaOS, it extracts SystemOS only and logs a warning instead of erroring.

Testing

go build ./..., go vet, and go test ./pkg/dyld ./internal/commands/extract pass. Planner tests updated: default-arches now expects both DMGs, plus a new case for 27+ with no RosettaOS cryptex; remote routing tests rewritten against the exported planner.

AI Assistance

Written with Claude Code.

Follow-ups to #1250:
- Export DscExtractionPlan from pkg/dyld and delete the duplicate
  remote planner in internal/commands/extract (the two had drifted
  into near-identical helpers).
- Remove unreachable SystemOS fallback branches: past the early
  return, requiresRosetta was invariantly true.
- Default (no --dyld-arch) extraction on macOS 27+ now covers both
  SystemOS and RosettaOS DMGs instead of silently dropping the
  x86_64 caches; warns when the RosettaOS cryptex is absent.
Review findings on the multi-step DSC plan:
- Stop the step loop when the user interrupts the interactive cache
  selection (ExtractFromDMG returns nil artifacts with nil error on
  Ctrl-C); previously the next DMG's prompt appeared after exiting.
- Error on unknown DscDMGKind in both DMG-path resolvers instead of
  silently routing to SystemOS.
- Propagate non-absence GetRosettaOsDmg errors (e.g. multiple
  RosettaOS DMGs) instead of mislabeling them as a missing cryptex.
@blacktop blacktop merged commit 47bcc46 into master Jun 11, 2026
5 of 6 checks passed
@blacktop blacktop deleted the fix/dsc-rosetta-followups branch June 11, 2026 22:45
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.

1 participant