rules_swift_package_manager icon indicating copy to clipboard operation
rules_swift_package_manager copied to clipboard

feat: Swift registry support

Open watt opened this issue 1 year ago • 5 comments

Fixes #1016

This PR adds support for package registry dependencies, by adding a new build rule type. For a Package.swift dependency like this:

    dependencies: [
        .package(id: "apple.swift-collections", from: "1.1.0"),
    ]

A build rule will be generated like this:

    swift_registry_package(
        name = "swiftpkg_apple.swift_collections",
        dependencies_index = "@//:swift_packages_index.json",
        id = "apple.swift-collections",
        version = "1.1.0",
    )

watt avatar Apr 25 '24 02:04 watt

Thank you for the contribution! Let me know what you think about my comment on the issue.

cgrindel avatar Apr 26 '24 13:04 cgrindel

@watt @cgrindel What's needed to land this? Ideally this would be part of 1.0.

brentleyjones avatar Jun 18 '24 14:06 brentleyjones

What's needed to land this? Ideally this would be part of 1.0.

We just need to understand how this PR changes with swift_update_packages disappearing from rules_swift_package_manager.

cgrindel avatar Jun 18 '24 14:06 cgrindel

What's needed to land this? Ideally this would be part of 1.0.

We just need to understand how this PR changes with swift_update_packages disappearing from rules_swift_package_manager.

Is this something I can help with? I'd love to land this as it works today and then iterate towards whatever shape 1.0 has, but I don't have a good sense for what that entails.

watt avatar Jun 25 '24 21:06 watt

@watt I just merged #957 which removes the swift_update_packages and some other big changes. Can you rebase this PR from main and raise any issues that you may need help navigating?

cgrindel avatar Jun 26 '24 13:06 cgrindel

Unfortunately the breaking changes in #957 made it impractical for me to continue working on this. I may revisit it at some point once we have migrated to bzlmod.

watt avatar Aug 27 '24 01:08 watt

I am sorry that the recent changes thwarted your efforts. Once the 1.0 release happens, it would be great to pick this up again.

cgrindel avatar Aug 28 '24 17:08 cgrindel