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)