-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Make bazel run
works with minimal mode
#16545
Conversation
boolean useToplevelDownloader = remoteOutputsMode.downloadToplevelOutputsOnly(); | ||
|
||
// Download toplevel artifacts for `run` command. | ||
if ("run".equals(env.getCommandName())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need to support other commands (e.g. coverage
, mobile-install
, etc.). Do you think whether it is better if we always use toplevel downloader but pass in the download mode, let the downloaders decide what to download in both minimal/toplevel mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it does seem better to keep all of that logic in the downloader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
boolean useToplevelDownloader = remoteOutputsMode.downloadToplevelOutputsOnly(); | ||
|
||
// Download toplevel artifacts for `run` command. | ||
if ("run".equals(env.getCommandName())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it does seem better to keep all of that logic in the downloader.
@@ -306,6 +306,14 @@ public BlazeCommandResult exec(CommandEnvironment env, OptionsParsingResult opti | |||
return BlazeCommandResult.detailedExitCode(result.getDetailedExitCode()); | |||
} | |||
|
|||
if (env.getOutputService() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment here explaining why this is necessary (since a casual reader of RunCommand.java might not be familiar with BwoB).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@bazel-io flag |
Always use `ToplevelArtifactsDownloader` when building without the bytes. It checks the combination of current command (e.g. `build`, `run`, etc.) and download mode (e.g. `toplevel`, `minimal`) to decide whether download outputs for the toplevel targets or not. Also in the `RunCommand`, we wait for the background downloads before checking the local filesystem. Fixes bazelbuild#11920. Closes bazelbuild#16545. PiperOrigin-RevId: 487181884 Change-Id: I6b1a78a0d032d2cac8093eecf9c4d2e76f90380f
Always use `ToplevelArtifactsDownloader` when building without the bytes. It checks the combination of current command (e.g. `build`, `run`, etc.) and download mode (e.g. `toplevel`, `minimal`) to decide whether download outputs for the toplevel targets or not. Also in the `RunCommand`, we wait for the background downloads before checking the local filesystem. Fixes #11920. Closes #16545. PiperOrigin-RevId: 487181884 Change-Id: I6b1a78a0d032d2cac8093eecf9c4d2e76f90380f
Always use
ToplevelArtifactsDownloader
when building without the bytes.It checks the combination of current command (e.g.
build
,run
, etc.) and download mode (e.g.toplevel
,minimal
) to decide whether download outputs for the toplevel targets or not.Also in the
RunCommand
, we wait for the background downloads before checking the local filesystem.Fixes #11920.