Pak symbols are those with a section of:
.pak.nontranslated(entries inresources.pak,chrome_100_percent.pak).pak.translations(entries inen_US.pak,fr.pak, etc)- There is one symbols for each GRIT ID. The size of the symbol is the sum of
the size of all pak entries with that ID across all
.pakfiles.
During builds:
- Grit records the originating
.grdfile, textual ID, and numeric ID for each entry that it processes during agrit()step into a.pak.infofile. - These
.pak.infofiles are merged duringrepackand APK / App Bundle steps into a single$output_dir/size-info/Foo.apk.pak.info.
During supersize archive:
- When native symbols are created using
linker_mapmode, a map ofpak_id->source_pathis created by looking for symbols namedui::AllowlistedResource<$PAK_ID>(). - Pak files are extracted and turned into dicts using grit.
- The size of each pak entry is summed with other entries of the same ID.
- Symbol aliases are created for pak entries with different IDs, but that
refer to the same data (the
.pakfile format supports this). - Entry names ("textual IDs"), and the original
.grdfile paths are stored in thefull_nameof each symbol by using the information in the$outdir/size-info/Foo.pak.infofile. - Path information is added to the symbols using the map from Step 1.