Skip to content

Comments

Mark bzl_library as providing StarlarkLibraryInfo#610

Open
fmeum wants to merge 1 commit intobazelbuild:mainfrom
fmeum:patch-3
Open

Mark bzl_library as providing StarlarkLibraryInfo#610
fmeum wants to merge 1 commit intobazelbuild:mainfrom
fmeum:patch-3

Conversation

@fmeum
Copy link
Contributor

@fmeum fmeum commented Jan 26, 2026

Work towards bazelbuild/bazel#18599, but useful even without it as it allows custom aspects to collect bzl files to generate docs for.

Work towards bazelbuild/bazel#18599, but useful even without it as it allows custom aspects to collect bzl files to generate docs for.
@fmeum
Copy link
Contributor Author

fmeum commented Jan 26, 2026

@tetromino I have a prototype of the validation aspect for bzl_library ready. My plan is to keep the definition of StarlarkLibraryInfo in Starlark (possible thanks to StarlarkProviderWrapper in Bazel) and even in bazel_skylib (I think that we can retrieve the canonical repo name of Skylib from bazel_tools' repo mapping). In any case, this change will be needed to make that aspect work.

@tetromino
Copy link
Collaborator

My plan is to keep the definition of StarlarkLibraryInfo in Starlark (possible thanks to StarlarkProviderWrapper in Bazel) and even in bazel_skylib (I think that we can retrieve the canonical repo name of Skylib from bazel_tools' repo mapping)

@fmeum, if the provider symbol is defined in skylib, this means @bazel_tools cannot use it for its own equivalent of bzl_library (since bazel_tools cannot depend on skylib).

Wouldn't that mean that we risk a repeat of bazel-contrib/rules_go#4394?

@fmeum
Copy link
Contributor Author

fmeum commented Feb 6, 2026

If we want to get to the point where bazel_tools has no deps whatsoever then we should not put the provider into bazel_skylib, that's true. For now bazel_tools has many more steps than zhat. We could eventually move the provider into bazel_tools and have bazel_skylib redirect to it depending on the Bazel version.

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.

2 participants