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-14610] SwiftPM builds unwanted products #4422

Open
swift-ci opened this issue May 8, 2021 · 1 comment
Open

[SR-14610] SwiftPM builds unwanted products #4422

swift-ci opened this issue May 8, 2021 · 1 comment
Labels

Comments

@swift-ci
Copy link
Contributor

swift-ci commented May 8, 2021

Previous ID SR-14610
Radar rdar://problem/77855231
Original Reporter SDGGiesbrecht (JIRA User)
Type Bug
Environment

It occurs at least on macOS and the three officially supported Linux flavours.

It began happening in Swift 5.4.

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 61e915c0b627b7abe90be8a096fea5b6

Issue Description:

New in Swift 5.4, certain sequences of commands seem to scramble the build plan cache such that it ends up building far flung executables, dynamic libraries, and explicitly static libraries even though they are unreachable from the root package.

Steps to reproduce:

1. Create a new executable package and declare a dependency on one product in a package which also has other products that generate binaries (such as an executable, a .dylib or a .a). The SDGSwiftConfiguration product from https://github.com/SDGGiesbrecht/SDGSwift at 6.0.1 will suffice to demonstrate.

2. Build the package

swift build

As expected, it will only build the two necessary modules (SDGSwiftConfiguration and the executable itself).

3. Run the executable

swift run the‐name‐of‐the‐executable

As expected, it will launch the executable and print “Hello, world!” or whatever.

4. Build the package again

swift build

Now it will incorrectly build every binary product in any manifest in the dependency graph, even the ones unreachable from the root package (such as SwiftSyntax.a in this case).

Notably, the problem does not occur if step 3 is skipped.

@typesanitizer
Copy link

@swift-ci create

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

No branches or pull requests

3 participants