Skip to content

Commit

Permalink
Copying our pre-generated midl files to overwrite upstream midl files
Browse files Browse the repository at this point in the history
Chromum compares pre-installed midl files and generated midl files from
IDL file during the build to check integrity.
Generated files during the build time and upstream generated files are
different because we use different IDL files for google update.
So, we should copy our pre-installed files to overwrite upstream
pre-installed files.

Also, these files should not be the target of update_patches command.
  • Loading branch information
simonhong committed Jun 7, 2018
1 parent d9ae159 commit c1ea23b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/updatePatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
.filter(s => s.length > 0 && !s.endsWith('.xtb') && !s.includes('google_update_idl'))

let n = moddedFileList.length

Expand Down
14 changes: 14 additions & 0 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,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)
},

buildMuon: (target = 'brave', options = config.defaultOptions) => {
console.log('building ' + target + '...')

util.updateOmahaMidlFiles()

const args = util.buildArgsToString(config.buildArgs())
util.run('gn', ['gen', config.outputDir, '--args="' + args + '"'], options)
util.run('ninja', ['-C', config.outputDir, target], options)
Expand Down

0 comments on commit c1ea23b

Please sign in to comment.