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-7386] switching between similar packages breaks swift package update #5407

Closed
swift-ci opened this issue Apr 9, 2018 · 2 comments
Closed
Labels

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Apr 9, 2018

Previous ID SR-7386
Radar rdar://problem/40205111
Original Reporter Noobish1 (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

OSX 10.13.4, Xcode 9.3, Swift 4.1

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

md5: fa1505032d7fa87aec680daaf31990ae

duplicates:

  • SR-6638 Occasionally need to rm -rf when changing dependencies

relates to:

  • SR-8380 Crash when a dependency depends on itself (cycle)

Issue Description:

I'm using Vapor for this example as that is what I was using originally.

Steps to reproduce:

1. `vapor new UpdateTest --template=api --branch=beta`

2. `vapor xcode` (not necessary I don't think but it is what I am using)

3. add `

.package(url: "https://github.com/vapor/auth.git", from: "2.0.0-rc.3.0.1"),` to your dependencies in `Package.swift` and add `Authentication` to the `App` target so it looks like the following:

```

// swift-tools-version:4.0

import PackageDescription

let package = Package(

name: "UpdateTest",

dependencies: \[

    // A server-side Swift web framework.

    .package(url: "https://github.com/vapor/vapor.git", from: "3.0.0-rc.2"),



    // Swift ORM (queries, models, relations, etc) built on SQLite 3.

    .package(url: "https://github.com/vapor/fluent-sqlite.git", from: "3.0.0-rc.2"),

    

    .package(url: "https://github.com/vapor/auth.git", from: "2.0.0-rc.3.0.1"),

\],

targets: \[

    .target(name: "App", dependencies: \["FluentSQLite", "Vapor", "Authentication"\]),

    .target(name: "Run", dependencies: \["App"\]),

    .testTarget(name: "AppTests", dependencies: \["App"\])

\]

)

```

4. Run `vapor update` (which runs swift package update), this should succeed

5. Change the auth depedency to read `

.package(url: "https://github.com/Noobish1/auth.git", .branch("token-optional-fix")),` so your `Package.swift` looks like the following:

```

// swift-tools-version:4.0

import PackageDescription

let package = Package(

name: "UpdateTest",

dependencies: \[

    // A server-side Swift web framework.

    .package(url: "https://github.com/vapor/vapor.git", from: "3.0.0-rc.2"),



    // Swift ORM (queries, models, relations, etc) built on SQLite 3.

    .package(url: "https://github.com/vapor/fluent-sqlite.git", from: "3.0.0-rc.2"),

    

    .package(url: "https://github.com/Noobish1/auth.git", .branch("token-optional-fix")),

\],

targets: \[

    .target(name: "App", dependencies: \["FluentSQLite", "Vapor", "Authentication"\]),

    .target(name: "Run", dependencies: \["App"\]),

    .testTarget(name: "AppTests", dependencies: \["App"\])

\]

)

```

6. Run `vapor update` again

Expected result: `vapor update` should succeed and our dependencies should be updated

Actual result: `vapor update` fails with the following message:

```

Error: backgroundExecute(code: 1, error: "error: terminated(128): git -C '/Users/Blair/Documents/iPhone Development/UpdateTest/.build/checkouts/auth.git-9199502942084726963' checkout -f 8bc7cc84b6fe7b6767ace857acb0592216c92c90 output:\n \n\n", output: "Fetching https://github.com/Noobish1/auth.git\nUpdating https://github.com/vapor/vapor.git\nUpdating https://github.com/vapor/fluent-sqlite.git\nUpdating https://github.com/vapor/validation.git\nUpdating https://github.com/vapor/service.git\nUpdating https://github.com/vapor/crypto.git\nUpdating https://github.com/vapor/routing.git\nUpdating https://github.com/vapor/template-kit.git\nUpdating https://github.com/vapor/console.git\nUpdating https://github.com/vapor/engine.git\nUpdating https://github.com/vapor/core.git\nUpdating https://github.com/vapor/database-kit.git\nUpdating https://github.com/apple/swift-nio.git\nUpdating https://github.com/apple/swift-nio-zlib-support.git\nUpdating https://github.com/apple/swift-nio-ssl.git\nUpdating https://github.com/apple/swift-nio-ssl-support.git\nUpdating https://github.com/vapor/fluent.git\nUpdating https://github.com/vapor/sqlite.git\nResolving https://github.com/Noobish1/auth.git at token-optional-fix\n")

```

Running `swift package update` also fails with this error:

```

Updating https://github.com/Noobish1/auth.git
Updating https://github.com/vapor/fluent-sqlite.git
Updating https://github.com/vapor/vapor.git
Updating https://github.com/vapor/routing.git
Updating https://github.com/vapor/database-kit.git
Updating https://github.com/vapor/crypto.git
Updating https://github.com/vapor/console.git
Updating https://github.com/vapor/core.git
Updating https://github.com/vapor/engine.git
Updating https://github.com/vapor/service.git
Updating https://github.com/vapor/template-kit.git
Updating https://github.com/vapor/validation.git
Updating https://github.com/apple/swift-nio.git
Updating https://github.com/apple/swift-nio-zlib-support.git
Updating https://github.com/apple/swift-nio-ssl.git
Updating https://github.com/apple/swift-nio-ssl-support.git
Updating https://github.com/vapor/sqlite.git
Updating https://github.com/vapor/fluent.git
Resolving https://github.com/Noobish1/auth.git at token-optional-fix
error: terminated(128): git -C '/Users/Blair/Documents/iPhone Development/UpdateTest/.build/checkouts/auth.git-9199502942084726963' checkout -f 8bc7cc84b6fe7b6767ace857acb0592216c92c90 output:

```

@ankitspd
Copy link
Member

@swift-ci create

@swift-ci
Copy link
Contributor Author

swift-ci commented Jun 7, 2018

Comment by Neal Lester (JIRA)

I tripped on the same or similar bug; deleting the .build directory seems to have worked.

@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

2 participants