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

Unable to build when using GzipSwift #65

Closed
alessandrodn opened this issue Jun 17, 2024 · 10 comments · Fixed by #64
Closed

Unable to build when using GzipSwift #65

alessandrodn opened this issue Jun 17, 2024 · 10 comments · Fixed by #64
Assignees
Labels

Comments

@alessandrodn
Copy link

alessandrodn commented Jun 17, 2024

Version 6.1.0 of the package can't be installed because of a typo in the file [email protected].
Doing a simple package update during the build invalidates the whole project with Xcode presenting the error

Invalid manifest (compiled with: ["/Applications/Xcode-15.4.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc", "-vfsoverlay", "/var/folders/7l/rszmbrmd6tv4pg52z6ql_5rc0000gn/T/TemporaryDirectory.vh9fZx/vfs.yaml", "-L", "/Applications/Xcode-15.4.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/Applications/Xcode-15.4.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-target", "arm64-apple-macos13.0", "-sdk", "/Applications/Xcode-15.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk", "-swift-version", "5", "-I", "/Applications/Xcode-15.4.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-sdk", "/Applications/Xcode-15.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk", "-package-description-version", "5.10.0", "-Xfrontend", "-serialize-diagnostics-path", "-Xfrontend", "/Users/[REDACTED]/Library/Caches/org.swift.swiftpm/manifests/ManifestLoading/gzipswift.dia", "/[email protected]", "-disallow-use-new-driver", "-o", "/var/folders/7l/rszmbrmd6tv4pg52z6ql_5rc0000gn/T/TemporaryDirectory.VUJWLU/gzipswift-manifest"])
<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'
/[email protected]:14:78: error: expected ',' separator
            swiftSettings: [.enableExperimentalFeature("StrictConcurrency")])
                                                                             ^
                                                                             ,
/[email protected]:15:9: error: expected expression in container literal
        ),
        ^ in https://github.com/1024jp/GzipSwift2024-06-17 13:25:24.715 xcodebuild[8695:42623] Writing error result bundle to /var/folders/7l/rszmbrmd6tv4pg52z6ql_5rc0000gn/T/ResultBundle_2024-17-06_13-25-0024.xcresult
xcodebuild: error: Could not resolve package dependencies:
  Invalid manifest (compiled with: ["/Applications/Xcode-15.4.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc", "-vfsoverlay", "/var/folders/7l/rszmbrmd6tv4pg52z6ql_5rc0000gn/T/TemporaryDirectory.vh9fZx/vfs.yaml", "-L", "/Applications/Xcode-15.4.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/Applications/Xcode-15.4.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-target", "arm64-apple-macos13.0", "-sdk", "/Applications/Xcode-15.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk", "-swift-version", "5", "-I", "/Applications/Xcode-15.4.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-sdk", "/Applications/Xcode-15.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk", "-package-description-version", "5.10.0", "-Xfrontend", "-serialize-diagnostics-path", "-Xfrontend", "/Users/[REDACTED]/Library/Caches/org.swift.swiftpm/manifests/ManifestLoading/gzipswift.dia", "/[email protected]", "-disallow-use-new-driver", "-o", "/var/folders/7l/rszmbrmd6tv4pg52z6ql_5rc0000gn/T/TemporaryDirectory.VUJWLU/gzipswift-manifest"])
<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'
/[email protected]:14:78: error: expected ',' separator
            swiftSettings: [.enableExperimentalFeature("StrictConcurrency")])
                                                                             ^
                                                                             ,
/[email protected]:15:9: error: expected expression in container literal
        ),
        ^ in https://github.com/1024jp/GzipSwift

The PR #64 fixes the issue.

@alessandrodn alessandrodn changed the title Unable to build with version 6.1.0 Unable to build when using GzipSwift Jun 17, 2024
@1024jp 1024jp self-assigned this Jun 17, 2024
@1024jp 1024jp added the bug label Jun 17, 2024
@1024jp 1024jp linked a pull request Jun 17, 2024 that will close this issue
@alessandrodn
Copy link
Author

As a workaround, you can ping the version to anything below 6.1.0.

@julo15
Copy link

julo15 commented Jun 17, 2024

Thanks @alessandrodn . Will you guys be making a new release soon? Just wondering if I should work around this or just wait for you guys to publish.

