Skip to content

Use Foundation Essentials when possible#804

Merged
natecook1000 merged 19 commits into
mainfrom
code-size
Sep 11, 2025
Merged

Use Foundation Essentials when possible#804
natecook1000 merged 19 commits into
mainfrom
code-size

Conversation

@rauhul
Copy link
Copy Markdown
Collaborator

@rauhul rauhul commented Sep 9, 2025

No description provided.

@rauhul
Copy link
Copy Markdown
Collaborator Author

rauhul commented Sep 9, 2025

@swift-ci test

@natecook1000
Copy link
Copy Markdown
Member

API breakage reports this, which I'm glad to not be doing any more:

1 breaking change detected in ArgumentParser:
💔 API breakage: extension String has removed conformance to CVarArg

Are you able to measure the impact of this change on binary sizes on Linux/Windows?

@rauhul
Copy link
Copy Markdown
Collaborator Author

rauhul commented Sep 9, 2025

API breakage reports this, which I'm glad to not be doing any more:

1 breaking change detected in ArgumentParser:
💔 API breakage: extension String has removed conformance to CVarArg

Are you able to measure the impact of this change on binary sizes on Linux/Windows?

build swift build --swift-sdk x86_64-swift-linux-musl --product math --configuration release -Xlinker -s
size  du -sh .build/release/math
pre   55M
post  13M

@rauhul rauhul enabled auto-merge (squash) September 9, 2025 19:44
@natecook1000 natecook1000 merged commit 6924db8 into main Sep 11, 2025
26 of 27 checks passed
@natecook1000 natecook1000 deleted the code-size branch September 11, 2025 23:44
kphrx added a commit to kphrx/swift-argument-parser that referenced this pull request Mar 12, 2026
fix apple#870

refs apple#804

If you want without compiler conditional import, enable `InternalImportsByDefault` upcoming feature and remove `internal` from imports.
@kphrx kphrx mentioned this pull request Mar 12, 2026
4 tasks
natecook1000 added a commit that referenced this pull request Mar 18, 2026
* Fix unknown target type in Swift 5.8

refs #803

`swift package resolve` in Swift 5.8.x:

```
Computing version for https://github.com/apple/swift-argument-parser.git
error: Invalid manifest (compiled with: ["/usr/bin/swiftc", "-vfsoverlay", "/tmp/TemporaryDirectory.HCuAi3/vfs.yaml", "-L", "/usr/lib/swift/pm/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/usr/lib/swift/pm/ManifestAPI", "-swift-version", "5", "-I", "/usr/lib/swift/pm/ManifestAPI", "-package-description-version", "5.8.0", "/Package@swift-5.8.swift", "-Xfrontend", "-disable-implicit-concurrency-module-import", "-Xfrontend", "-disable-implicit-string-processing-module-import", "-o", "/tmp/TemporaryDirectory.RLkqp3/swift-argument-parser-manifest"])
/Package@swift-5.8.swift:149:9: error: type 'Target.TargetType' has no member 'macro'
  case .macro, .plugin, .system, .binary:
       ~^~~~~ in https://github.com/apple/swift-argument-parser.git
```

* Fix to remove access level modifier on imports for Swift 5

fix #870

refs #804

If you want without compiler conditional import, enable `InternalImportsByDefault` upcoming feature and remove `internal` from imports.

* Fix unsupported conditional attributes in Swift 5.7

refs #794

---------

Co-authored-by: Nate Cook <natecook@apple.com>
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.

[Linux] Adding swift-argument-parser as a dependency increases binary size to 50+MB (10x larger than without)

2 participants