Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
broken-bytes opened this issue Feb 7, 2024 · 11 comments
Open
Labels
bug Something isn't working

Comments

@broken-bytes
Copy link

broken-bytes commented Feb 7, 2024

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

  • Any recent Swift version, tested on 5.9.2-release and 5.11 development.
  • Default macro package(In fact any macro package)
  • Recent swift-syntax dependency, tested with 509.0.0 and 509.1.1

Steps to Reproduce

  • swift package init --type=macro
  • swift build -c release -vv
  • Compiler gets hung
@broken-bytes broken-bytes added the bug Something isn't working label Feb 7, 2024
@ahoppen
Copy link
Collaborator

ahoppen commented Feb 7, 2024

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

@broken-bytes
Copy link
Author

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

@hassila
Copy link

hassila commented Feb 7, 2024

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
Copy link
Collaborator

ahoppen commented Feb 12, 2024

@compnerd Have you seen this before?

@compnerd
Copy link
Collaborator

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

@broken-bytes
Copy link
Author

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

@compnerd
Copy link
Collaborator

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
Copy link
Author

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

@ahoppen
Copy link
Collaborator

ahoppen commented Feb 13, 2024

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

@compnerd
Copy link
Collaborator

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

@broken-bytes
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants