bazelbuild / bazel-watcher

Tools for building Bazel targets when source files change.
Apache License 2.0
440 stars 118 forks source link

Arguments parsing #283

Closed libsamek closed 4 years ago

libsamek commented 5 years ago

Currently ibazel arguments are the following:

ibazel [ibazel_flags] build|test|run [bazel_flags] targets...

Where ibazel_flags are internal ibazel specific arguments and bazel_flags are actual Bazel flags. The issue with this can be with Bazel startup arguments, eg. --bazelrc, which is passed as ibazel build --bazelrc=some-bazelrc //.... It would be desired if we could do something like ibazel --bazelrc=some-bazelrc to be consistent with Bazel arguments.

But then again the question arises, how to handle ibazel arguments.

github-actions[bot] commented 4 years ago

Stale issue message

github-actions[bot] commented 4 years ago

Stale issue message

mrmeku commented 4 years ago

@achew22 I assume that ibazel has a limited number of flags which are non overlapping with bazel's flags. Perhaps you can just detect ibazel flags and if you encounter a flag that ibazel doesn't recognize forward it on to bazel

github-actions[bot] commented 4 years ago

Stale issue message

achew22 commented 4 years ago

Uugh, why can't I tag an issue as "definitely not stale" and have it linger?

github-actions[bot] commented 4 years ago

Stale issue message

davidlee1435 commented 4 years ago

Hey folks, just wanted to check in on this. We want to use the --output_base and --output_user_root startup flags, but on my fork, it seems like they're being counted as ibazel flags.

achew22 commented 4 years ago

What did you modify in the fork?

davidlee1435 commented 4 years ago

I added the --profile= and --run_script= run flags to overridableBazelFlags. I'm trying to add --output_base and --output_user_root, which are both startup flags, but I'm running into the same issue as @libsamek where these flags are being treated as ibazel flags

achew22 commented 4 years ago

Did you add them to the startup flag list?

https://github.com/bazelbuild/bazel-watcher/blob/0f7c15644b3489211d5076a408b47ba2db90eac8/ibazel/main.go#L29

davidlee1435 commented 4 years ago

Ah, I see now. You have to pass all flags (including startup flags) after the command.

achew22 commented 4 years ago

You have to pass them after ibazel, yes. Other than that there should be no restriction.