mirror of
https://github.com/apple/swift-nio-extras
synced 2026-11-22 04:30:42 +00:00
### Motivation: `CertificateValidation.swift` imports Foundation but uses nothing from it. On Linux this makes every program that uses NIOCertificateHelpers link the full Foundation and FoundationInternationalization, with ICU. Its dependencies, X509 and SwiftASN1, already import FoundationEssentials when it's available. ### Modifications: Remove `import Foundation` from `CertificateValidation.swift`. ### Result: On Linux, a program that uses NIOCertificateHelpers no longer links `libFoundation.so` or `libFoundationInternationalization.so`; only `libFoundationEssentials.so` is left. Checked with `readelf -d` on a small executable (Swift 6.4.1, Ubuntu 24.04), before and after. `swift build -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error` and `NIOCertificateHelpersTests` pass on Linux and macOS.