Skip to content

Export SPI in the prebuilt swiftinterface - #24

Merged
congt merged 2 commits into
mainfrom
cshi/export-spi-swiftinterface
Aug 19, 2026
Merged

Export SPI in the prebuilt swiftinterface#24
congt merged 2 commits into
mainfrom
cshi/export-spi-swiftinterface

Conversation

@congt

@congt congt commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

The archive ships each module as a .swiftinterface, and a public interface
strips every @_spi declaration. Consumers that import SPI therefore cannot
build against it at all: SwiftLint 0.63.1's RedundantSelfRule does
@_spi(RawSyntax) import SwiftSyntax and fails with "cannot find
'SyntaxText' in scope", even though 603.0.1 declares it.

Emit .private.swiftinterface as well and point swift_import at it. It is a
superset of the public interface, and rules_swift documents it as the value
to pass for swiftinterface when SPI is required. Guard both phases so a
missing private interface fails the build rather than silently publishing an
archive that only breaks later, in consumer builds.

Co-authored-by: Claude Code noreply@anthropic.com
Ai-assisted: true

congt and others added 2 commits August 19, 2026 10:41
The archive ships each module as a .swiftinterface, and a public interface
strips every @_spi declaration. Consumers that import SPI therefore cannot
build against it at all: SwiftLint 0.63.1's RedundantSelfRule does
`@_spi(RawSyntax) import SwiftSyntax` and fails with "cannot find
'SyntaxText' in scope", even though 603.0.1 declares it.

Emit .private.swiftinterface as well and point swift_import at it. It is a
superset of the public interface, and rules_swift documents it as the value
to pass for `swiftinterface` when SPI is required. Guard both phases so a
missing private interface fails the build rather than silently publishing an
archive that only breaks later, in consumer builds.

Co-authored-by: Claude Code <noreply@anthropic.com>
Ai-assisted: true
@congt
congt requested a review from luispadron August 19, 2026 17:43
@congt
congt merged commit b7effdb into main Aug 19, 2026
5 checks passed
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.

2 participants