This document contains an assortment of information for those who want to develop ungoogled-chromium.
Information targeted towards developers and other users live in the Wiki.
Development is focused on master
, and any changes in there should not break anything unless platforms break during a Chromium version rebase.
Larger feature changes or hotfixes must be done in a separate branch. Once they are ready, then a Pull Request can be made onto master
(for contributors with write access, merging directly via a git client is fine). After the branch is merged, it should be removed.
See docs/how_to_add_your_feature_flag.md
in the Chromium source tree for the steps needed. Note that updating tools/metrics/histograms/enums.xml
is not required.
For new flags, first add a constant to third_party/ungoogled/ungoogled_switches.cc
(by modifying patch resources/patches/ungoogled-chromium/add-third-party-ungoogled.patch
). Then, use this constant in the steps outlined above.
- It is highly recommended to have a read through docs/design.md and reference existing bundles to understand the divisions of configuration.
- Anytime the bundles or patches are modified, use
devutils/validate_config.py
to run several sanity checking algorithms. - Whenever patch orders or patches are modified, use
devutils/validate_patches.py
for validation. See the following section for more details on updating patches. - If you are rebasing patches against a new Chromium version, please add
patches_outdated = true
to thebundlemeta.ini
of any config bundles that you are not able to update. This will prevent failing CI status checks until those bundles' patches have been updated.
Tested on Debian 9.0 (stretch). Exact instructions should work on any other Linux or macOS system with the proper dependencies.
It is recommended to read the docs/building.md and docs/design.md documents first to gain a deeper understanding of the process.
quilt
- This is available in most (if not all) Linux distributions, and also Homebrew on macOS.
- This utility facilitates most of the updating process, so it is important to learn how to use this. The manpage for quilt (as of early 2017) lacks an example of a workflow. There are multiple guides online, but this guide from Debian and the referenced guide on that page are the ones referenced in developing the current workflow.
- Python 3.5 or newer
This is an example workflow on Linux that can be modified for your specific usage.
The utility devutils/update_lists.py
automates this process. By default, it will update the common
base bundle automatically. Pass in -h
or --help
for availabe options.
Here's an example for updating the common
configuration type:
mkdir -p build/downloads
./devutils/update_lists.py --auto-download -c build/downloads -t build/src
The resulting source tree in build/src
will not have binaries pruned or domains substituted.
IMPORTANT: Make sure domain substitution has not been applied before continuing. Otherwise, the resulting patches will require domain substitution.
- Setup a source tree without domain substitution. For the
common
bundle:python3 -m buildkit downloads retrieve -b config_bundles/common -c build/downloads
python3 -m buildkit downloads unpack -b config_bundles/common -c build/downloads build/src
- Run
source devutils/set_quilt_vars.sh
- This will setup quilt to modify patches directly in
patches/
- This will setup quilt to modify patches directly in
- If updating patches for a specific bundle, run
devutils/update_patches.py -as build/src
(if updating for a specific bundle, append-b BUNDLE_PATH_HERE
). If successful, then everything is done. Otherwise, continue on to the next step. - Use
quilt
to fix the broken patch:- Run
quilt push -f
- Edit the broken files as necessary by adding (
quilt edit ...
orquilt add ...
) or removing (quilt remove ...
) files as necessary- When removing large chunks of code, remove each line instead of using language features to hide or remove the code. This makes the patches less susceptible to breakages when using quilt's refresh command (e.g. quilt refresh updates the line numbers based on the patch context, so it's possible for new but desirable code in the middle of the block comment to be excluded.). It also helps with readability when someone wants to see the changes made based on the patch alone.
- Refresh the patch:
quilt refresh
- Run
devutils/update_patches.py -as build/src -b BUNDLE_PATH_HERE
(if updating a specific bundle, append-b BUNDLE_PATH_HERE
). If successful, then continue on to the next step. Otherwise, repeat this procedure within Step 4 of the entire instructions.
- Run
- Run
devutils/validate_config.py
- Run
quilt pop -a
- If updating patches for a specific bundle, run
devutils/validate_patches.py -l build/src
(if updating a specific bundle, append-b BUNDLE_PATH_HERE
). If errors occur, go back to Step 3.
This should leave unstaged changes in the git repository to be reviewed, added, and committed.
If you used quilt new
anywhere during the update process, remember to add that patch manually to the corresponding patch_order.list
for the applicable bundle.
For bundles that you are not able to update, please add patches_outdated = true
to the bundlemeta.ini
for those corresponding config bundles. This will prevent failing CI status checks until those bundles' patches have been updated.
If domain substitution is not applied, then the steps from the previous section will work for revising patches.
If domain substitution is applied, then the steps for the initial update will not apply since that would create patches which depend on domain substitution. Here is a method of dealing with this:
- Revert domain substitution:
python3 -m buildkit domains revert -c CACHE_PATH_HERE build/src
- Follow the patch updating section above
- Reapply domain substitution:
python3 -m buildkit domains apply -b BUNDLE_PATH_HERE -c CACHE_PATH_HERE build/src
- Reattempt build. Repeat steps as necessary.