@BenTincher
Copy link

will there be a release for this fix soon? thanks

@DePasqualeOrg
Copy link

Could you please publish a new release with this fix? It's currently preventing me from building my project, which has dependencies that depend on GzipSwift. I can't pin a prior version without forking those dependencies.

@julo15
Copy link

julo15 commented Jun 26, 2024

@DePasqualeOrg @BenTincher as @alessandrodn suggested, you can force SPM to use an earlier version. I'm doing the following to achieve this:

    .package(url: "https://github.com/1024jp/GzipSwift", "6.0.0"..<"6.1.0"),

@DePasqualeOrg
Copy link

@Julo, this package is consumed by dependencies of my project. I've tried forking them and specifying a working version, but I can't get it to work. @1024jp, could you please publish a patch release to unblock the projects that depend on this package?

@julo15
Copy link

julo15 commented Jun 27, 2024

@DePasqualeOrg ah gotcha, yeah that is a problem.

it sounds like you already tried this, but note that it's okay for the dependency to have different versions specified in your Package.swift vs your dependencies' Package.swift files, as long as they don't conflict.

I had this problem with a different dependency (swift-protobuf), where both Firebase and my project depended on different versions.

In this case, Firebase had this version specifier:

    .package(
      url: "https://github.com/apple/swift-protobuf.git",
      "1.19.0" ..< "2.0.0"
    ),

I wanted to lock to a specific commit, so I had my package.swift specify the version as follows:

.package(url: "https://github.com/apple/swift-protobuf.git", revision: "68c452eef4fc8a7c7764617f6fe0d9673906e310"),

I think this ended up working fine since the 68c452e is still within "1.19.0" ..< "2.0.0". SPM (correctly) resolved to the 68c452e revision.

Anyway, just sharing for posterity. Ultimately, GzipSwift does need to either unpublish 6.1.0 or release a fixed version.

@DePasqualeOrg
Copy link

DePasqualeOrg commented Jun 27, 2024

The problem is mostly Xcode, which didn't seem to want to download the version of the package I specified. I had to remove it and add it back again from my own fork of the dependency. Stuff like this wastes hours of people's time, while publishing a patch version takes just a minute. I know people are busy and open source work is mostly unpaid, but please don't leave broken packages out there like this, especially after the fix already exists.

davidkoski added a commit to ml-explore/mlx-swift-examples that referenced this issue Jun 27, 2024
- later versions have compile issues: 1024jp/GzipSwift#65

fixes: #85
@julo15
Copy link

julo15 commented Jun 27, 2024

agreed, xcode and swift package manager are both pretty terrible.

one thing in particular that's pretty gnarly: if you (or your dependencies) are pulling a dependency in via from, e.g.

.package(url: "https://github.com/1024jp/GzipSwift", from: "6.0.0"),

Note that the from version is a MINIMUM version, not a fixed version. I found that incredibly not obvious and it has burned me before.

    /// Adds a package dependency that uses the version requirement, starting with the given minimum version,
    /// going up to the next major version.
    ///
    /// This is the recommended way to specify a remote package dependency.
    /// It allows you to specify the minimum version you require, allows updates that include bug fixes
    /// and backward-compatible feature updates, but requires you to explicitly update to a new major version of the dependency.
    /// This approach provides the maximum flexibility on which version to use,
    /// while making sure you don't update to a version with breaking changes,
    /// and helps to prevent conflicts in your dependency graph.
    ///
    /// The following example allows the Swift Package Manager to select a version
    /// like a  `1.2.3`, `1.2.4`, or `1.3.0`, but not `2.0.0`.
    ///
    ///```swift
    ///.package(url: "https://example.com/example-package.git", from: "1.2.3"),
    ///```
    ///
    /// - Parameters:
    ///    - url: The valid Git URL of the package.
    ///    - version: The minimum version requirement.
    ///
    /// - Returns: A `Package.Dependency` instance.
    public static func package(url: String, from version: PackageDescription.Version) -> PackageDescription.Package.Dependency

@andi-tml
Copy link

andi-tml commented Jul 3, 2024

Is there any reason why 6.1.0 version is still available. Is there a rule of not removing published versions even if that version is broken?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants