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-9502] latest SwiftPM 5.0 snapshots don't accept 'tools-version: 5.0' and give misleading error message #4739

Closed
weissi opened this issue Dec 13, 2018 · 5 comments
Labels

Comments

@weissi
Copy link
Member

weissi commented Dec 13, 2018

Previous ID SR-9502
Radar None
Original Reporter @weissi
Type Bug
Status Resolved
Resolution Done
Environment

5.0 snapshot from 12th December 2018

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

md5: f6accb366ae1b5844a5afee399271e97

Issue Description:

If I try to create a 5.0 manifest, it doesn't work and gives me a misleading error message

$ head Package.swift 
// swift-tools-version:5.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "something",
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
$ jw-swift-latest swift build
/private/tmp/something: error: package at '/private/tmp/something' is using Swift tools version 4.2.0 which is no longer supported; use 5.0.0 or newer instead
$ jw-swift-latest swift --version
Apple Swift version 5.0-dev (LLVM 743858f81d, Clang 051fdefbe8, Swift e231ae1638)
Target: x86_64-apple-darwin18.2.0

the error is

is using Swift tools version 4.2.0 which is no longer supported; use 5.0.0 or newer instead

what I think it wants to say is that it doesn't support 5.0 yet which is also surprising...

@neonichu
Copy link
Member

I can reproduce it with the 5.0 snapshot toolchain, but not when building SwiftPM from source, will have to investigate.

@neonichu
Copy link
Member

swiftpm-public $ /Library/Developer/Toolchains/swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-10-a.xctoolchain/usr/bin/swift-package --version
Swift Package Manager - Swift 4.2.0 (a7d3ba48)
swiftpm-public $ git show a7d3ba48|grep ^Date
Date:   Fri Nov 2 19:31:31 2018 -0700

We didn't add the 5.0 tools version until Nov 30, so that's why it doesn't work in the snapshot. We probably need to cherry-pick a bunch of commits to the 5.0 branch.

@ankitspd
Copy link
Member

ankitspd commented Jan 2, 2019

We have automerger so we shouldn't need to cherry-pick. I'll check with latest snapshot.

@weissi
Copy link
Member Author

weissi commented Jan 2, 2019

@aciidb0mb3r, @neonichu did a fix already recently. The latest snapshots work just fine 🙂

@ankitspd
Copy link
Member

ankitspd commented Jan 2, 2019

Working fine with swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-28-a

@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