Skip to content

Add default_features directive#2247

Merged
jayconrod merged 5 commits intobazel-contrib:masterfrom
keith:ks/add-package_features-directive
Dec 5, 2025
Merged

Add default_features directive#2247
jayconrod merged 5 commits intobazel-contrib:masterfrom
keith:ks/add-package_features-directive

Conversation

@keith
Copy link
Copy Markdown
Member

@keith keith commented Dec 3, 2025

This sets the package(features = ...) attribute in all nested BUILD
files similar to default_visibility

Fixes #2236

Comment thread language/bazel/visibility/lang.go Outdated
Comment thread language/bazel/visibility/lang_test.go Outdated
keith added 2 commits December 3, 2025 22:40
This sets the `package(features = ...)` attribute in all nested BUILD
files similar to `default_visibility`

Fixes bazel-contrib#2236
@keith keith force-pushed the ks/add-package_features-directive branch from 50382bf to 9f395d4 Compare December 3, 2025 22:40
@keith keith force-pushed the ks/add-package_features-directive branch from 8342426 to afe5939 Compare December 3, 2025 22:41
Comment thread language/bazel/visibility/lang.go
@keith keith requested a review from jayconrod December 4, 2025 01:33
@keith keith force-pushed the ks/add-package_features-directive branch from e897215 to a29418f Compare December 5, 2025 21:12
@jeffmace
Copy link
Copy Markdown

jeffmace commented Dec 5, 2025

I've previously considered adding something like this but for default_package_metadata. Do you consider it better for each attribute to have a dedicated directive or have a generic directive for any attribute to the package function?

Copy link
Copy Markdown
Contributor

@jayconrod jayconrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks good.

@jayconrod jayconrod changed the title Add package_features directive Add default_features directive Dec 5, 2025
@jayconrod jayconrod enabled auto-merge (squash) December 5, 2025 23:06
@jayconrod
Copy link
Copy Markdown
Contributor

I've previously considered adding something like this but for default_package_metadata. Do you consider it better for each attribute to have a dedicated directive or have a generic directive for any attribute to the package function?

@jeffmace I think a separate directive for each (so # gazelle:default_package_metadata) is best. There aren't too many attributes, so supporting a few more shouldn't hurt.

@jayconrod
Copy link
Copy Markdown
Contributor

I'm seeing macOS failures in CI across multiple PRs: earlier OAuth2 failures, now errors checking out the repo. We'll need to wait for that to get straightened out upstream.

@keith
Copy link
Copy Markdown
Member Author

keith commented Dec 5, 2025

the repo checkout one is a CI flake, retry normally fixes

@jayconrod jayconrod merged commit 6dc1118 into bazel-contrib:master Dec 5, 2025
15 checks passed
@jayconrod
Copy link
Copy Markdown
Contributor

So it did!

@keith keith deleted the ks/add-package_features-directive branch December 5, 2025 23:19
@keith
Copy link
Copy Markdown
Member Author

keith commented Dec 5, 2025

thanks!

pcj pushed a commit to stackb/bazel-gazelle that referenced this pull request Dec 23, 2025
This sets the `package(features = ...)` attribute in all nested BUILD
files similar to `default_visibility`

Fixes bazel-contrib#2236

---------

Co-authored-by: Jay Conrod <jay@engflow.com>
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.

Add support for adding package level features attribute

3 participants