swiftlang / swift-syntax

A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
Apache License 2.0
3.19k stars 405 forks source link

Windows builds for macro targets in release mode break the compiler #2483

Open broken-bytes opened 7 months ago

broken-bytes commented 7 months ago

Description

Issue

When building any macro target on Windows in release mode, the Swift Compiler gets hung. The last output with -vv set is always -o F:\Projects\MacroTest\.build\x86_64-unknown-windows-msvc\release\SwiftSyntax.build\SyntaxTypeNodes.swift.o.

Test setup

Steps to Reproduce

ahoppen commented 7 months ago

Tracked in Apple’s issue tracker as rdar://122442648

broken-bytes commented 7 months ago

Is this something that was already known? I can't seem to see the issue via the link

hassila commented 7 months ago

Is this something that was already known? I can't seem to see the issue via the link

You're not supposed to - that's Apples internal bug tracking system, so presumably they filed (or had) an internal issue covering the same problem.

ahoppen commented 7 months ago

@compnerd Have you seen this before?

compnerd commented 7 months ago

I have not - might be interesting to get this under a debugger.

broken-bytes commented 7 months ago

@compnerd If I can assist in any way feel free to instruct me. If you need additional logs or anything.

compnerd commented 7 months ago

What is really interesting is that we definitely would be building this file in release mode all the time - swift-syntax is part of the toolchain build and so we have this continuously building on Swift CI, GHA for The Browser Company's builds of the toolchain, and multiple developers building locally.

broken-bytes commented 7 months ago

Does building a macro package work in release mode for you locally? From what you said it sounds like?

ahoppen commented 7 months ago

Could the difference be that you are building using CMake, @compnerd while @broken-bytes is building using SwiftPM?

compnerd commented 7 months ago

@ahoppen possible - that is a difference between the builds, though feels surprising.

broken-bytes commented 7 months ago

Not too surprising to be honest. I had a couple of issues with SPM whereas the same code with CMake worked. Cxx interop, for example.