Overview
Helium uses GNU Quilt-formatted patches to modify Chromium’s source code. Patches are the primary mechanism for implementing privacy features, removing bloat, and customizing the browser experience.Patch Organization
Patches are organized in thepatches/ directory with two main categories:
- ungoogled-chromium
- upstream-fixes
Patches inherited from ungoogled-chromium that:
- Remove Google integration
- Disable telemetry and tracking
- Add privacy-enhancing features
- Customize browser behavior
disable-google-host-detection.patchdisable-crash-reporter.patchadd-ipv6-probing-option.patch
Setting Up Your Environment
Before developing patches, configure your environment for GNU Quilt:QUILT_PATCHES- Points to the patches directoryQUILT_DIFF_ARGS- Formatting options for diffsQUILT_REFRESH_ARGS- Options for refreshing patchesLC_ALL=C- Ensures consistent sorting
The alias
quilt='quilt --quiltrc -' fixes issues with absolute paths and preserves color output.Creating a New Patch
Create a new patch
ungoogled-chromium/- Privacy and debloating patchesupstream-fixes/- Backported fixes
Patch Best Practices
Naming Conventions
- Use descriptive, kebab-case names
- Prefix with category or purpose
- For upstream patches, include revision number (e.g.,
r1570045-)
disable-google-host-detection.patchadd-flag-to-hide-tab-close-buttons.patchr1570045-improve-dragging-between-groups.patch
Patch Structure
Each patch should:- Be focused on a single change or feature
- Include context lines for clarity
- Use unified diff format (
-p abformat) - Have no trailing whitespace
- Be as small as possible while remaining functional
Writing Patch Headers
Include descriptive headers in your patches:Validating Patches
Before submitting patches, run comprehensive validation:Check Patch Files
- All patches exist and are referenced in
series - No duplicate patches in the series file
- All patches are readable and properly formatted
Validate Patch Application
- Against Remote Source
- Against Local Source
- Cache Remote Files
Requires the
requests Python module.Run Complete Validation
- All patches exist and apply correctly
- No duplicate patches in series
- GN flags are sorted and not duplicated
downloads.iniconforms to schema
Updating Platform Patches
When working with platform-specific repositories (macOS, Linux, Windows), use the platform patch utility:Merge Patches
- Creates
series.orig(backup of platform series) - Creates
series.prepend(copy of Helium patches) - Merges Helium patches into platform patches
- Generates
series.merged
Unmerge Patches
- Moves prepended patches back to original location
- Applies changes from
series.mergedtoseries.orig - Preserves comments and formatting
- Cleans up intermediate files
Debugging Patch Failures
Enable Verbose Output
- Exact lines that failed to match
- Context from the source file
- Output from
patch --dry-run
Common Issues
Patch doesn't apply cleanly
Patch doesn't apply cleanly
Cause: The Chromium source has changed since the patch was created.Solution:
- Refresh the patch against the current Chromium version
- Resolve conflicts manually
- Re-validate the patch
Missing newline at end of file
Missing newline at end of file
Cause: Patch file doesn’t end with a newline.Solution:
Duplicate patch in series
Duplicate patch in series
Cause: The same patch is listed multiple times in
patches/series.Solution: Remove duplicate entries from the series file.File not found in source tree
File not found in source tree
Cause: The file being patched doesn’t exist in the Chromium source.Solution:
- Verify the Chromium version matches
- Check if the file was moved or removed upstream
- Update the patch to reflect current source structure
Testing Your Patches
After creating or modifying patches:Build Helium with your patches
Apply patches to Chromium source and build to ensure no compilation errors.
Contributing Patches
When submitting patches:- Document the purpose - Explain what the patch does and why it’s needed
- Reference sources - For upstream patches, include the Chromium revision number
- Test thoroughly - Validate on multiple platforms if possible
- Follow guidelines - See Contributing for full requirements
Patches are the heart of Helium’s privacy features. Well-crafted patches make the browser better for everyone.