-
Notifications
You must be signed in to change notification settings - Fork 13
Depend on package but not its dependencies #148
Comments
Sorry for the delay in responding. I am out on vacation. This is an interesting problem. I don't have an immediate answer. The current implementation for What would you prefer for the behavior?
|
Feel no pressure to do anything while you're on vacation.
It is the same version that SPM picked.
Unfortunately the dependency is baked into You bring up an interesting solution to this problem which is that I can patch my copy of I guess the real question here is. is this a generic problem that In case anyone is curious about this patch in the future, here is what I ended up with. I put this patch file in From 2ce98b5e5d35d835adb5b669592ceb195367d980 Mon Sep 17 00:00:00 2001
From: Andrew Z Allen
Date: Wed, 8 Jun 2022 15:42:39 -0600
Subject: [PATCH] Replace support libraries with rules_spm targets
This allows installs a support version that deviates from the version
that was used to generate the compiled sources.
---
swift/internal/swift_grpc_library.bzl | 2 +-
swift/internal/swift_protoc_gen_aspect.bzl | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/swift/internal/swift_grpc_library.bzl b/swift/internal/swift_grpc_library.bzl
index 52258f8..1b57a37 100644
--- a/swift/internal/swift_grpc_library.bzl
+++ b/swift/internal/swift_grpc_library.bzl
@@ -394,7 +394,7 @@ The kind of definitions that should be generated:
),
# TODO(b/63389580): Migrate to proto_lang_toolchain.
"_proto_support": attr.label_list(
- default = [Label("@com_github_grpc_grpc_swift//:GRPC")],
+ default = [Label("@swift_pkgs//grpc-swift:GRPC")],
),
"_protoc": attr.label(
cfg = "exec",
diff --git a/swift/internal/swift_protoc_gen_aspect.bzl b/swift/internal/swift_protoc_gen_aspect.bzl
index 1cca6a7..bee78a2 100644
--- a/swift/internal/swift_protoc_gen_aspect.bzl
+++ b/swift/internal/swift_protoc_gen_aspect.bzl
@@ -565,7 +565,7 @@ swift_protoc_gen_aspect = aspect(
# TODO(b/63389580): Migrate to proto_lang_toolchain.
"_proto_support": attr.label_list(
default = [
- Label("@com_github_apple_swift_protobuf//:SwiftProtobuf"),
+ Label("@swift_pkgs//SwiftProtobuf:SwiftProtobuf"),
],
),
"_protoc": attr.label(
-- Then I applied it in my workspace thusly
|
In the current implementation of |
A bit of an odd situation, so thank you in advance for humoring me.
I have a project that I'm working on that uses
rules_spm
for dependency management. I also am using the built intorules_swift
grpc rules. This means my dependencies are partially managed by the built-in torules_swift
third_party stuff and partly byrules_spm
.Things worked great for quite a while, but eventually I ended up in a place where one of my dependencies depended on something that was provided both through
rules_swift
and throughrules_spm
. This causes the linker to be unsure of what to do, and it gives up (dumping a truly impressive amount out to the screen).Errors are of the form:
I looked in the docs for how do this but
spm_pkg
doesn't seem to have a way to adjust the dependencies of a dependency. Is there some other way to do this that I'm missing?The text was updated successfully, but these errors were encountered: