Swift 6.1 build time error: redefinition of module 'CNIO...'
Expected behavior
No errors.
Actual behavior
Errors on project that builds fine with Swift 6.0 compiler:
/__w/my-app/my-app/.build/x86_64-unknown-linux-gnu/debug/CNIOWASI-tool.build/module.modulemap:1:8: error: redefinition of module 'CNIOWASI'
1 | module CNIOWASI {
| `- error: redefinition of module 'CNIOWASI'
2 | umbrella header "/__w/my-app/my-app/.build/checkouts/swift-nio/Sources/CNIOWASI/include/CNIOWASI.h"
3 | export *
I have noticed other module names as well. These are the ones I could quickly catch: CNIOAtomics, CNIOLinux, CNIODarwin, CNIOWASI, CNIOBoringSSLShims
Steps to reproduce
None. The project is private.
If possible, minimal yet complete reproducer code (or URL to code)
None. The project is private. Haven't tried to minimally reproduce.
SwiftNIO version/commit hash
2.81.0 tag.
System & version information
swift:6.1-noble Docker image.
Thanks for filing this. Can you provide a complete build log? If necessary, feel free to provide it privately.
where can I contact you privately? an email should be good enough, but anything else you have should also do it.
You can use the OSS Swift Slack DM, or you can email me. My work email address is on any of my git commits.
Emailed with title Logs for https://github.com/apple/swift-nio/issues/3204. Thanks for looking into this 🙂.
Hrm, this looks like a SwiftPM bug, where it's generating duplicate modulemaps for the -tool case and the product case. https://github.com/swiftlang/swift-package-manager/pull/8498 might be a fix? cc @dschaefer2
Without a reproducing package, it's hard to say whether this fixed it but the error does look familiar.
@dschaefer2 when can I expect that fix? Swift 6.1.1?
Actually, it'll be in the next release off of release/6.1, which shouldn't be much later than 6.1.1 (which is Windows and Linux fixes only).
I'm not sure if this is expected anyway and the changes haven't made it to these images, but wanted to mention that the same issue is still present in the latest nightly Swift 6.1 Docker image: swiftlang/swift:nightly-6.1-jammy@sha256:81527a2bfd0819ae50b91b7334276690fdaa6534b5a89d7006059f55cbb3a8a7
I can confirm the project now compiles again on Swift 6.2 nightlies (the one bundled with Xcode 26 beta 2). I had to fix some new macro-related errors but that's unrelated to this.
Our project is doing well on Swift 6.2 so I think we can close this issue? Although I hear some more folks are bumping into something similar to this even on 6.2.
Let's close this for now, we can always reopen.