devutils/ directory. These scripts help validate configuration files, check patches, and maintain code quality during development.
Overview
The developer utilities are a collection of Python scripts designed to ensure the integrity and consistency of Helium’s build configuration. They validate patches, check configuration files, and help maintain platform-specific patches.Configuration Validation
validate_config.py
Run comprehensive sanity checks on all configuration files.What it checks
What it checks
- All patches exist and are referenced in patch order
- No duplicate patches in series files
- GN flags in
flags.gnare sorted and not duplicated downloads.iniconforms to its schema
This script is hardcoded to run over Helium’s config files in the repository root. Returns exit code 0 if no problems detected, 1 for warnings or errors.
check_gn_flags.py
Validate GN build flags for proper formatting.Path to the GN flags file to check
- Flags are sorted alphabetically
- No duplicate flag definitions
- Proper key=value format
check_downloads_ini.py
Validate the downloads configuration file schema.List of downloads.ini files to validate
Patch Validation
validate_patches.py
Validate that all patches apply cleanly against the Chromium source tree.The series file listing patches to apply
The patches directory to read from
Use a local source tree (must be unmodified)
Download required source files from Google
Store required remote files in a local directory (for debugging)
Enable verbose logging for detailed error information
How it works
How it works
- Loads all patches from the series file
- Parses Chromium’s DEPS file to understand repository structure
- Downloads or reads required source files
- Applies patches using unidiff to verify they match cleanly
- Reports any patches that fail validation
check_patch_files.py
Run sanity checks on patch files and series configuration.Path to the patches directory
- All patches are readable and parseable as unified diffs
- All patches exist at specified paths
- All patches are referenced by the series file
- No duplicate patches in the series
- No unused patches in the directory
check_files_exist.py
Quick validation that files in a list exist in the source tree.The directory to check files from
One or more file lists to validate
Platform Patches
update_platform_patches.py
Merge ungoogled-chromium patches with platform-specific patches.merge - Prepend ungoogled-chromium patches to platform patches
unmerge - Undo the merge and preserve changes
unmerge - Undo the merge and preserve changes
Path to platform patches in GNU Quilt format
Merge workflow
Merge workflow
When merging:
- Creates
series.origbackup of platform series - Copies ungoogled-chromium series to
series.prepend - Merges patches and creates
series.merged - Prepends ungoogled-chromium patches to platform patches
- Moves prepended patches back to original location
- Applies changes from
series.mergedto original series - Preserves comments and inline annotations
- Removes intermediate files
List Management
update_lists.py
Automatically update binary pruning and domain substitution lists.Path to the source tree to analyze
Output path for pruning.list
Output path for domain_substitution.list
Path to domain_regex.list patterns
Maximum worker processes (defaults to CPU count)
Additional exclusion prefix (can be specified multiple times)
Don’t treat unused patterns as errors
How it determines files
How it determines files
Binary Pruning:
- Matches against include patterns (higher priority)
- Matches against exclude patterns
- Performs binary data detection on remaining files
- Excludes safe file extensions (.png, .jpg, .txt, etc.)
- Matches files against include patterns (*.cc, *.h, *.py, etc.)
- Excludes paths by prefix (test directories, licenses)
- Searches file contents for domain patterns
- Only includes files with actual domain matches
Code Quality
Pylint Scripts
Run pylint checks on different parts of the codebase.Exit Codes
All validation scripts follow a consistent exit code pattern:No problems detected - all validation checks passed
Warnings or errors occurred during validation
Common Workflows
Pre-commit validation
Pre-commit validation
Update lists after Chromium version bump
Update lists after Chromium version bump
Platform-specific patch workflow
Platform-specific patch workflow
See Also
Build Utilities
Core build utilities for patches, domain substitution, and binary pruning
Validation Tools
Testing and validation utilities for ensuring build integrity