Skip to content

Support for unix archive (.a) files#267

Merged
p-x9 merged 7 commits intomainfrom
feature/archive
Mar 21, 2026
Merged

Support for unix archive (.a) files#267
p-x9 merged 7 commits intomainfrom
feature/archive

Conversation

@p-x9
Copy link
Copy Markdown
Owner

@p-x9 p-x9 commented Mar 17, 2026

p-x9 added 3 commits March 17, 2026 01:16
- Update Package.swift to include ObjectArchiveKit dependency
- Introduce MachOArchiveKit target with dependencies
- Implement machOFiles() method in ArchiveFile for Mach-O members
- Implement archiveFiles() method in FatFile for Unix `ar` archives
- Create exported.swift for @_exported imports
- Change FatFile.url property to public
- Modify MachOFile initializer access level
- Changed originHash in Package.resolved
- Updated revision and version for ObjectArchiveKit
@p-x9 p-x9 requested a review from Copilot March 19, 2026 10:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support for Unix ar archives (.a) in the context of Mach-O parsing, including fat static libraries containing per-architecture archives.

Changes:

  • Introduces a new MachOArchiveKit target that bridges MachOKit with ObjectArchiveKit via convenience extensions.
  • Adjusts MachOFile initialization to be package-visible and to throw on invalid Mach-O magic.
  • Exposes FatFile.url publicly to support cross-module helpers.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Sources/MachOKit/MachOFile.swift Makes core initializer package and adds invalid-magic validation before endianness handling.
Sources/MachOKit/FatFile.swift Exposes url publicly for downstream helpers.
Sources/MachOArchiveKit/Util/exported.swift Re-exports MachOKit and ObjectArchiveKit from the new module.
Sources/MachOArchiveKit/FatFile+Archive.swift Adds helper to create ArchiveFile views for fat slices.
Sources/MachOArchiveKit/ArchiveFile+MachOFile.swift Adds helper to create MachOFile views for Mach-O members within an archive.
Package.swift Adds ObjectArchiveKit dependency, adds MachOArchiveKit target, and wires it into tests.
Package.resolved Pins ObjectArchiveKit dependency version/revision.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

p-x9 and others added 4 commits March 19, 2026 21:27
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Implement tests for BSD and Darwin64 symbol tables
@p-x9 p-x9 marked this pull request as ready for review March 21, 2026 16:57
@p-x9 p-x9 merged commit 25e56cb into main Mar 21, 2026
2 checks passed
@p-x9 p-x9 deleted the feature/archive branch March 21, 2026 16:59
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.

Support Archive file (.a) file

2 participants