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 #16

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

Add unique provider for sh_* rules #16

UebelAndre opened this issue May 5, 2023 · 4 comments

Comments

@UebelAndre
Copy link

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

@comius
Copy link
Collaborator

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?

@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.

@UebelAndre
Copy link
Author

This issue can probably be transferred to https://github.com/bazelbuild/rules_shell, @fmeum @comius do you agree?

@fmeum
Copy link
Collaborator

fmeum commented Nov 6, 2024

I do, but I can't transfer issues.

@Wyverald Wyverald transferred this issue from bazelbuild/bazel Nov 6, 2024
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

No branches or pull requests

6 participants
@stagnation @comius @fmeum @UebelAndre @Pavank1992 and others