Skip to content

Swiftbuild system doesn't support the build --enable-parseable-module-interfaces flag #8337

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
1 task done
cmcgee1024 opened this issue Mar 7, 2025 · 2 comments · Fixed by #8421
Closed
1 task done
Labels
bug swift build Changes impacting `swift build`

Comments

@cmcgee1024
Copy link
Member

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

This flag triggers the native build system to produce .swiftinterface files. However, it doesn't do that with the swiftbuild build system.

Expected behavior

It is expected that the swiftbuild build system should be able to support this flag and produce the parsable interface files like the native build system.

Actual behavior

The build doesn't produce any interface files. See the test case for the details of the expected interface files.

Steps to reproduce

To reproduce on macOS with #8333

  1. Edit Tests/CommandsTests/BuildCommandTests.swift to comment out the skipping of a test ~ line 859
  2. Run the following test
swift test --filter=BuildCommandSwiftBuildTests.testParseableInterfaces
  1. Ensure that the test is not being skipped

Swift Package Manager version/commit hash

main

Swift & OS version (output of swift --version ; uname -a)

Apple Swift version 6.0.3 (swift-6.0.3-RELEASE)
Target: arm64-apple-macosx15.0

@cmcgee1024 cmcgee1024 added the bug label Mar 7, 2025
@cmcgee1024
Copy link
Member Author

There is a build setting called BUILD_FOR_DISTRIBUTION that should enable this capability with swift-build.

@cmcgee1024
Copy link
Member Author

Note that a very similar situation happens when a Package.swift has set -enable-library-evolution as an unsafe flag. It could be a similar root cause.

@plemarquand plemarquand added the swift build Changes impacting `swift build` label Mar 10, 2025
johnbute pushed a commit to johnbute/fork-swift-package-manager that referenced this issue Apr 17, 2025
…ystem (swiftlang#8421)

- this also fixes -enable-library-evolution when used as a unsafeFlags

Closes: swiftlang#8337

### Modifications:

sets SWIFT_EMIT_MODULE_INTERFACE build setting when option is set

### Result:

the build option will include the .swftinertface files in the module
folder
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug swift build Changes impacting `swift build`
Projects
None yet
2 participants