bazelbuild / rules_swift

Bazel rules to build Swift on Apple and Linux platforms
Apache License 2.0
307 stars 133 forks source link

Add a feature to always include all headers as inputs to SwiftCompile actions, even when using explicit modules #1249

Closed brentleyjones closed 1 month ago

brentleyjones commented 1 month ago

When building with explicit modules, Swift compilations do not require any of the headers to be present on disk, because the AST contains all the necessary information (save for a bug(?) in canImport which fails if the headers aren't also present). However, other tooling may want to inspect compilation actions and have access to those headers.

This feature is a no-op for implicit module builds, since the headers are always included to begin with, and it is off by default.

PiperOrigin-RevId: 461668350 (cherry picked from commit 81f7b547ff6dea6e67fb0ee4c59e1e5a945cd03d)