Skip to content

Commit

Permalink
fix: Fix byName resolution (#1117)
Browse files Browse the repository at this point in the history
In the case of `accessibilitysnapshot`, it depends on `SnapshotTesting`
by name. `SnapshotTesting` has an identity of `swift-snapshot-testing`
(based on the git url, but it could be different for mirrors/forks), but
the name is `snapshottesting`.

Signed-off-by: Brentley Jones <[email protected]>
  • Loading branch information
brentleyjones authored Jun 26, 2024
1 parent 6884df4 commit 01b4e77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion swiftpkg/internal/pkginfo_target_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _resolve_by_name(pkg_ctx, name):

ext_dep = lists.find(
pkg_ctx.pkg_info.dependencies,
lambda d: d.identity == normalized_name,
lambda d: d.name == normalized_name,
)
if ext_dep != None:
return [bazel_labels.new(
Expand Down
8 changes: 4 additions & 4 deletions swiftpkg/tests/pkginfo_target_deps_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _target_dep_condition = pkginfos.new_target_dependency_condition(
# AwesomePackage (external dependency)

_external_dep = pkginfos.new_dependency(
identity = "awesomepackage",
identity = "awesomepackage-identity",
name = "AwesomePackage",
file_system = pkginfos.new_file_system(
path = "/path/to/AwesomePackage",
Expand Down Expand Up @@ -134,7 +134,7 @@ def _bzl_select_list_test(ctx):
kind = pkginfo_target_deps.target_dep_kind,
value = [
bazel_labels.normalize(
"@swiftpkg_awesomepackage//:AwesomePackage",
"@swiftpkg_awesomepackage_identity//:AwesomePackage",
),
],
),
Expand All @@ -148,7 +148,7 @@ def _bzl_select_list_test(ctx):
kind = pkginfo_target_deps.target_dep_kind,
value = [
bazel_labels.normalize(
"@swiftpkg_awesomepackage//:AwesomeProduct",
"@swiftpkg_awesomepackage_identity//:AwesomeProduct",
),
],
),
Expand All @@ -162,7 +162,7 @@ def _bzl_select_list_test(ctx):
kind = pkginfo_target_deps.target_dep_kind,
value = [
bazel_labels.normalize(
"@swiftpkg_awesomepackage//:AwesomeProduct",
"@swiftpkg_awesomepackage_identity//:AwesomeProduct",
),
],
condition = c,
Expand Down

0 comments on commit 01b4e77

Please sign in to comment.