rules_spm icon indicating copy to clipboard operation
rules_spm copied to clipboard

Cannot include package with binary (not executable) library target

Open pswaminathan opened this issue 2 years ago • 1 comments

Example is Braze. Here, BrazeKit is a binary target. The Package.swift points to a zip file with an XCFramework

spm_pkg declaration:

        spm_pkg(
            url = "https://github.com/braze-inc/braze-swift-sdk.git",
            from_version = "5.5.0",
            products = ["BrazeKit", "BrazeUI"]
        ),

Traceback:

ERROR: An error occurred during the fetch of repository 'swift_pkgs':
   Traceback (most recent call last):
	File "/private/var/tmp/_bazel_p/c1a9d93c5d307e720ae1d0573bce325b/external/cgrindel_rules_spm/spm/private/spm_repositories.bzl", line 593, column 30, in _spm_repositories_impl
		_configure_spm_repository(repository_ctx, pkgs, env)
	File "/private/var/tmp/_bazel_p/c1a9d93c5d307e720ae1d0573bce325b/external/cgrindel_rules_spm/spm/private/spm_repositories.bzl", line 541, column 28, in _configure_spm_repository
		_generate_bazel_pkg(
	File "/private/var/tmp/_bazel_p/c1a9d93c5d307e720ae1d0573bce325b/external/cgrindel_rules_spm/spm/private/spm_repositories.bzl", line 68, column 46, in _generate_bazel_pkg
		build_decl = _create_spm_module_decls(
	File "/private/var/tmp/_bazel_p/c1a9d93c5d307e720ae1d0573bce325b/external/cgrindel_rules_spm/spm/private/spm_repositories.bzl", line 172, column 17, in _create_spm_module_decls
		fail("Unrecognized target type. %s" % (target))
Error in fail: Unrecognized target type. {"c99name": "BrazeKit", "module_type": "BinaryTarget", "name": "BrazeKit", "path": "remote/archive/BrazeKit.zip", "product_memberships": ["BrazeKit", "BrazeUI"], "sources": [], "type": "binary", "dependencies": []}

Even if I just wanted to use BrazeUI, the traceback is the same.

pswaminathan avatar Oct 05 '22 14:10 pswaminathan

I haven't come across a binary target before. We will need to add support for it.

cgrindel avatar Oct 06 '22 13:10 cgrindel