Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unique provider for sh_* rules #18331

Open
UebelAndre opened this issue May 5, 2023 · 2 comments
Open

Add unique provider for sh_* rules #18331

UebelAndre opened this issue May 5, 2023 · 2 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-Server Issues for serverside rules included with Bazel type: feature request

Comments

@UebelAndre
Copy link
Contributor

Description of the feature request:

I would like to write aspects that target shell rules but there’s no unique provider to key in on. Would it be possible to have a provider made to make this possible?

What underlying problem are you trying to solve with this feature?

I want to write an aspect that does linting on sh_binary targets but if --incompatible_top_level_aspects_require_providers is enabled the aspect fails since sh_binary, sh_library, and sh_test don’t return uniquely identifying providers

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

6.1.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@sgowroji sgowroji added the team-Configurability Issues for Configurability team label May 5, 2023
@gregestren gregestren added team-Rules-Server Issues for serverside rules included with Bazel team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts and removed team-Configurability Issues for Configurability team team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts labels May 10, 2023
@comius
Copy link
Contributor

comius commented Aug 4, 2023

Interesting. Empty providers called ShInfo would work. Probably incurring a small regression, but I think this is negligible, since I don't think large sh graphs are popular. But I might be wrong, since they are supposedly worth propagating an aspect over them

Is there any information that could be provided?

@comius comius added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Aug 4, 2023
@stagnation
Copy link

One clear example of an aspect to run is shellcheck which catches a lot of the common bugs in shell-scripts. I'd rather run that with Bazel and a specific aspect than with find, and while a global aspect can work with an early exit if the kind is not sh_* is is clearly suboptimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-Server Issues for serverside rules included with Bazel type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants