Skip to content

Retain module map names as Labels#633

Open
fmeum wants to merge 2 commits intobazelbuild:mainfrom
fmeum:header-modules
Open

Retain module map names as Labels#633
fmeum wants to merge 2 commits intobazelbuild:mainfrom
fmeum:header-modules

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented Mar 12, 2026

With the exception of special module map names, all of them are effectively labels. This commit ensures that they are retained as Labels, not label string and thus:

  • memory usage is reduced for module maps from external repos, whose module map name previously resulted in a newly retained string;
  • module map names now use properly formatted external repo labels as names, which makes it more obvious what they are;
  • the roundtrip in header module compilation flows is avoided. This actually fixes a bug where the missing @@ prefix for label strings resulted in incorrect or even failing Label calls due to main repo labels being resolved relative to the rules_cc repo and external repo labels failing the validation of the Label constructor.

With the exception of special module map names, all of them are effectively labels. This commit ensures that they are retained as `Label`s, not label string and thus:
* memory usage is reduced for module maps from external repos, whose module map name previously resulted in a newly retained string;
* module map names now use properly formatted external repo labels as names, which makes it more obvious what they are;
* the roundtrip in header module compilation flows is avoided. This actually fixes a bug where the missing `@@` prefix for label strings resulted in incorrect or even failing `Label` calls due to main repo labels being resolved relative to the rules_cc repo and external repo labels failing the validation of the `Label` constructor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant