Skip to content

[6.1] Binary dependencies of C/C++ modules break build planning #8225

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

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

bnbarham
Copy link
Contributor

Description: Fixes a regression between 6.0 and 6.1 where a C/C++ product depending on a binary artifact would cause an internal failure.
Scope: Packages
Risk: Low - this just removes a check that was incorrectly added post 6.0 (ie. reverts to the previous behavior)
Testing: New test for this specific case
Issue: #8055
Reviewer: @xedin
Original PR: #8056 and #8212

…8056)

Fix a regression where the build planning phase will early terminate if
SwiftPM packages contain binary targets that C/C++ products refer to,
swiftlang#8055.

### Motivation:

When running `swift build` on SwiftPM packages with binary targets that
C++ products refer to, they will early terminate during the build
planning phase with the following error:

```swift
error: InternalError(description: "Internal error. Please file a bug at https://github.com/swiftlang/swift-package-manager/issues with this info. unknown module: <ResolvedModule: Python, binary>")
```

### Modifications:

Remove the guard, so we do not fail ~~if the module dependency does not
yet exist in the build plan's target map, which I think is normal~~ on
binary targets that C++ products refer to, since they don't have build
descriptions.

### Result:

When running `swift build` on SwiftPM packages with binary targets that
C++ products refer to, the build planning phase will proceed
successfully without error.

---------

Signed-off-by: furby™ <[email protected]>
(cherry picked from commit 0c6acf3)
@bnbarham
Copy link
Contributor Author

@swift-ci please test

Add a test
swiftlang#8055 that
checks we can successfully generate a manifest for a target -> static product
-> binary artifact dependency.

(cherry picked from commit a11477e)
@bnbarham bnbarham force-pushed the cherry-binary-dep-fix branch from 014f595 to 5abfd33 Compare January 16, 2025 00:41
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham
Copy link
Contributor Author

@swift-ci please test Windows platform

@bnbarham bnbarham merged commit 4bc74dd into swiftlang:release/6.1 Jan 17, 2025
5 checks passed
@bnbarham bnbarham deleted the cherry-binary-dep-fix branch January 17, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants