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

extra_args lost when running in a sub-directory #536

Closed
Globegitter opened this issue May 26, 2019 · 2 comments · Fixed by #1112
Closed

extra_args lost when running in a sub-directory #536

Globegitter opened this issue May 26, 2019 · 2 comments · Fixed by #1112

Comments

@Globegitter
Copy link
Contributor

I have written a plugin for nodejs and to be able to configure the name of the external repository where all yarn/npm dependencies are being installed added a flag npm_workspace_name which I am setting as follows:

gazelle(
    name = "gazelle",
    gazelle = ":gazelle_js",
    prefix = "github.com/ecosia/core",
    extra_args = [
        "-npm_workspace_name",
        "global-yarn",
    ],
)

This works fine when running bazel run //:gazelle but if I no run bazel run //:gazelle -- app to just run gazelle in a subdir the flag is being lost and the default value of that flag is being applied which is quite confusing.

Maybe it makes sense to not strip off extra_args when running in a subdir?

@jayconrod
Copy link
Contributor

I don't think we can change this behavior. Subcommands like update-repos take options that may be completely different than what fix or update accept.

The documentation isn't really clear on what this attribute does though. That should be fixed.

@ewianda
Copy link

ewianda commented Sep 24, 2021

Stumbled on this.

This command works for subdirectory

bazel run //:gazelle --   -npm_workspace_name global-yarn  app 

pcj added a commit to pcj/bazel-gazelle that referenced this issue Oct 9, 2021
linzhp pushed a commit that referenced this issue Nov 12, 2021
* Document behaviour of extra_args with bazel run

Fixes #536
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants