Skip to content

Commit

Permalink
Use non-canonical repo name in hub repo (#2491)
Browse files Browse the repository at this point in the history
#2461 changed the rendering of the hub repo to use canonical repository
names, but incorrectly. Doing so wasn't necessary - instead we just need
to do the resolution of the non-canonical label from the perspective of
the hub repo rather than the consumer by using the `Label` constructor.

Fixes #2483
  • Loading branch information
cameron-martin authored Feb 18, 2024
1 parent d061e6a commit 547f6a0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion crate_universe/extension.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def _generate_hub_and_spokes(module_ctx, cargo_bazel, cfg, annotations):

rendering_config = json.decode(render_config(
regen_command = "Run 'cargo update [--workspace]'",
crate_label_template = "@@rules_rust~override~crate~{repository}__{name}-{version}//:{target}",
))
config_file = tag_path.get_child("config.json")
module_ctx.file(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{%- for dep in deps_set.common %}
{%- if dep.id in context.workspace_members %}{% continue %}}{% endif %}{# Workspace member repositories are not defined, skip adding their labels here #}
{%- set crate = context.crates | get(key=dep.id) %}
"{{ dep | get(key="alias", default=crate.name) }}": "{{ crate_label(name = crate.name, version = crate.version, target = dep.target) }}",
"{{ dep | get(key="alias", default=crate.name) }}": Label("{{ crate_label(name = crate.name, version = crate.version, target = dep.target) }}"),
{%- endfor %}
},
{%- endif %}
Expand Down

0 comments on commit 547f6a0

Please sign in to comment.