feat: add Swift/Xcode error and stacktrace compression#9
Open
Cyvid7-Darus10 wants to merge 1 commit intojee599:mainfrom
Open
feat: add Swift/Xcode error and stacktrace compression#9Cyvid7-Darus10 wants to merge 1 commit intojee599:mainfrom
Cyvid7-Darus10 wants to merge 1 commit intojee599:mainfrom
Conversation
Add a new swift_cmd filter module that compresses Xcode build output and Swift crash stack traces. CompileSwift noise lines are collapsed into a count summary, build step noise is stripped, and framework frames in crash reports (UIKit, Foundation, libswiftCore, etc.) are hidden while app frames are preserved. The filter integrates into the existing error compression pipeline in error_cmd.rs and the runner post-processing chain. Closes jee599#1.
57bf8e9 to
cad3a32
Compare
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.
This adds a new
swiftsubcommand and Swift crash trace compression to contextzip, addressing #1.If you work on iOS/macOS projects, you know the pain of Xcode build output flooding your terminal. A typical
swift builddumps aCompileSwift normal arm64 /path/to/every/single/file.swiftline for every source file in your project, followed by linking steps, code signing, and other noise that buries the actual errors you care about. This filter collapses all of that into a one-line summary likeswift build: 47 Swift files compiled, 2 targets linkedwhile preserving every error and warning with full file paths and context.The same goes for Swift crash stack traces. When your app crashes, you get a wall of numbered frames from UIKit, Foundation, libswiftCore, CoreFoundation, and GraphicsServices that are almost never relevant to debugging. This filter hides those framework frames and keeps only your app's frames, so instead of scrolling through 20+ lines of Apple internals, you see your 2-3 app frames with a
(+ 15 framework frames hidden)note.Here is a before/after for a build with errors:
Before (raw Xcode output):
After (contextzip swift build):
The implementation follows the exact same patterns as
cargo_cmd.rsanddotnet_cmd.rs. It addsswift_cmd.rswith the command handler and filter logic, extendserror_cmd.rsto detect and compress Swift crash traces (making it 6 languages instead of 5), and hooks into the runner.rs post-processing pipeline forcontextzip erroutput. All 1062 existing tests continue to pass, and 6 new tests cover the Swift-specific functionality.Demo