Skip to content

Commit

Permalink
Introduce --ignore_compile_failure to build script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
simonhong committed Sep 26, 2018
1 parent 5d90028 commit e214c6f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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]
Expand Down
6 changes: 5 additions & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}) => {
Expand Down
1 change: 1 addition & 0 deletions scripts/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ program
.option('--brave_google_api_key <brave_google_api_key>')
.option('--brave_google_api_endpoint <brave_google_api_endpoint>')
.option('--channel <target_chanel>', 'target channel to build', /^(beta|dev|nightly|release)$/i, 'release')
.option('--ignore_compile_failure', 'Keep compiling regardless of error')
.arguments('[build_config]')
.action(build)

Expand Down

0 comments on commit e214c6f

Please sign in to comment.