From e214c6fa3e55d32b9e7ed00a4bd46079eccafdc1 Mon Sep 17 00:00:00 2001 From: Simon Hong Date: Thu, 20 Sep 2018 16:51:46 +0900 Subject: [PATCH] Introduce --ignore_compile_failure to build script This option compiles files as many as possible regardless of compile error. It would be useful when we trigger full build before going to bed. --- lib/config.js | 4 ++++ lib/util.js | 6 +++++- scripts/commands.js | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index 04a550bab323..721928283e3f 100644 --- a/lib/config.js +++ b/lib/config.js @@ -47,6 +47,7 @@ const Config = function () { this.channel = '' this.sccache = getNPMConfig(['sccache']) this.braveReferralsApiKey = getNPMConfig(['brave_referrals_api_key']) || '' + this.ignore_compile_failure = false } Config.prototype.buildArgs = function () { @@ -262,6 +263,9 @@ Config.prototype.update = function (options) { if (options.gclient_verbose) this.gClientVerbose = options.gclient_verbose + if (options.ignore_compile_failure) + this.ignore_compile_failure = true + this.projectNames.forEach((projectName) => { // don't update refs for projects that have them let project = this.projects[projectName] diff --git a/lib/util.js b/lib/util.js index 9824534c04ec..7b7e617d1c04 100644 --- a/lib/util.js +++ b/lib/util.js @@ -187,9 +187,13 @@ const util = { if (process.platform === 'win32') util.updateOmahaMidlFiles() + let num_compile_failure = 1 + if (config.ignore_compile_failure) + num_compile_failure = 1000 + const args = util.buildArgsToString(config.buildArgs()) util.run('gn', ['gen', config.outputDir, '--args="' + args + '"'], options) - util.run('ninja', ['-C', config.outputDir, config.buildTarget], options) + util.run('ninja', ['-C', config.outputDir, config.buildTarget, '-k', num_compile_failure], options) }, submoduleSync: (options = {}) => { diff --git a/scripts/commands.js b/scripts/commands.js index c471b2e5ec74..2b7f1a638cb3 100644 --- a/scripts/commands.js +++ b/scripts/commands.js @@ -36,6 +36,7 @@ program .option('--brave_google_api_key ') .option('--brave_google_api_endpoint ') .option('--channel ', 'target channel to build', /^(beta|dev|nightly|release)$/i, 'release') + .option('--ignore_compile_failure', 'Keep compiling regardless of error') .arguments('[build_config]') .action(build)