Remove the unused Foundation import from NIOCertificateHelpers (#331)

### 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.
This commit is contained in:
Nik Tishakov authored and GitHub committed 2026-11-06 08:32:41 +00:00
1 parent 8e1249b29f
commit 4858e3120f
1 file changed
-1
@@ -12,7 +12,6 @@
//
//===----------------------------------------------------------------------===//
import Foundation
import NIOSSL
import SwiftASN1
import X509