-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Chromium rebases
- Create a new cloned directory and install the necessary node modules.
npm install
- Since this is a new clone, you won't have a
src
directory so runinit
to create that.
npm run init
-
Branch off the latest Chromium rebase branch or master, whichever is applicable.
-
Open
package.json
insrc/brave/
and change the string at the pathconfig.projects.chrome.tag
to the new Chromium version, then commit the changes to that file with the commentUpdate from Chromium XXX to Chromium YYY.
-
Run
npm run sync
to make sure that the Chromium repository atsrc/
is at the right version, the right internal dependencies are set to the expected versions, and the patches from Brave applied as expected. -
If all patches apply correctly, simply run
npm run update_patches
then, commit the changes with the comment Updated patches from Chromium XXX to Chromium YYY.
Typically, however, some patches will fail to apply.
- Resolve errors for each patch that didn't apply.
The most common situations are:
- The file being patched got moved/renamed -> rename the patch accordingly.
- The content of the file changed so that the lines surrounding the patched in lines don't match -> adjust the patch to fit the new content. Once the patch is fixed, apply it, then, update:
cd src
git apply -3 brave/patches/patch_name.patch
git diff <CHROMIUM_VERSION> --src-prefix=a/ --dst-prefix=b/ --full-index path/to/file/being/patched > brave/patches/patch_name.patch
When all such failing patches have been fixed, commit the changed patches with the comment Conflict-resolved patches from Chromium XXX to Chromium YYY.
- The content that was being patched or the entire file was removed -> determine if the patch can just be removed or other changes need to made to compensate for the removed code. Remove the patch and commit. The commit message should include the links to the relevant upstream changes on https://chromium.googlesource.com/ or https://source.chromium.org/, as well as the upstream commit messages for those changes.
- Once all patching errors have been resolved, run update:
npm run update_patches
This will update patches that applied correctly in the first place. Commit the changes with the comment Updated patches from Chromium XXX to Chromium YYY.
- Since the
init
was interrupted by patching errors runsync
:
npm run sync
Note: Be careful when applying tools/gritsettings/resource_ids
, sometimes the IDs can change and you should update the Brave one to be the same as the Chromium one.
Update grd
and grdp
files from the Chromium ones:
cd ..
npm run chromium_rebase_l10n
Note: Filled some custom strings to brave_strings.grd by https://github.com/brave/brave-core/pull/214/commits/256f5aa8e781d266ad23f863ac7b613615ad2a5a
Inspect changed strings visually to catch overly aggressive replacements (e.g. Google Lens -> Brave Lens).
If overly aggressive replacements are found, add them to script/lib/l10n/grd_string_replacements.py
and script/lib/l10n/transifex/push.py
and rerun the chromium_rebase_l10n
script.
Do a commit for the updated source strings, grd
files with the comment Updated strings for Chromium XXX
.
- For Mac, check
mac_sdk_min
insrc/build/config/mac/mac_sdk_overrides.gni
for the SDK version, the comment aboveMAC_BINARIES_TAG
andMAC_MINIMUM_OS_VERSION
insrc/build/mac_toolchain.py
for the XCode version and the OS version, - For Windows check
MSVS_VERSIONS
insrc/build/vs_toolchain.py
(CURRENT_DEFAULT_TOOLCHAIN_VERSION
insrc/build/win_toolchain.py
prior to C75) for Visual Studio versions.
Update your tool chain if needed and alert dev and CI teams on tool chain changes.
Do a build like normal, fix errors as they come up.
npm run build
If there's anything that should be called out as a non-trivial change, you should do it as a separate commit.
For each error fixed, the commit message should include the links to the relevant upstream changes on https://chromium.googlesource.com/ or https://source.chromium.org/, as well as the upstream commit messages for those changes.
If you have more fixes caused by the same upstream change, use git commit --fixup and rebase -i to squash them.
git log
1234567 Fix for upstream change A.
8910112 Fix for upstream change B.
git commit -a --fixup 1234567
git rebase -i --autosquash @~3
Run brave/script/check_chromium_src.py
to locate any override files in chromium_src
override directory:
- whose targets under
src
no longer exist - that contain definitions for symbols that are no longer present in the target file
Make an appropriate fix for each situation.
Build unit and browser tests as usual:
npm run test -- brave_unit_tests
npm run test -- brave_browser_tests
Use the same commit practices as for fixing the main build.
MIDL issue on Windows
When this message is visible during the build, check src/third_party/win_build_output/
is changed. If not, it means our pre-generated files in ./src/brave/win_build_output/midl/google_update/
are not copied there. In this case, check updateOmahaMidlFiles()
in lib/util.js
. Make sure that google_update
directory has two directory(x64, x86).
To rebaseline:
copy /y c:\users\XXX\appdata\local\temp\tmpdjhho_\* C:\Projects\brave\brave-browser\src\third_party\win_build_output\midl\google_update\x64
When submitting PR on Github add CI/run-network-audit
label to the PR to ensure that the CI runs audit-network
.
For now just follow the instructions in https://github.com/brave/brave-browser/wiki/Tests#privacy-network-audit.
We should build some automation to find new things added here:
- For MacOS check
mac_deployment_target
andmac_min_system_version
inbuild/config/mac/mac_sdk.gni
- For iOS check
ios_deployment_target
inbuild/config/ios/ios_sdk_overrides.gni
-
Check with the Security team in regards to any possibly relevant changes in features or their default settings. Specifically, post link to changes in https://chromium.googlesource.com/chromium/src/+diff/[PreviousVersion]..[NewVersion]/content/public/common/content_features.cc in #security-discussion Slack channel.
-
Besides new settings, we'll want to look at brave://components and see if there are new components registered. For example, there are components we have either missed (when added) or we never triaged captured in this GitHub issue. There's an issue created to automate this process which you can find here.
-
Entitlements to enable new features specific to Chrome are added to
https://source.chromium.org/chromium/chromium/src/+/master:chrome/app/app-entitlements-chrome.plist
.Review the new entitlements for each CR bump when new features are added to Chrome. -
On Android, new permissions can be added in */AndroidManifest.xml or */AndroidManifest.xml.expected. Users often ask questions about new permissions on update. Any new permissions should be reviewed by the @android-team or @security-team before merge.
See https://github.com/brave/brave-browser/wiki/Strings-and-Localization
Run this to detect new strings and push them to Transifex, it will also push up the translations for those strings automatically. If you need access talk to devops.
npm run push_l10n
Run this to pull down new xtb and translation files:
npm run pull_l10n
Do a commit for all the string translation updates, xtb
files.
When creating the PR, mark it as WIP
and put it into draft mode. The title should be Upgrade from Chromium {n} to Chromium {n+1}
where n
is the current version number.
The PR must contain all of the following labels:
CI/run-audit-deps
CI/run-draft
CI/run-network-audit
CI/run-upstream-tests
Before handing off a build to QA, please test the following functionality:
- Ensure that About page shows the expected version number
- Ensure that brave://settings is functional and not throwing any console errors
- Ensure that clearing browser data on exit works as expected
- Ensure that tabs have the expected shape (it's slightly different from Chrome)
- Ensure that videos play properly on YouTube and that the media device toolbar button works correctly
- Ensure that tab-muting works properly
- Ensure that vertical tabs work as expected (must first enable this via brave://flags)
- Ensure that enabling Rewards works properly
- Ensure that all elements of the sidebar panel work as expected
- Enusre that creating and using multiple profiles works as expected
- Ensure that private and Tor windows work as expected
- Ensure that a few different web sites load as expected
Make builds for QA smoke tests using the following links:
- MacOS (x64): https://ci.brave.com/view/macos/job/test-brave-browser-build-macos-x64
- MacOS (arm64): https://ci.brave.com/view/macos/job/test-brave-browser-build-macos-arm64
- Linux: https://ci.brave.com/view/linux/job/test-brave-browser-build-linux-x64
- Windows (x64): https://ci.brave.com/view/linux/job/test-brave-browser-build-windows-x64
- Windows (x86): https://ci.brave.com/view/linux/job/test-brave-browser-build-windows-x86
- Android: https://ci.brave.com/view/macos/job/test-brave-browser-build-android
- iOS: https://ci.brave.com/view/macos/job/test-brave-browser-build-ios
Settings:
-
CHANNEL
- Set tonightly
(this is the default) -
BRANCH
- Set to the appropriate branch name, e.g.,cr100
-
PREVIOUS_BUILD_NUMBER_DELTA
- Leave blank -
KEYCHAIN_NAME
(Mac only) - Must be set torelease
(this is now the default, but always double-check it as using the wrong setting will result in an app that crashes on startup)
Those build jobs produce installers that you can retrieve from the following places (you'll need to modify these links slightly, as they include build and version number information; they're provided here only as an example):
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-macos-x64/600/Brave-Browser-Nightly-x64.dmg
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-macos-arm64/153/Brave-Browser-Nightly-arm64.dmg
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-linux-x64/516/brave-browser-nightly_1.37.54_amd64.deb
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-linux-x64/516/brave-browser-nightly-1.37.54-1.x86_64.rpm
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x64/436/setup-x64.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x64/436/brave_installer-x64.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x64/436/BraveBrowserNightlySetup_99_1_37_54.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x64/436/BraveBrowserStandaloneNightlySetup_99_1_37_54.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x64/436/BraveBrowserStandaloneSilentNightlySetup_99_1_37_54.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x64/436/BraveBrowserStandaloneUntaggedNightlySetup_99_1_37_54.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x64/436/BraveBrowserUntaggedNightlySetup_99_1_37_54.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x86/436/setup-x86.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x86/436/brave_installer-x86.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x86/436/BraveBrowserNightlySetup_99_1_37_54.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x86/436/BraveBrowserStandaloneNightlySetup_99_1_37_54.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x86/436/BraveBrowserStandaloneSilentNightlySetup_99_1_37_54.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x86/436/BraveBrowserStandaloneUntaggedNightlySetup_99_1_37_54.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-windows-x86/436/BraveBrowserUntaggedNightlySetup_99_1_37_54.exe
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-android-variant/67/Bravearm.apk
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-android-variant/68/BraveMonoarm.apk
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-android-variant/69/Bravex86.apk
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-android-variant/70/BraveMonox86.apk
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-android-variant/71/BraveMonoarm64.apk
- https://brave-jenkins-build-artifacts.s3.amazonaws.com/test-brave-browser-build-android-variant/72/BraveMonox64.apk
After QA signoff on the test builds, merge to master
and announce it on the appropriate Slack channels. At this time, you can also note for developers any process/style/etc. changes required by the new Chromium version.
After merging to master
create uplifts as appropriate.
For post-merge minor Chromium bumps, follow the instructions here.