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-12649] Swift 5.2 Seems to break package compilation of Swift 4 Package #4558

Closed
swift-ci opened this issue Apr 22, 2020 · 2 comments
Closed
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-12649
Radar rdar://problem/62895017
Original Reporter doubleclickrick (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

N/A

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

md5: 5cb1569a7e592fa60b01cf9126b62887

duplicates:

  • SR-12667 SwiftPM 5.3 treats all files under sources dirs are as source even in older manifests

Issue Description:

How This Was Discovered / Summary:

After updating my local Xcode (and therefore Swift) to version 5.2 (from 5.0) It broke my deployment flow when running "swift test --generate-linuxmain". I ran into this error https://pastebin.com/ad9WVhsL

I had not touched my package for this branch, So I suspected it may be an issue with SPM.

So I used swiftenv to try this on 5.1 and it did not repro. So it seems to be an issue between 5.1->5.2.2 (https://github.com/kylef/swiftenv).

I also asked for help in the SwiftPM slack and I got some more context from someone there. He said:

" It looks as if the sources: ["."] in the package manifest of the package is causing every file in that directory to be treated as a source file. That line has been in the manifest for a while, so that could be a bug in Swift 5. I don't know if that was a deliberate change in behavior for swift-tools-version:5.0 packages, but even if it were, it doesn't seem that the dependency should be treated that way, since it is declaring itself as 4.0.

To elaborate on my speculation earlier: when any semantic change is made in SwiftPM, it should always be conditional on the tool version declared in the manifest of the package, so SwiftPM 5.2 should follow the earlier semantics when parsing packages with an earlier tool version. It should never break an existing package, though when a package adopts a newer tool version, it might also have to make other changes to accommodate any change in semantics."

Repro:

  1. Create a library that uses this package. Example: https://pastebin.com/2WEZxsHm . This example uses Vapor but it is also repoduceable on a simple client side package (to get this package run vapornew SECP256k1issue locally in a new repo. Then add the secp256k1 package

  2. Make sure your swift version is > 5.1. Run swift --version to confirm

  3. Run swift build from the folder that contains the package.

Notice the error: https://pastebin.com/ad9WVhsL

@beccadax
Copy link
Contributor

beccadax commented May 5, 2020

@swift-ci create

@abertelrud
Copy link
Contributor

This was fixed in https://bugs.swift.org/browse/SR-12667. I realize that that Jira was filled later and that forward-duping is a bit of bad form, but I didn't realize at the time that this one covered the same issue. That one is already resolved, so this one is marked as duplicate of it.

@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
This issue was closed.
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