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

[SR-11437] Latest llbuild Package.swift causes resolution errors in SwiftPM & sourcekit-lsp #782

Closed
swift-ci opened this issue Sep 9, 2019 · 5 comments
Assignees

Comments

@swift-ci
Copy link

swift-ci commented Sep 9, 2019

Previous ID SR-11437
Radar None
Original Reporter alanQuatermain (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 11M382q, running on Mojave 18G95

Additional Detail from JIRA
Votes 0
Component/s llbuild
Labels Bug
Assignee @BenchR267
Priority Medium

md5: aa88e689f97b00e6ae5496e9f4a8f964

Issue Description:

The package file for sourcekit-lsp pulls down swift-package-manager, which itself pulls down llbuild. A new commit to llbuild has added a dependency on swift-tools-support-core, which is duplicated from SwiftPM, resulting in a total of 14 resolution errors from duplicate target names. For instance, Xcode 11b7 says:

: multiple products named 'TSCTestSupportTests' in: SwiftPM, swift-tools-support-core
: multiple products named 'TSCBasicTests' in: SwiftPM, swift-tools-support-core
: multiple products named 'TSCBasicPerformanceTests' in: SwiftPM, swift-tools-support-core
: multiple products named 'TSCUtilityTests' in: SwiftPM, swift-tools-support-core
: multiple targets named 'TSCBasic' in: SwiftPM, swift-tools-support-core
: multiple targets named 'TSCBasicPerformanceTests' in: SwiftPM, swift-tools-support-core
: multiple targets named 'TSCBasicTests' in: SwiftPM, swift-tools-support-core
: multiple targets named 'TSCLibc' in: SwiftPM, swift-tools-support-core
: multiple targets named 'TSCTestSupport' in: SwiftPM, swift-tools-support-core
: multiple targets named 'TSCTestSupportExecutable' in: SwiftPM, swift-tools-support-core
: multiple targets named 'TSCTestSupportTests' in: SwiftPM, swift-tools-support-core
: multiple targets named 'TSCUtility' in: SwiftPM, swift-tools-support-core
: multiple targets named 'TSCUtilityTests' in: SwiftPM, swift-tools-support-core
: multiple targets named 'TSCclibc' in: SwiftPM, swift-tools-support-core
@BenchR267
Copy link
Member

Sorry about that! The problem is that the targets have the same name in SwiftPM as they have in tools support core. There are multiple different solutions - each with a drawback. We'll discuss what to do next and revert the dependency from llbuild on tools support core for now: #555

@swift-ci
Copy link
Author

swift-ci commented Sep 9, 2019

Comment by Jim Dovey (JIRA)

No worries, I'm glad we were able to get it noticed & fixed quickly. It looks like the commit format for tools-support-core is ultimately to blame, because right now it's just the result of some copying of folders from SwiftPM's Source folder. Unless the Package format allows specifying a different names for the target vs. its source folder, it looks like there's going to be some more hurdles along the road.

Thanks for the quick turnaround.

@BenchR267
Copy link
Member

That is actually possible. The Package.swift is not generated/copied, just the directories. So we could use different names for the targets and folders in the file system. The problem is that all imports in the source files would need to change to use the same target names as well :/
This will be solved when we remove the code from SwiftPM and it entirely lives in tools-support-core - we need SwiftPM to be able to declare a dependency on tsc first though.

@BenchR267
Copy link
Member

We merged a temporary workaround of not declaring the new executable in llbuild here. A longer term solution will probably to define a local package for the executable which uses the llbuild package as a dependency.

@BenchR267
Copy link
Member

Merged the local package in c67ef17

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants