Skip to content

Commit

Permalink
Merge pull request #1205 from brave/ignore_compile_failure
Browse files Browse the repository at this point in the history
Introduce --ignore_compile_failure to build script
  • Loading branch information
bbondy authored Oct 1, 2018
2 parents aa3df58 + e214c6f commit d95374b
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 @@ -267,6 +268,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 d95374b

Please sign in to comment.