refactor(dyld): unify DSC plan, extract RosettaOS by default#1252
Merged
Conversation
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.
4 tasks
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.
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
Follow-ups from the #1250 review:
pkg/dyldnow exportsDscExtractionPlanand the remote path ininternal/commands/extractuses 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.requiresRosettawas invariantly true past the first early return).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 lacksCryptex1,RosettaOS, it extracts SystemOS only and logs a warning instead of erroring.Testing
go build ./...,go vet, andgo test ./pkg/dyld ./internal/commands/extractpass. 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.