bazel-contrib / bazel-lib

Common useful functions for writing BUILD files and Starlark macros/rules
Apache License 2.0
140 stars 90 forks source link

feat: export `extension_utils` #889

Closed mgred closed 3 months ago

mgred commented 4 months ago

Summary

This PR exposes extension_utils from lib/private/extension_utils.bzl. I tend to copy this kind of functionality from extension to extension, so it would be really helpful to have this great method available in the public API.

I hope this is fine and other users might benefit from it, too :smile:

Changes are visible to end-users: yes

Test plan

Do we need tests?

kormide commented 3 months ago

My concern with making this public was that I don't know if it's high enough fidelity and stable enough that we want to support the current iteration. I'll take another look through it..

fyi @alexeagle

kormide commented 3 months ago

Yeah, I don't think I want to make extension_utils public in it's current form. The toolchain_repos_bfs macro finds the toolchain version closest to the root but the right solution is probably to find the highest version in the dependency graph, allowing the root to override it.

mgred commented 3 months ago

thanks for the feedback. @kormide I can understand this decision. Currently I include the macro like this. I hope this is fine for you.