diff --git a/lib/updatePatches.js b/lib/updatePatches.js index 47e905fb6084..5b01a0fb3916 100644 --- a/lib/updatePatches.js +++ b/lib/updatePatches.js @@ -16,7 +16,7 @@ const updatePatches = (options) => { let modifiedDiff = util.run('git', modifiedDiffArgs, runOptions) let moddedFileList = modifiedDiff.stdout.toString() .split('\n') - .filter(s => s.length > 0 && !s.endsWith('.xtb') && !s.endsWith('.png')) + .filter(s => s.length > 0 && !s.endsWith('.xtb') && !s.endsWith('.png') && !s.includes('google_update_idl')) let n = moddedFileList.length diff --git a/lib/util.js b/lib/util.js index e46600311c5b..5d1faedec0d1 100644 --- a/lib/util.js +++ b/lib/util.js @@ -77,9 +77,23 @@ const util = { fs.copySync(path.join(braveAppDir, 'strings'), path.join(chromeComponentsDir, 'strings')) }, + // Chromium compares pre-installed midl files and generated midl files from IDL during the build to check integrity. + // Generated files during the build time and upstream pre-installed files are different because we use different IDL file. + // So, we should copy our pre-installed files to overwrite upstream pre-installed files. + // After checking, pre-installed files are copied to gen dir and they are used to compile. + // So, this copying in every build doesn't affect compile performance. + updateOmahaMidlFiles: () => { + console.log('update omaha midl files...') + const srcDir = path.join(config.projects['brave-core'].dir, 'win_build_output', 'midl', 'google_update') + const dstDir = path.join(config.srcDir, 'third_party', 'win_build_output', 'midl', 'google_update') + fs.copySync(srcDir, dstDir) + }, + buildTarget: (options = config.defaultOptions) => { console.log('building ' + config.buildTarget + '...') + util.updateOmahaMidlFiles() + const args = util.buildArgsToString(config.buildArgs()) util.run('gn', ['gen', config.outputDir, '--args="' + args + '"'], options) util.run('ninja', ['-C', config.outputDir, config.buildTarget], options)