Commit Graph

5 Commits

Author SHA1 Message Date
Cole Faust
baae083e60 Compress precompiled python zips
When making this script deterministic we accidentally changed it so that
none of the entries in the output zip file were compressed. Re-add
the compression.

Adding the compression makes atest go from 67M to 34M, at the cost of
0.33s startup time instead of 0.28s.

Test: Presubmits
Change-Id: I4e58eb76235ddabf0195694cdd3644f26b7e84ec
2024-04-29 16:47:36 -07:00
Cole Faust
5a8f533a29 Improve errors when compiling python code
Now a stacktrace involving precompile_python.py won't be shown,
and it will show all errors instead of just the first one.

Bug: 331488610
Test: Presubmits
Change-Id: I47376ca6764c0f84d1aaf5db329664e20143640a
2024-03-28 17:31:21 -07:00
Anas Sulaiman
c755fdbe8e Fix non-deterministic python compilation
This CL fixes timestamps for zip entries to a hardcoded value to ensure
deterministic zip archives across checkouts, not just for incremental builds.
The value chosen for the fixed date is the same as the one used by soong_zip.

Bug: b/322788229
Test: Ran a few builds and verified that mdate for zipped files are
fixed as well as the generated zip files have identical hashes.

Change-Id: I3cd6fcf559d4d83d8813c93319b46e267ae64a2b
2024-02-07 21:57:41 +00:00
Anas Sulaiman
55b7ba0645 Fix non-deterministic python compilation
Timestamps in pyc files and zip archives were causing cache misses in RBE.

Bug: b/322788229
Test: Ran a few local builds and verified improved cache hit rate for metalava actions.
Change-Id: I9375694d26a107f5c0c43bbd685bd8e86349d187
2024-02-01 19:41:31 +00:00
Cole Faust
5c503d1c43 Precompile python sources
This signifigantly improves the startup time of soong-built
python binaries. For example, running
`m apexer && time out/host/linux-x86/bin/apexer` gives
0.734s before this cl, and 0.094s after.

Fixes: 259718110
Test: Presubmits
Change-Id: Ib19e83e2c60c39a849525be117279c318de3afa7
2023-01-27 15:43:38 -08:00