-
Notifications
You must be signed in to change notification settings - Fork 380
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
request: option to not generate in all directories #1832
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Request
Provide a way to only invoke language callbacks on directories that already have a BUILD. Include subdirectory content in
language.GenerateArgs.{Subdirs, RegularFiles, GenFiles}
for subdirectories without a BUILD.Background
In rules_go and other rulesets it seems normal to generate BUILD in every directory. In a lot of languages/rulesets this is not always ideal and sometimes impossible (circular deps across directories is way too common in some ecosystems...).
In multiple gazelle languages now I've added directives such as
generation_mode: create|update
where "update" means only existing BUILDs are updated and no new BUILDs are created. This requires hacks becauselanguage.GenerateArgs
only provides the list of direct child file/subdirs and not nested ones. TheConfigure
andGenerateRules
calls are then still called for every single directory and we must noop if there is no BUILD there, this causes extra overhead, extra fs walking overhead etc.Proposal
A cross-language directive to enable "update-only" mode, where no new BUILDs are created. When enabled:
Configure.Configure
is only be invoked on directories that have a BUILDlanguage.GenerateRules
is only be invoked on directories that have a BUILDGenerateArgs.{RegularFiles, GenFiles}
includes files in subdirs that do not have BUILDsGenerateArgs.Subdirs
only includes subdirs that do have BUILDsThe text was updated successfully, but these errors were encountered: