-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Tests fail to link on Windows when macros are present #7174
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
Comments
Is this reproducible for you with latest development snapshots? (at the moment of writing it's https://download.swift.org/development/windows10/swift-DEVELOPMENT-SNAPSHOT-2023-11-27-a/swift-DEVELOPMENT-SNAPSHOT-2023-11-27-a-windows10.exe) |
It is reproducible with the latest snapshot:
I have a slightly different example though: import SwiftCompilerPlugin
import SwiftSyntaxMacros
@main
struct MyMacroPlugin: CompilerPlugin {
let providingMacros: [Macro.Type] = [
]
} And a trivial test target: import XCTest
final class MyMacroTests: XCTestCase {
func testMacro() throws {
XCTAssertTrue(true)
}
} Running
|
Thank you @tishin . |
Description
Tests fail to link on Windows using swift 5.9.1-RELEASE when macros are present.
This is a trivial repo that reproduces the issue:
https://github.com/lynchsft/swift-windows-macro-testing
The locus of this problem is on Windows platform, but I conclude that it indirectly negatively affects the entire Swift community. As macros proliferate through common libraries, all swift-on-windows tools will either have to abandon testing or wholly abandon windows as a platform. Neither of these outcomes speaks well of the "swift is a cross platform language" story.
Particularly, I'm asserting that this is a rapidly worsening problem because library authors that don't usually concern themselves with Windows are eagerly adopting macros feature. Soon, the libraries that Windows projects currently rely on will be un-ingestiable, effectively locking our dependences at the last-macro-free version.
This in turn, is a security problem as code-currency (up-to-date dependencies) are a crucial topic for averting and responding to security threats.
@neonichu, @MaxDesiatov During construction of that ^^ trivial reproduction repo, I actually encountered a success case, where I WAS able to ingest a macro and use it on Windows. The linker error did not arise.
Including this state in case its a useful resource to have.
Branch: success_case
Repo: https://github.com/lynchsft/swift-windows-macro-testing
Expected behavior
The tests should link and run properly.
Actual behavior
The tests fail to link (compilation succeeds):
Steps to reproduce
swift --test
Swift Package Manager version/commit hash
5.9.1-RELEASE
Swift & OS version (output of
swift --version ; uname -a
)The text was updated successfully, but these errors were encountered: