SwiftOnLambda
SwiftOnLambda copied to clipboard
Tests fail with 'multiple definition of main'
/src/.build/debug/swiftcommand.build/main.swift.o: In function `main':
/src/Sources/main.swift:(.text+0x0): multiple definition of `main'
/tmp/LinuxMain-85a3d7.o:/src/Tests/LinuxMain.swift:(.text+0x0): first defined here
Presumably this is because main.swift
is automatically turned into the main function and yet XCTMain
also defines its own main. Moving main.swift
outside of the package makes the tests build and run without issue. I could automate moving it away in the makefile but I imagine there's a better way. I'll look around myself as well, but I wanted to explicitly mention this incase anyone has more experience with swift on linux than I do.
It would be excellent to have a simple way to run the code on linux. A project that I'd like to use this for would never run on osx so there's no reason for me to create a bunch of code for switching based on the host when I could just easily run the tests in linux via docker.
Well that's not a positive sign https://bugs.swift.org/browse/SR-1503