What is swiftc make supposed to do? It crashes

Is this normal?

$ swiftc make
Segmentation fault

So I ran swift in gdb, and got this:


[New Thread 0x7ff47e5100 (LWP 113931)]
[Detaching after vfork from child process 113932]
[New Thread 0x7ff3fc1100 (LWP 113933)]
[New Thread 0x7ff37c0100 (LWP 113934)]
[Thread 0x7ff37c0100 (LWP 113934) exited]
[New Thread 0x7ff37c0100 (LWP 113935)]
[Thread 0x7ff3fc1100 (LWP 113933) exited]
[Detaching after vfork from child process 113936]
[New Thread 0x7ff3fc1100 (LWP 113937)]
[New Thread 0x7ff2fbf100 (LWP 113938)]
[Thread 0x7ff2fbf100 (LWP 113938) exited]
[Thread 0x7ff3fc1100 (LWP 113937) exited]
[Detaching after vfork from child process 113939]
[New Thread 0x7ff2fbf100 (LWP 113940)]
[New Thread 0x7ff3fc1100 (LWP 113941)]
[Thread 0x7ff3fc1100 (LWP 113941) exited]
[Thread 0x7ff2fbf100 (LWP 113940) exited]
[New Thread 0x7ff3fc1100 (LWP 113942)]

Thread 1 "swift-driver" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()

Info:

$ swiftc -v
Swift version 5.8 (swift-5.8-RELEASE)
Target: aarch64-unknown-linux-gnu

The directory in which I did the swiftc make is one where I had just done:

mkdir Foo
cd Foo
swift package init

I think you want swift build

1 Like

swiftc make is not supposed to do anything. In Swift there’re two main driver entries: swiftc the compiler is used standalone to compile a Swift module, and swift can either be used as the interpreter or a shim to subcommands like build, which you might be looking for.

But you’re right that there’s some bug here in Swift Driver, where an unrecognized input will result in a core dump. You can file a bug in GitHub - apple/swift-driver: Swift compiler driver reimplementation in Swift and the community would look into it.