未验证 提交 b92f788d 编写于 作者: C Chris Bracken 提交者: GitHub

[felt] Eliminate ninja-jobs argument (#21135)

Migrate to autoninja which works out the ideal level of parallelism.
上级 b1c8d0e2
......@@ -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.
......
......@@ -21,11 +21,6 @@ class BuildCommand extends Command<bool> 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<bool> with ArgUtils {
bool get isWatchMode => boolArg('watch');
int getNinjaJobCount() => intArg('ninja-jobs');
@override
FutureOr<bool> run() async {
final int ninjaJobCount = getNinjaJobCount();
final FilePath libPath = FilePath.fromWebUi('lib');
final Pipeline buildPipeline = Pipeline(steps: <PipelineStep>[
gn,
() => ninja(ninjaJobCount),
() => ninja(),
]);
await buildPipeline.start();
......@@ -78,17 +70,11 @@ Future<void> gn() {
}
// TODO(mdebbar): Make the ninja step interruptable in the pipeline.
Future<void> ninja(int ninjaJobs) {
if (ninjaJobs == null) {
print('Running ninja (with default ninja parallelization)...');
} else {
print('Running ninja (with $ninjaJobs parallel jobs)...');
}
return runProcess('ninja', <String>[
Future<void> ninja() {
print('Running autoninja...');
return runProcess('autoninja', <String>[
'-C',
environment.hostDebugUnoptDir.path,
if (ninjaJobs != null) ...['-j', '$ninjaJobs'],
]);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册