Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@zanderso
Copy link
Member

@zanderso zanderso commented Feb 4, 2024

This PR adds an API to the engine_build_configs package that executes an engine build config locally . This API is a building block for an eventual command line tool to streamline workflows in the engine repo. In particular, it will allow the command line tool to execute the same config, build, and test commands that are run on CI.

@zanderso zanderso marked this pull request as draft February 4, 2024 21:06
@zanderso zanderso force-pushed the build-config-runner branch from 6cb8a50 to 6e9417b Compare February 5, 2024 04:57
@zanderso zanderso marked this pull request as ready for review February 5, 2024 16:12
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #50342 at sha 6e9417b

@zanderso
Copy link
Member Author

zanderso commented Feb 9, 2024

Friendly ping. Happy to chat about this or split it up into smaller pieces if that would be helpful.

// For example:
// $ dart bin/run.dart mac_unopt host_debug_unopt
//
// The build config names are the namess of the json files under ci/builders
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// The build config names are the namess of the json files under ci/builders
// The build config names are the names of the json files under ci/builders

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// $ dart bin/run.dart mac_unopt host_debug_unopt
//
// The build config names are the namess of the json files under ci/builders
// The build names are the "name" fields of the maps in the list of "builds".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good info, could we also add it to a README.md in //flutter/tools/pkg/engine_build_configs/ for improved readability?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel strongly about this, feel free to skip

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Added a light README.md.

configName = args[0];
buildName = args[1];
} else {
io.stderr.writeln('Wrong arguments');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this error message actionable? Perhaps something like:

Suggested change
io.stderr.writeln('Wrong arguments');
io.stderr.writeln('''
Usage:
$ dart bin/run.dart [build config name] [build name]
For example:
$ dart bin/run.dart mac_unopt host_debug_unopt
The build config names are the names of the json files under ci/builders
''');

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

}

// Check the parsed build configs for validity.
BuildConfig? targetConfig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace the loop below with:

targetConfig = configs[name];

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Done.

for (final String dimension in droneDimensions) {
os ??= switch (dimension.split('=')) {
['os', 'Linux'] => Platform.linux,
['os', 'Windows'] => Platform.windows,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we'll need to support Windows-10 and Windows-11. Example:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good catch. Done.

}

if (runGn) {
if (!await _runGN(eventHandler)) {
Copy link
Member

@loic-sharma loic-sharma Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: consider consistent casing _runGn to align with runGn

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

String toString() {
final String ts = '[${_timestamp(timestamp)}]';
final String pct = '${percent.toStringAsFixed(1)}%';
return '$ts[$name]: $pct $what';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The percentages feel slower than ninja's <completed>/<total> output. My computer might display 68.9% for a while even though it's actually completed several steps.

Could you expand on why you chose percentages instead of raw numbers?

Copy link
Member Author

@zanderso zanderso Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't think about this too deeply, but it does make sense for the progress object to include the number of completed steps and the total number of steps so that the client of the API can do whatever it likes with them, so I added them.

Copy link
Member

@loic-sharma loic-sharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, excellent work!

@zanderso zanderso force-pushed the build-config-runner branch from 6e9417b to 9adbbee Compare February 9, 2024 23:37
@zanderso zanderso force-pushed the build-config-runner branch from 9adbbee to f06a6f0 Compare February 10, 2024 01:02
@zanderso zanderso merged commit c587bd6 into flutter:main Feb 10, 2024
@zanderso zanderso deleted the build-config-runner branch February 10, 2024 02:42
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 10, 2024
@zanderso
Copy link
Member Author

xref flutter/flutter#132807

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants