From 59e39baf33b7dce1f10f8fe820dd6ce44de392be Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Mon, 14 Sep 2020 11:12:16 -0700 Subject: [PATCH] [felt] Eliminate ninja-jobs argument (flutter/engine#21135) Migrate to autoninja which works out the ideal level of parallelism. --- engine/src/flutter/lib/web_ui/dev/README.md | 8 ------- engine/src/flutter/lib/web_ui/dev/build.dart | 22 ++++---------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/engine/src/flutter/lib/web_ui/dev/README.md b/engine/src/flutter/lib/web_ui/dev/README.md index 73e181a9f8..d530e62053 100644 --- a/engine/src/flutter/lib/web_ui/dev/README.md +++ b/engine/src/flutter/lib/web_ui/dev/README.md @@ -31,14 +31,6 @@ If you don't want to add `felt` to your path, you can still invoke it using a re ## Speeding up your builds and tests -You can speed up `ninja` and `dart2js` by adding parallelism and taking advantage of more cores. - -To speed up ninja pass `-j` to specify the desired level of parallelism, like so: - -``` -felt build [-w] -j 100 -``` - If you are a Google employee, you can use an internal instance of Goma to parallelize your builds. Because Goma compiles code on remote servers, this option is effective even on low-powered laptops. By default, when compiling Dart code to JavaScript, we use 8 `dart2js` workers. diff --git a/engine/src/flutter/lib/web_ui/dev/build.dart b/engine/src/flutter/lib/web_ui/dev/build.dart index 7e31a3fdb2..5a23dd45f8 100644 --- a/engine/src/flutter/lib/web_ui/dev/build.dart +++ b/engine/src/flutter/lib/web_ui/dev/build.dart @@ -21,11 +21,6 @@ class BuildCommand extends Command with ArgUtils { abbr: 'w', help: 'Run the build in watch mode so it rebuilds whenever a change' 'is made.', - ) - ..addOption( - 'ninja-jobs', - abbr: 'j', - help: 'Number of parallel jobs to use in the ninja build.', ); } @@ -37,15 +32,12 @@ class BuildCommand extends Command with ArgUtils { bool get isWatchMode => boolArg('watch'); - int getNinjaJobCount() => intArg('ninja-jobs'); - @override FutureOr run() async { - final int ninjaJobCount = getNinjaJobCount(); final FilePath libPath = FilePath.fromWebUi('lib'); final Pipeline buildPipeline = Pipeline(steps: [ gn, - () => ninja(ninjaJobCount), + () => ninja(), ]); await buildPipeline.start(); @@ -78,17 +70,11 @@ Future gn() { } // TODO(mdebbar): Make the ninja step interruptable in the pipeline. -Future ninja(int ninjaJobs) { - if (ninjaJobs == null) { - print('Running ninja (with default ninja parallelization)...'); - } else { - print('Running ninja (with $ninjaJobs parallel jobs)...'); - } - - return runProcess('ninja', [ +Future ninja() { + print('Running autoninja...'); + return runProcess('autoninja', [ '-C', environment.hostDebugUnoptDir.path, - if (ninjaJobs != null) ...['-j', '$ninjaJobs'], ]); }