7 ms·
Something I would like to mention, as a dev on Brave, is that patches are considered a last resort. If there are patches, we try to keep them lightweight - like
by bsclifton 3y ago
Something I would like to mention, as a dev on Brave, is that patches are considered a last resort. If there are patches, we try to keep them lightweight - like patch to have Chromium create the Brave version of the object (something we can restrict to one line).
What you'll notice more often is a folder we have called `chromium_src`. This directory mirrors the directory structure for Chromium under `src` and the build system will look for matches. If there's a file with the same name under `chromium_src`, it'll prefer that one. That file then does what it needs to differently and then includes the original file.
This approach helps keep things much more lightweight - but it has challenges too. If code fails to apply (file that `chromium_src` is matching gets renamed, etc) it can be hard to detect. This is where you'd want to have a test to catch that.
Another person shared - but here's a link to our patching documentation:
https://github.com/brave/brave-browser/wiki/Patching-Chromium https://github.com/brave/brave-browser/wiki/Patching-Chromiu...
You'll notice the actual patching itself is introduced with the caveat:
> When other options are exhausted, you can patch the code directly
- freedomben 3y agoThank you! I really appreciate the info :-)