This repository is a chromium fork that has been adapted to use the record/replay driver.
Only one build configuration is currently supported.
-
Install chromium tree and
depot_tools
per https://www.chromium.org/developers/how-tos/get-the-code- Warning: The
--no-history
flag is currently untested. Try it if you don't think you won't need to deal with rebase in the future.
- Warning: The
-
Change to and pull our (instead of the original) origin for chromium.
- NOTE: The
gclient sync
here updates all subrepositories to the correct point, including both repositories we've modified and ones we haven't. See "Setting dependency revisions" below for more. - NOTE: After
git pull
, you might see "You are not currently on a branch. Please specify which branch you want to merge with.". In this case,git switch master
will ignore all local changes, and instead tracks and switches to the remotemaster
on the current branch (more info here).
cd /path/to/chromium/src git remote set-url origin https://github.com/replayio/chromium.git git branch -D main git pull git switch master gclient sync
- NOTE: The
-
Setup engflow: Follow the instructions here up to step 8.
-
Gen + Configure your build:
- If you are using Linux, see Troubleshooting first.
cd /path/to/src gn gen out/Release gn args out/Release # opens args.gn config file
-
Add the following settings to
out/Release/args.gn
:# src/out/Release/args.gn use_remoteexec = true is_debug = false # we can't really use most debugging symbols right now dcheck_always_on = false # disable dchecks enable_nacl = false # no native targets use_allocator = "none" use_allocator_shim = false
- The following setting may be helpful for looking at stack traces while recording.
symbol_level = 1
- NOTE: This isn't used for production builds because the resulting binary size is pretty huge.
- On macOS add the following settings.
When building an ARM browser on an x64 mac add the following setting:
use_system_xcode = false mac_sdk_official_version = "13.0"
A hermetic version of xcode also needs to be downloaded and installed. Run the following:target_cpu = "arm64"
cd /path/to/chromium/src mkdir -p ./build/mac_files/xcode_binaries cd build/mac_files/xcode_binaries wget https://static.replay.io/downloads/hermetic_xcode.tar.gz tar xf hermetic_xcode.tar.gz
- The following setting may be helpful for looking at stack traces while recording.
-
Build:
node build
If you have trouble with new submodules popping up that are not part of our current release:
- You might see the submodules pop up as unwanted files in
git status
, and they might sneak into your PR. - You can easily and safely remove them via
git rm --cached name-of-submodule
. - E.g. (for old Chromium 91):
git rm --cached docs/website third_party/cast_core/public/src third_party/content_analysis_sdk/src third_party/cpuinfo/src third_party/cros_components third_party/fxdiv/src third_party/highway/src third_party/libjxl/src third_party/pthreadpool/src third_party/wayland-protocols/gtk third_party/wayland-protocols/kde third_party/xnnpack/src
When facing the following:
$ gn gen out/Release
ERROR at //build/toolchain/concurrent_links.gni:90:19: Script returned non-zero exit code.
_command_dict = exec_script("get_concurrent_links.py", _args, "scope")
^----------
Try to install some more additional Python-related packages:
sudo apt install python-pkg-resources python3-pkg-resources python-is-python3
If launching out/release/chrome
gives this error message:
Loading Record Replay driver failed.
This is caused by missing libssl 1.1 on Ubuntu 22.04, apparently a common problem that breaks many popular software (MongoDB, MariaDB, etc.)
Solution: Either stick with Ubuntu 20.04, or (as a workaround) install libssl 1.1
manually from Ubuntu 20.04:
echo "deb http://security.ubuntu.com/ubuntu focal-updates main" | sudo tee /etc/apt/sources.list.d/focal-updates.list
sudo apt update
sudo apt install libssl1.1
Because chromium's source is split across many git repositories, merging changes from upstream is tricky
Pull upstream changes and merge into master branch:
git checkout upstream
git pull https://github.com/chromium/chromium.git master
git push
git checkout master
git merge upstream
... fix merge conflicts ...
git commit -a
git push
cd /path/to/chromium
gclient sync -D
cd v8
git pull
... fix merge conflicts ...
git commit -a
git push
-> Repeat for all other chromium repositories we've forked (skia
, webrtc
etc.)
The revision to use for dependent repositories is specified in the DEPS file and updated to by running gclient sync
. Whenever the revision to use for any dependencies we've modified changes, this file needs to be updated. Look for v8_revision
, skia_revision
, or the revision associated with https://github.com/replayio/chromium-webrtc.git
.
After a rebase has happened (e.g. master
has been rebased to latest chromium
release version):
git checkout master
git pull
- Update submodules
cd ./v8 && git checkout master && git pull && \ cd ../third_party/webrtc && git checkout main && git pull && \ cd ../skia && git checkout main && git pull && \ cd ../..
- (To play it extra safe) Verify that submodule revisions are correct in
DEPS
, e.g. via:cd ./v8 && git log cd ../third_party/webrtc && git log cd ../skia && git log cd ../..
- Update your local
depot_tools
- If possible, update build dependencies:
./build/install-build-deps.sh
(might not always work because it does not support many systems) - Clean your build (delete
out
folder) - Re-do the initial steps:
cd .../src gclient sync -D # NOTE: `args.gn` has been deleted - fix it again (see above for details) gn gen out/Release gn args out/Release # or manually write `./out/Release/args.gn` # WARN: If you did any of the above steps wrong, nuke `out` and try again. node build