Skip to content

[et] --rbe should always succeed, or fail if it is not available #148006

@matanlurey

Description

@matanlurey

The current behavior of et is that --rbe defaults to true, but then, if true, is ignored if RBE is not configured:

// If RBE config files aren't in the tree, then disable RBE.
final String rbeConfigPath = p.join(
  environment.engine.srcDir.path,
  'flutter',
  'build',
  'rbe',
);

This leads to really confusing behavior, where you think RBE is being used (and indeed the flag is set), but silently the CLI has internal heuristics that decide not to use it. For example, I thought it was enabled, but there was no output, and I was taxing my CPU pretty heavily:
image


Proposal: We need to stop using this dark pattern of:

void doFoo() {
  if (inscrutableGlobalState) {
    // Failed successfully.
    return;
  }
}

In this case, I'd recommend that:

// If RBE config files aren't in the tree, then disable RBE.
final String rbeConfigPath = p.join(
  environment.engine.srcDir.path,
  'flutter',
  'build',
  'rbe',
);

argParser.addFlag(
  rbeFlag,
  defaultsTo: io.Directory(rbeConfigPath).existsSync(),
  help: 'RBE is enabled by default when available',
);

Now, I can do:

et build --help

And see if RBE would defaulted to true, and if I run:

et build --rbe

... and RBE can't be used/found, it should result in exit code 1/failure.

Metadata

Metadata

Assignees

Labels

c: proposalA detailed proposal for a change to Flutterc: tech-debtTechnical debt, code quality, testing, etc.e: engine-toolEngine-specific tooling (i.e. `tools/engine_tool`).engineflutter/engine related. See also e: labels.team-engineOwned by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions