You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-1393 [SwiftPM] Enforce Swift module import dependencies
relates to:
SR-5027 typo in the tests directory name leads to linker errors in SwiftPM
Issue Description:
description
SwiftPM doesn't allow tests to depend on executable targets. The error message if one does that is really bad though (linker error):
$ swift test
Compile Swift Module 'FooTests' (1 sources)
Linking ./.build/x86_64-apple-macosx/debug/TestAppPackageTests.xctest/Contents/MacOS/TestAppPackageTests
Undefined symbols for architecture x86_64:
"_$S7TestApp2hiSSvau", referenced from:
_globalinit_33_E4BF4F8DDFDD4AEA07DD665BB9913489_func0 in module.swift.o
ld: symbol(s) not found for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
repro
tar xf repro.tar.gz # attached
cd repro
swift test
expected
proper human readable error message or it works
actual
$ swift test
Compile Swift Module 'FooTests' (1 sources)
Linking ./.build/x86_64-apple-macosx/debug/TestAppPackageTests.xctest/Contents/MacOS/TestAppPackageTests
Undefined symbols for architecture x86_64:
"_$S7TestApp2hiSSvau", referenced from:
_globalinit_33_E4BF4F8DDFDD4AEA07DD665BB9913489_func0 in module.swift.o
ld: symbol(s) not found for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
The text was updated successfully, but these errors were encountered:
I just ran into this issue and there is no way a "normal" swift developer can solve this linker error by themselves (given that the developer doesn't know that tests can not depend on executables). So glad @weissi pointed me towards this. Huge +1 for this issue.
Attachment: Download
Additional Detail from JIRA
md5: bb75b95fd5eaaee71c7abb7965b3548b
duplicates:
relates to:
Issue Description:
description
SwiftPM doesn't allow tests to depend on executable targets. The error message if one does that is really bad though (linker error):
repro
expected
proper human readable error message or it works
actual
The text was updated successfully, but these errors were encountered: