Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
BuildCommand: the default result is an error
Browse files Browse the repository at this point in the history
Summary:
The current logic and implementation may result that in SimpleConsole (with `-c ui.superconsole=DISABLED`) a failure may be reported as a success first and then as a true failure. This can happen because `BuildCommand`:
1. assumes SUCCESS as an initial status
2. doesn't handle all exceptions
3. issues a build finished `event` in the finally block `params.getBuckEventBus().post(BuildEvent.finished(started, exitCode));`

This change ensures that for `buck build` success will be reported only if it was a real success

Reviewed By: ttsugriy

fbshipit-source-id: 2c40ce9
  • Loading branch information
ilya-klyuchnikov authored and facebook-github-bot committed Mar 28, 2018
1 parent cea128d commit 8ce226c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/com/facebook/buck/cli/BuildCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ protected ExitCode run(
this.arguments.addAll(additionalTargets);
}
BuildEvent.Started started = postBuildStartedEvent(params);
ExitCode exitCode = ExitCode.SUCCESS;
ExitCode exitCode = ExitCode.BUILD_ERROR;
try (CloseableMemoizedSupplier<ForkJoinPool> poolSupplier =
getForkJoinPoolSupplier(params.getBuckConfig())) {
exitCode = executeBuildAndProcessResult(params, commandThreadManager, poolSupplier);
Expand Down

0 comments on commit 8ce226c

Please sign in to comment.