Skip to content

Commit

Permalink
Warn if building an empty list of targets
Browse files Browse the repository at this point in the history
    The syntax of bazel's build command is `bazel build <options> <targets>`.
    In particular, just `bazel build` is a legitimate request to build
    the empty list of targets. Nevertheless, some users get confused
    by this behavior and requested that a warning be added. Do as
    requested.

    Fixes #6811.

    Change-Id: I83f9a9e18f01f657242fc06f3ac09d68a0256ec7
    PiperOrigin-RevId: 233765339
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent a1d16da commit 6dc4ddf
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ public BlazeCommandResult exec(CommandEnvironment env, OptionsParsingResult opti
"Usage: "
+ runtime.getProductName()
+ " build <options> <targets>."
+ "\nInvoke `"
+ runtime.getProductName()
+ " help build` for full description of usage and options."
+ "\nInvoke `bazel help build` for full description of usage and options."
+ "\nYour request is correct, but requested an empty set of targets."
+ " Nothing will be built."));
}
Expand Down

0 comments on commit 6dc4ddf

Please sign in to comment.