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

[Source compatibility suite] swift-power-assert failing to build - Undefined symbols #833

Open
xymus opened this issue Jul 18, 2023 · 4 comments · Fixed by apple/swift-package-manager#6723
Labels

Comments

@xymus
Copy link
Contributor

xymus commented Jul 18, 2023

The swift-power-assert fails to build in the source-combat-suite against main: https://ci.swift.org/job/swift-main-source-compat-suite-debug/487/

The error is on missing symbols, a lot of missing symbols:

/Users/ec2-user/jenkins/workspace-private/swift-main-source-compat-suite-debug/build/compat_macos/install/toolchain/usr/bin/clang /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite-debug/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/debug/PowerAssertPlugin.build/PowerAssertMacro.swift.o /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite-debug/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/debug/PowerAssertPlugin.build/PowerAssertPlugin.swift.o /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite-debug/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/debug/PowerAssertPlugin.build/PowerAssertRewriter.swift.o /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite-debug/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/debug/PowerAssertPlugin.build/SingleLineFormatter.swift.o -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk --target=x86_64-apple-macosx13.0 /Users/ec2-user/jenkins/workspace-private/swift-main-source-compat-suite-debug/build/compat_macos/install/toolchain/usr/lib/swift/macosx/libswiftCompatibilityPacks.a -L /Users/ec2-user/jenkins/workspace-private/swift-main-source-compat-suite-debug/build/compat_macos/install/toolchain/usr/lib/swift/macosx -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib/swift -L /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite-debug/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/debug -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -L /Users/ec2-user/jenkins/workspace-private/swift-main-source-compat-suite-debug/build/compat_macos/install/toolchain/usr/lib -Xlinker -alias -Xlinker _PowerAssertPlugin_main -Xlinker _main -Xlinker -rpath -Xlinker @loader_path -Xlinker -add_ast_path -Xlinker /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite-debug/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/debug/PowerAssertPlugin.swiftmodule -o /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite-debug/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/debug/PowerAssertPlugin
error: link command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture x86_64:
  "_$s11StringWidth06stringB0ySiSSF", referenced from:
      _$s17PowerAssertPlugin0aB8RewriterC14graphemeColumn33_B676B0649EA1307B1860CA0ABF455ABBLLySi11SwiftSyntax0O8Protocol_pF in PowerAssertRewriter.swift.o
  "_$s11SwiftParser15SyntaxParseableP0aC7BuilderE19stringInterpolationxAD0c6StringG0V_tcfC", referenced from:
      _$s17PowerAssertPlugin0aB8RewriterC5visity11SwiftSyntax04ExprG0VAE010IdentifierhG0VF in PowerAssertRewriter.swift.o
      _$s17PowerAssertPlugin0aB8RewriterC5visity11SwiftSyntax04ExprG0VAE012MemberAccesshG0VF in PowerAssertRewriter.swift.o
      _$s17PowerAssertPlugin0aB8RewriterC5visity11SwiftSyntax04ExprG0VAE08SuperRefhG0VF in PowerAssertRewriter.swift.o
...

FAIL_swift-power-assert_5.0_BuildSwiftPackage.log

@xymus xymus added the bug label Jul 18, 2023
@xymus
Copy link
Contributor Author

xymus commented Jul 18, 2023

#830

neonichu referenced this issue in apple/swift-package-manager Jul 18, 2023
While fixing this, I also noticed the original issue also exists for executable targets, so this gets fixed here as well.

There's one unfortunate nuance here for test targets since using a macro/plugin is indistinguishable from needing to link it because it is being tested. We err on the side of caution here and will always link.

(sidenote: theoretically, plugins *do* distinguish between linkage and use in the package manifest, but this distinction is not carried forward into the actual model)

Partially fixes https://github.com/apple/swift/issues/67371 since the underlying project also does not declare a dependency on the macro that is being tested.
neonichu referenced this issue in apple/swift-package-manager Jul 19, 2023
…6723)

While fixing this, I also noticed the original issue also exists for executable targets, so this gets fixed here as well.

There's one unfortunate nuance here for test targets since using a macro/plugin is indistinguishable from needing to link it because it is being tested. We err on the side of caution here and will always link.

(sidenote: theoretically, plugins *do* distinguish between linkage and use in the package manifest, but this distinction is not carried forward into the actual model)

Partially fixes https://github.com/apple/swift/issues/67371 since the underlying project also does not declare a dependency on the macro that is being tested.
neonichu referenced this issue in apple/swift-package-manager Jul 19, 2023
While fixing this, I also noticed the original issue also exists for executable targets, so this gets fixed here as well.

There's one unfortunate nuance here for test targets since using a macro/plugin is indistinguishable from needing to link it because it is being tested. We err on the side of caution here and will always link.

(sidenote: theoretically, plugins *do* distinguish between linkage and use in the package manifest, but this distinction is not carried forward into the actual model)

Partially fixes https://github.com/apple/swift/issues/67371 since the underlying project also does not declare a dependency on the macro that is being tested.

(cherry picked from commit b31c19a)
@AnthonyLatsis
Copy link

@neonichu Since this is not a compiler issue and was fixed in swiftpm, could you transfer it there please?

@neonichu neonichu reopened this Jul 21, 2023
@neonichu
Copy link
Member

This should actually stay open and be transferred to wherever we track compat suite issues. I guess GH automation closed it because I mentioned this issue, that wasn't my intent.

Specifically we need:

@AnthonyLatsis
Copy link

Then I believe it should be moved to the compat suite repository. We used to, but I don’t think we want to keep tracking compat suite source/specification issues here.

cc @shahmishal

@shahmishal shahmishal transferred this issue from apple/swift Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants