Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying our pre-generated midl files to overwrite upstream midl files #303

Merged
merged 1 commit into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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') && !s.endsWith('.png'))
.filter(s => s.length > 0 && !s.endsWith('.xtb') && !s.endsWith('.png') && !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 @@ -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)
Expand Down