cgrindel / rules_spm

Provide a means for integrating external Swift packages built by Swift Package Manager into Bazel build using rules_swift.
Apache License 2.0
58 stars 13 forks source link

tools/spm_parser fails building with swiftc 5.7 #172

Closed gferon closed 2 years ago

gferon commented 2 years ago

We just switched to Xcode 14.0.0 and spm_parser now fails to build.

Building for debugging...
/Users/xdev/gabriel/rules_spm/tools/spm_parser/Sources/spm_parser/Dump.swift:8:8: error: ambiguous use of 'main'
struct Dump: ParsableCommand {
       ^
/Users/xdev/gabriel/rules_spm/tools/spm_parser/Sources/spm_parser/Dump.swift:8:8: error: ambiguous use of 'main'
struct Dump: ParsableCommand {
       ^
[2/3] Compiling spm_parser Dump.swift

I'm not exactly sure what could be going on, it might be an issue with a 3rd party dependency, but I feel like you're in a better place to give this a look 🙏🏼

cgrindel commented 2 years ago

@gferon I was not able to reproduce the issue after upgrading to Xcode 14.0. However, I ran into a similar issue with another project. In that project, I moved the main to an explicit main func. I applied the same change to this repo in #173. Can you give it a try?

cgrindel commented 2 years ago

I accidentally closed this issue. Re-opening.

cgrindel commented 2 years ago

@gferon I went ahead and merged the change. Please let me know if this addressed the error that you were seeing.

gferon commented 2 years ago

Yes it does, thank you very much!