Compiling a macro target on Windows in Release Mode hangs the Compiler

Tested on 5.9.2 release and 5.11 trunk development.

The compiler gets hung when compiling the macro target in release mode. Debug works just fine and results in a working binary.

Last output of the compiler:\SyntaxDeclNodes.swift.o -o F:\Projects\Kyanite\.build\x86_64-unknown-windows-msvc\release\\SyntaxExprNodes.swift.o -o F:\Projects\Kyanite\.build\x86_64-unknown-windows-msvc\release\\SyntaxNodes.swift.o -o F:\Projects\Kyanite\.build\x86_64-unknown-windows-msvc\release\\SyntaxPatternNodes.swift.o -o F:\Projects\Kyanite\.build\x86_64-unknown-windows-msvc\release\\SyntaxStmtNodes.swift.o -o F:\Projects\Kyanite\.build\x86_64-unknown-windows-msvc\release\\SyntaxTypeNodes.swift.o

SyntaxTypeNodes.swift.o is where both compiler versions are stuck so the issue seems to be reproducible.

Macro target:

    name: "Macros",
    dependencies: [
        .product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
        .product(name: "SwiftCompilerPlugin", package: "swift-syntax")
    path: "scripting/macros"

The macro target build fails even when the source files are empty, so the issue does seem to be SwiftSyntax itself.

Even the example macro target created via swift package init --type=macro fails

Would you be able to file an issue for this with detailed reproduction steps on GitHub?

1 Like