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

Conversation

@matanlurey
Copy link
Contributor

@matanlurey matanlurey commented May 16, 2024

Closes flutter/flutter#148442.

This restores functionality that existed prior in #52832:

  • Splits runGn to ensureBuildDir, which is in practice what it does.

if (useLto) '--lto' else '--no-lto',
];

if (!await ensureBuildDir(environment, build, enableRbe: useRbe)) {
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 only needed if argResults.rest is non-empty since the first thing that runBuild is going to do is run gn.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, done!

/// Given a [Build] object, run only its GN step.
Future<int> runGn(
/// Run a [build]'s GN step if the output directory is missing.
Future<bool> ensureBuildDir(
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest keeping runGn and maybe making it lib private (_runGn), and then implementing ensureBuildDir() as a public wrapper around it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Comment on lines 227 to 237
if (built) {
if (!buildDir.existsSync()) {
environment.logger.error(
'The specified build did not produce the expected output directory: '
'${buildDir.path}',
);
return false;
}
return true;
}
return false;
Copy link
Member

Choose a reason for hiding this comment

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

Small simplification.

Suggested change
if (built) {
if (!buildDir.existsSync()) {
environment.logger.error(
'The specified build did not produce the expected output directory: '
'${buildDir.path}',
);
return false;
}
return true;
}
return false;
if (built && !buildDir.existsSync()) {
environment.logger.error(
'The specified build did not produce the expected output directory: '
'${buildDir.path}',
);
return false;
}
return built;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's much better, done.

Copy link
Contributor Author

@matanlurey matanlurey 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 much better and fixed some of the test changes I had to make. Thanks!

/// Given a [Build] object, run only its GN step.
Future<int> runGn(
/// Run a [build]'s GN step if the output directory is missing.
Future<bool> ensureBuildDir(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Comment on lines 227 to 237
if (built) {
if (!buildDir.existsSync()) {
environment.logger.error(
'The specified build did not produce the expected output directory: '
'${buildDir.path}',
);
return false;
}
return true;
}
return false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's much better, done.

if (useLto) '--lto' else '--no-lto',
];

if (!await ensureBuildDir(environment, build, enableRbe: useRbe)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, done!

@matanlurey matanlurey added autosubmit Merge PR when tree becomes green via auto submit App and removed autosubmit Merge PR when tree becomes green via auto submit App labels May 16, 2024
@matanlurey
Copy link
Contributor Author

Actually after @zanderso's feedback I can revert all of the test changes, thanks again!

@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App label May 16, 2024
@auto-submit auto-submit bot merged commit 9e17588 into flutter:main May 16, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 16, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request May 16, 2024
…148455)

flutter/engine@942d7c3...9e17588

2024-05-16 [email protected] `et` generates `{out}/{buildName}` if missing on `et {build|test|query}` (flutter/engine#52866)
2024-05-16 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Revamp the engine style guide, remove `always_specify_types`. (#52859)" (flutter/engine#52867)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

et used to auto-generate missing gn builds if omitted, regressed in #52832

2 participants