Build asset generation
Build asset generation prepares the files that give the final Helium browser its selected visual resources and its intended source footprint. It creates scaled assets, maps them into Chromium resource paths, and removes source files that do not belong in the build inputs. This work sits between source preparation and compilation. See Build configuration and downloads and Download and dependency management for related system context.
Build asset pipeline
The asset pipeline turns checked-in Helium resources into files at the locations that Chromium's build rules already expect. Binary pruning runs beside this flow so the compiler receives both the selected resources and the reduced source tree.
The diagram shows how source artwork and cleanup rules shape the source tree used by the browser build.
flowchart LR
A[Helium artwork] --> B[Generation manifest]
B --> C[Scaled assets]
A --> D[Replacement manifest]
C --> D
D --> E[Chromium resource paths]
F[Pruning list] --> G[Source cleanup]
E --> H[Final browser build inputs]
G --> H
Generated resource set
The generated resource set supplies size-specific files from one source application icon. The generation manifest defines the sizes and output names so each build can recreate the same icon set instead of storing every derived file as independent source artwork (resources/generate_resources.txt• L1-8).
The generation utility reads that manifest and writes the scaled images under the resource directory. It preserves the source image's alpha channel and creates the output directories when needed. The generated files are inputs to the replacement stage rather than direct Chromium destinations (utils/generate_resources.py• L17-29, utils/generate_resources.py• L32-59).
References: resources/generate_resources.txt• L1-8 utils/generate_resources.py• L17-29 utils/generate_resources.py• L32-59
Replacement resource set
The replacement resource set places Helium artwork into Chromium's existing resource slots. The replacement manifest maps source assets to destinations across browser pages, product marks, display densities, and platform-specific paths (resources/helium_resources.txt• L1-70).
The replacement utility applies those mappings to the prepared Chromium source tree. This keeps the source artwork in one place while allowing the final build to consume the names and paths required by Chromium's resource rules (utils/replace_resources.py• L15-35).
References: resources/helium_resources.txt• L1-70 utils/replace_resources.py• L15-35
Manifest roles
The resource manifests describe two different edges in the asset flow. The first creates reusable files. The second selects where those files, together with source branding and favicons, appear in the browser build.
| Manifest | Role in the build |
|---|---|
| resources/generate_resources.txt | Selects derived icon sizes and their generated resource paths. |
| resources/helium_resources.txt | Selects the Chromium destinations for source and generated Helium assets. |
pruning.list | Selects source files that must be absent from the prepared source tree. |
The manifests are contracts between preparation tools and later build rules. A generated file must exist before the replacement manifest refers to it. A replacement destination must remain valid in the Chromium revision used by the build.
References: resources/generate_resources.txt• L1-8 resources/helium_resources.txt• L1-70 pruning.list• L1-19 utils/generate_resources.py• L32-59 utils/replace_resources.py• L15-35
Binary pruning
Binary pruning reduces the source tree before compilation by removing selected binary files and data. It targets files that are not needed for the distributed browser or that would add unwanted build inputs, while leaving the source metadata needed to describe the remaining tree.
Explicit source removals
The checked-in pruning.list records source-relative paths that the pruning stage removes. The list covers test data, packaged binary samples, generated data, and other binary resources that do not need to reach the browser. Its entries track the pinned Chromium source, including additions and path moves that arrive with a source revision update (pruning.list#L1-L19, pruning.list#L52-L70).
The pruning utility treats a missing listed path as an error. This protects the list as a statement about the expected source revision rather than silently accepting a stale or misspelled entry (utils/prune_binaries.py• L165-184, utils/prune_binaries.py• L234-250).
References: pruning.list• L1-19 pruning.list• L52-70 utils/prune_binaries.py• L165-184 utils/prune_binaries.py• L234-250
Conditional source paths
Some source directories exist only in certain Chromium checkout modes or when external tooling has supplied them. The pruning stage handles these contingent paths separately so the same cleanup policy can work with different source archive shapes. This set includes tool directories such as third_party/llvm-libclang/, which is treated as a contingent path (utils/prune_binaries.py• L18-152).
The build can keep these paths when a downstream workflow needs the full Google tooling or a selected sysroot. Otherwise, the stage removes them along with empty directories. A small set of build metadata files remains protected because later source processing still needs it (utils/prune_binaries.py• L154-162, utils/prune_binaries.py• L187-231).
The command supports two exceptions to normal contingent-path cleanup. --keep-contingent-paths preserves the full contingent set. --sysroot preserves the selected amd64 or i386 sysroot while other contingent paths remain eligible for removal (utils/prune_binaries.py• L212-231, utils/prune_binaries.py• L253-265).
References: utils/prune_binaries.py• L18-162 utils/prune_binaries.py• L187-231 utils/prune_binaries.py• L253-265
Build graph alignment
Removing binary inputs can expose build rules that still refer to tests, fixtures, or optional services. The build patch for pruned binaries removes such data dependencies and disables selected targets so the build graph matches the reduced source tree (patches/ungoogled-chromium/fix-building-with-prunned-binaries.patch#L1-L3, patches/ungoogled-chromium/fix-building-with-prunned-binaries.patch#L25-L44, patches/ungoogled-chromium/fix-building-with-prunned-binaries.patch#L146-L155).
This alignment is part of the same source-preparation goal. The list controls which files are present. The related build changes control whether remaining build rules still require those files.
References: patches/…/fix-building-with-prunned-binaries.patch• L1-3 patches/…/fix-building-with-prunned-binaries.patch• L25-44 patches/…/fix-building-with-prunned-binaries.patch• L146-155
Source list validation
Source list validation checks that cleanup rules still describe the pinned Chromium source. The list generator scans the source tree and derives a sorted pruning result, including linked paths that point to files selected for removal (devutils/update_lists.py• L322-364).
Continuous integration writes generated lists beside the checked-in lists and compares them. This catches source-revision changes, stale entries, and missing entries before the transformed source tree becomes a build input (.github/…/ci.yml• L104-139).
Build-tree handoff
The handoff produces a source tree with the requested Chromium resources installed and the selected binary inputs removed. The browser build then consumes that tree together with the upstream source and downloaded dependencies prepared earlier in the pipeline (.github/…/ci.yml• L94-99).
The order is significant:
- Prepare the pinned Chromium source and its downloaded dependencies.
- Generate derived Helium resources.
- Apply the resource mappings to Chromium paths.
- Apply source cleanup and binary pruning.
- Compile and package the resulting browser inputs.
References: devutils/update_lists.py• L322-364 .github/…/ci.yml• L94-139 utils/generate_resources.py• L62-74 utils/replace_resources.py• L38-51 utils/prune_binaries.py• L234-250
Change checklist
When these files or sections are changed, remember to consider these:
- When a generated icon size or output path changes, update the matching generated-resource entry in resources/helium_resources.txt.
- When a replacement destination changes, check that the target path exists in the pinned Chromium source and that its density or platform peer paths still receive the intended asset.
- When a source artwork file changes name or location, update both the manifest that reads it and any generated output that depends on it.
- When a pruning entry changes, regenerate the source list against the pinned Chromium tree and check build rules that may still reference the removed file.
- When contingent-path or sysroot handling changes, preserve the different source layouts used by archive, clone, and full-tooling workflows. Review both
--keep-contingent-pathsand--sysrootbehavior. - When the Chromium revision changes, compare both resource destinations and generated pruning lists because upstream path and binary changes can invalidate the preparation contracts.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A generated resource is not created before replacement | The replacement stage cannot install the referenced asset and the build may miss a logo or icon | Run generation from resources/generate_resources.txt before applying resources/helium_resources.txt |
| A manifest destination no longer exists in Chromium | A copy fails or one browser surface keeps an upstream resource | Validate manifest paths against the pinned source tree after a Chromium update |
pruning.list contains a path absent from the source tree | Pruning stops and the source is not accepted as complete | Regenerate and compare the list for the exact Chromium source revision |
| Pruning removes data still named by a build target | Compilation fails because the build graph requests a missing input | Update the related build dependency or target disablement with the pruning change |
A contingent path such as third_party/llvm-libclang/ is pruned in a workflow that needs it | Tooling or a selected sysroot is unavailable to the build | Use --keep-contingent-paths or the matching --sysroot exemption for that workflow |
| Generated and checked-in source lists differ | CI rejects the source preparation contract | Recompute the lists and review each change before updating the checked-in list |
Key files
| File | Why to read it |
|---|---|
| resources/generate_resources.txt | Defines the derived icon files that must exist before replacement. |
| resources/helium_resources.txt | Defines where Helium source and generated assets enter Chromium. |
| utils/generate_resources.py | Defines the generation stage and its input/output boundary. |
| utils/replace_resources.py | Defines the stage that installs selected resources into the Chromium tree. |
pruning.list | Defines the explicit binary and data removals for the pinned source. |
| utils/prune_binaries.py | Defines explicit pruning, contingent-path handling, protected metadata, and workflow-specific keep options. |
| devutils/update_lists.py | Defines how source-tree contents become generated cleanup lists. |
patches/ungoogled-chromium/fix-building-with-prunned-binaries.patch | Shows how build dependencies are aligned with removed binary inputs. |
| .github/…/ci.yml | Shows source unpacking and source-list validation around the preparation flow. |