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

SPM doesn't compile properly with version 8.x.x #1327

Closed
cbauer10 opened this issue Nov 6, 2023 · 4 comments · Fixed by PromiseKit/Foundation#34
Closed

SPM doesn't compile properly with version 8.x.x #1327

cbauer10 opened this issue Nov 6, 2023 · 4 comments · Fixed by PromiseKit/Foundation#34
Labels
bug dependencies Pull requests that update a dependency file

Comments

@cbauer10
Copy link

cbauer10 commented Nov 6, 2023

PromiseKit major version = 8

We are using SwiftPM to install PromiseKit and get the following error using version 8.x.x:

package 'package.swift' is using Swift tools version 3.1.0 which is no longer supported; consider using '// swift-tools-version: 5.9' to specify the current tools version

We are using Swift Tools 5.9 as you can see from our Package.swift file:

// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "AllegionNetworking",
    platforms: [
        .iOS(.v13)
    ],
    products: [
        // Products define the executables and libraries a package produces, and make them visible to other packages.
        .library(
            name: "AllegionNetworking",
            targets: ["AllegionNetworking"])
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
         .package(url: "https://ircost.visualstudio.com/Allegion/_git/Allegion.Logging.iOS",
                  .upToNextMajor(from: "4.0.0")),
         .package(url: "https://ircost.visualstudio.com/Allegion/_git/Allegion.Security.iOS",
                  .upToNextMajor(from: "3.0.0")),
         .package(url: "https://github.com/mxcl/PromiseKit",
                  .upToNextMajor(from: "8.0.0")),
         .package(url: "https://github.com/PromiseKit/Foundation",
                  .upToNextMajor(from: "3.0.0")),
         .package(url: "https://github.com/realm/SwiftLint",
                  .upToNextMajor(from: "0.53.0")),
         .package(url: "https://github.com/Quick/Nimble",
                  .upToNextMajor(from: "13.0.0"))
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages this package depends on.
        .target(
            name: "AllegionNetworking",
            dependencies: [
                .product(name: "AllegionLoggingLite", package: "Allegion.Logging.iOS"),
                .product(name: "AllegionSecurity", package: "Allegion.Security.iOS"),
                "PromiseKit",
                .product(name: "PMKFoundation", package: "Foundation")
            ],
            plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]),
        .testTarget(
            name: "AllegionNetworking-UnitTests",
            dependencies: ["AllegionNetworking", "Nimble"],
            path: "Tests/AllegionNetworkingTests/Unit",
            resources: [
                .copy("Supporting Files/developerapi.allegion.com.cer"),
                .copy("Supporting Files/www.google.com.cer")
            ],
            swiftSettings: [
                .define("SPM")
            ],
            plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]),
        .testTarget(
            name: "AllegionNetworking-IntegrationTests",
            dependencies: ["AllegionNetworking", "Nimble"],
            path: "Tests/AllegionNetworkingTests/Integration",
            plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]),
        .testTarget(
            name: "AllegionNetworking-FunctionalTests",
            dependencies: ["AllegionNetworking", "Nimble"],
            path: "Tests/AllegionNetworkingTests/Functional",
            plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")])
    ]
)

Changing the Swift Tools version does not change anything. PromiseKit version 6.22.1 works just fine with Swift Tools 5.9 and all is well, but we would like to update to the newest version of PromiseKit.

@maige-app maige-app bot added bug dependencies Pull requests that update a dependency file labels Nov 6, 2023
@RomanPodymov
Copy link
Collaborator

Hello @cbauer10
What about this fix?

@RomanPodymov
Copy link
Collaborator

Hello @cbauer10
Have you tried my fork in your project? Just want to know if my fix is correct.

@cbauer10
Copy link
Author

@RomanPodymov
Yes, this does resolve the issue. I support your PR #34.

@mxcl
Any chance we can update Foundation to the latest version as @RomanPodymov has suggested?

@mxcl
Copy link
Owner

mxcl commented Nov 14, 2023

sorry for the delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants