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-12482] SwiftPM cannot resolve package dependencies and crashes Xcode #4570

Open
swift-ci opened this issue Apr 1, 2020 · 1 comment
Open
Labels

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Apr 1, 2020

Previous ID SR-12482
Radar rdar://problem/62201589
Original Reporter hectr (JIRA User)
Type Bug

Attachment: Download

Environment

Operating System:

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.4
BuildVersion: 19E266

Xcode version:

$ xcodebuild -versionXcode 11.4
Build version 11E146

Toolchain:

$ swift --version
Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)
Target: x86_64-apple-darwin19.4.0

Swift build version:

$ swift build --version
Swift Package Manager - Swift 5.2.0
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: b82ae174c427d73d676209e82a91f17b

Issue Description:

EDIT:
I asked for help in Swift Forums. There I got the explanation for my issue. I was using the same name for two of the packages in the dependency graph. I am not sure if I should close this bug or not. Because I believe that SwiftPM could fail in a more controlled way and give more helpful feedback when there is a clash in packages names.

When I add a specific dependency to my Package.swift (https://github.com/hectr/swift-http-client.git) file, SPM stops working (It cannot resolve package dependencies):

$ swift package resolve
Fatal error: 'try!' expression unexpectedly raised an error: TSCBasic.GraphError.unexpectedCycle: file /Library/Caches/com.apple.xbs/Sources/swiftpm/swiftpm-16074/Sources/Workspace/Workspace.swift, line 1112
zsh: illegal hardware instruction  swift package resolve

I attempted to use the dependency using a tag, the branch name and a local folder in my machine, but the outcome was the same. Renaming the library didn't help either.

I have tried to create the minimal project to reproduce the issue in my machine (Package.zip).

I am going to explain also how the issue started, just in case it is useful:

I am building an iOS application. My setup consists of a workspace that contains:

  • a project with the application's target

  • a Package.swift file

I also use CocoaPods, but I think it is not relevant to this issue.

I use the Package.swift file to add external dependencies and to create local libraries that I then add to the application target.

See the file layout:

.
├── Application
│   ├── MyApp/
│   └── MyApp.xcodeproj/
├── Package
│   ├── Package.swift
│   ├── Sources/
│   └── Tests/
├── MyApp.xcworkspace/
└── ...

I do most of the development opening the workspace and editing the source files and the Package.swift file.

After adding as a dependency the library https://github.com/hectr/swift-http-client.git, Xcode crashed. It kept crashing consistently each time I opened it. See the attached crash report.

If I remove the dependency, Xcode stops crashing.

@beccadax
Copy link
Contributor

@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