Commit graph

8 commits

Author SHA1 Message Date
Justin Yun
07b9f86f0c Define getSnapshotNameSuffix()
By sharing a single function for generating snapshot name suffix,
make sure both the DepsMutator and the snapshot modules use the same
names.

Bug: 179666286
Test: m nothing
Change-Id: I9efa94f2981a6bd1b4128bf0e84ca44873ebf3b7
2021-02-26 14:00:03 +09:00
Justin Yun
4813867ec3 Remove dependency from vendor_snapshot to each module
The 'vendor_snapshot' module is required to every cc_library to check
if the dependencies need to be rewritten to the snapshot modules or
not. However, as the 'vendor_snapshot' module has dependencies to the
snapshot modules, the dependency to the 'vendor_snapshot' module
creates circular dependencies.
The dependency from the 'vendor_snapshot' to the snapshot modules is
required only to read the module names of the snapshot modules. We
may remove the dependency by setting the name of the snapshot modules
directly.

Bug: 179666286
Test: m nothing
Change-Id: I14abcb06c5c81ef7f8535103578747385c89ae0f
2021-02-25 09:31:12 +00:00
Jose Galmes
4c6895e5a3 Implement directed recovery snapshot.
Bug: 177451657
Test: m -j nothing
Change-Id: I0b84c34fb2e9e9340d9f9e7405428cd2cc4d43b5
2021-02-09 08:25:34 -08:00
Jose Galmes
0a942a0368 Generate fake versions of modules excluded in directed vendor snapshot.
When using the directed vendor snapshot, the build fails because soong
fails to find some variants of the modules that have been excluded
from VENDOR_SNAPSHOT_MODULES, even though those modules are not going
to be used by the build.

The solution implemented here is to generate fake versions of those
modules (empty files) and include them in the generated Android.bp,
so that soong finds the modules, even though trying to use them would
fail.

Bug: 171821997
Bug: 179275601

Test: source build/envsetup.sh
Test: m -j nothing

Change-Id: Ibd3e963ab3e5504c0ac817f7cabbd241bf47a5cb
2021-02-05 17:53:53 +00:00
Colin Cross
a889080aba Remove global state on module suffixes from vendor and recovery snapshots
Propgate the Android.mk suffix from source modules into the snapshot so
that it can be used for the prebuilt modules.

Bug: 177098205
Test: vendor_snapshot_test.go
Change-Id: Iea151dc91395f714fbcad1df3a6fd0874e5455d9
2021-02-01 20:06:29 +09:00
Colin Cross
e0edaf9d49 Remove some global state from vendor and recovery snapshots
Snapshots storead global sets of modules that should be replaced with
vendor snapshot modules.  Move the data instead to a vendor_snapshot
or recovery_snapshot module type that depends on all the modules in
the snapshot, and then have modules that should use the snaphsot
depend on it to query for the set of modules that should be replaced.

Bug: 177098205
Test: vendor_snapshot_test.go
Change-Id: I2826adacfb473e9139b5ea93ba83b8a54cc1a56b
2021-02-01 20:02:39 +09:00
Colin Cross
2e577f3657 Add vendor_available coverage to TestVendorSnapshotUse
Test that the correct suffix is added to the Make references to a
vendor_available library in a vendor snapshot.

Bug: 177098205
Test: vendor_snapshot_test.go
Change-Id: I0c9b81d63798e221db856fa0e4742a467c356fcb
2021-01-22 17:42:31 -08:00
Colin Cross
0fce0bab12 Move vendor snapshot tests into vendor_snapshot_test.go
Move the vendor snapshot tests into vendor_snapshot_test.go to
reduce the size of cc_test.go

Bug: 177098205
Test: go test ./build/soong/cc/...
Change-Id: Ib1120f986fc0111a9487fce00539a4c5ae7e2e87
2021-01-22 17:42:28 -08:00