Commit Graph

34824 Commits

Author SHA1 Message Date
Treehugger Robot
3985e1e498 Merge "Remove .rustc ELF section from mini-debug-info." am: c29088b727
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647201

Change-Id: I8cdfde552f2cfcddaebafb80ad896e16af3a8fe7
2021-03-23 11:31:08 +00:00
Treehugger Robot
c29088b727 Merge "Remove .rustc ELF section from mini-debug-info." 2021-03-23 09:13:53 +00:00
Paul Duffin
f84f035e13 Merge "Add preparer for overlay pre-singleton registration" am: e0998ab561
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649792

Change-Id: I19a6efbaa18fe0706f6bce0bb4df999fc30b2db2
2021-03-23 08:53:38 +00:00
Paul Duffin
afe10ea7c8 Merge "Add TestingModule.VariablesForTestsRelativeToTop" am: 010bb3c5b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649791

Change-Id: I8839b3fa45ad01298a4fcc47772a0d238d32832d
2021-03-23 08:53:29 +00:00
Paul Duffin
bbf40a9615 Merge "Add TestingBuildParams.RelativeToTop()" am: a327008e65
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649790

Change-Id: I0d44beca7fef7e5545dc79d4363784cab7334a70
2021-03-23 08:52:35 +00:00
Paul Duffin
30cb19daa5 Merge "Improve searching for TestingBuildParams using the output file" am: 332310aac4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649789

Change-Id: I7c58a078323e2dbe59adc2d92937b06dfadc660c
2021-03-23 08:48:43 +00:00
Paul Duffin
9001af1efa Merge "Move helper methods that take testBuildProvider into baseTestingComponent" am: b09a2d6af4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649788

Change-Id: I9e3bccc819ef7377a7951e58c2514f39e9157149
2021-03-23 08:43:43 +00:00
Paul Duffin
7ef69a5c09 Merge "Extract functionality common to TestingModule/Singleton" am: 48c21e6454
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649787

Change-Id: Ia31d49127da3650ba48550aef017c059488e92aa
2021-03-23 08:42:23 +00:00
Paul Duffin
e0998ab561 Merge "Add preparer for overlay pre-singleton registration" 2021-03-23 07:21:30 +00:00
Paul Duffin
010bb3c5b3 Merge "Add TestingModule.VariablesForTestsRelativeToTop" 2021-03-23 07:21:01 +00:00
Paul Duffin
a327008e65 Merge "Add TestingBuildParams.RelativeToTop()" 2021-03-23 07:20:33 +00:00
Paul Duffin
332310aac4 Merge "Improve searching for TestingBuildParams using the output file" 2021-03-23 07:20:04 +00:00
Paul Duffin
b09a2d6af4 Merge "Move helper methods that take testBuildProvider into baseTestingComponent" 2021-03-23 07:19:42 +00:00
Paul Duffin
48c21e6454 Merge "Extract functionality common to TestingModule/Singleton" 2021-03-23 07:19:13 +00:00
Treehugger Robot
7568c9f17c Merge "Fix PackagingBase.CopyDepsToZip" am: 9b6108f8de
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1624459

Change-Id: I7070c1e08a1127d8dcd1b717cddaef42df9443b0
2021-03-23 04:28:51 +00:00
Treehugger Robot
8c8a93f231 Merge "Fix default value of BoardSepolicyVers" am: 04a2693407
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1648191

Change-Id: Ia8e5b4ccaa9aafd928579303ca37dd2f31928c92
2021-03-23 04:27:38 +00:00
Treehugger Robot
9b6108f8de Merge "Fix PackagingBase.CopyDepsToZip" 2021-03-23 04:21:38 +00:00
Treehugger Robot
04a2693407 Merge "Fix default value of BoardSepolicyVers" 2021-03-23 03:53:18 +00:00
Paul Duffin
2863cd8ae6 Convert boot_image_sdk_test.go to fixtures am: 4a1d451405
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645679

Change-Id: Ib0c44f2606238f9e438bfbeeda9a9929c87cd7bf
2021-03-22 23:01:38 +00:00
Paul Duffin
33972970ea Allow sdk package tests to optimize their test setup am: cf3ee2f87e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645676

Change-Id: I16d55dbb80f577dd1f3b7a513eb5c12ae8a8dea6
2021-03-22 23:01:30 +00:00
Paul Duffin
6006e869d8 Use test fixtures in CheckSnapshot() am: c93c98e315
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647191

Change-Id: I23a650f9689b41ad6fb060c0a4d8c8562f8a7134
2021-03-22 23:00:51 +00:00
Paul Duffin
752a5a2122 Remove emptyFixtureFactory from apex and java am: 70d3bee3e0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647204

Change-Id: Id4b06bc9a16911949bdf234eee4e9e9b349b7fb6
2021-03-22 22:56:41 +00:00
Paul Duffin
7047fd751a Remove usages of FixtureFactory from misc packages am: 89648f98fa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647196

Change-Id: Ic61df38c546597adb0590252bed4cf7ee380c5ef
2021-03-22 22:49:45 +00:00
Paul Duffin
bfdf693d99 Remove uses of FixtureFactory from android package am: 30ac3e7ca7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647195

Change-Id: Ib44f15787d5db62637f58e5baa1774606dc55fec
2021-03-22 22:45:41 +00:00
Paul Duffin
120cdd5ddf Deprecate FixtureFactory in favor of FixturePreparer am: ff2aa69a86
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647194

Change-Id: I13ee92cf31456da4292debdfdd4925e3f4c6c894
2021-03-22 22:38:15 +00:00
Paul Duffin
42da69d784 Add preparer for overlay pre-singleton registration
It appears as though this is the first pre-singleton type to actually
be registered with the InitRegistrationContext as it failed due to an
uninitialized map, so this change also fixes that.

Bug: 182885307
Test: m nothing
Change-Id: Ibbf6d0db5f3c2fcc89291a16aa5f16b8b5009bd3
2021-03-22 22:09:53 +00:00
Paul Duffin
97d8b40fec Add TestingModule.VariablesForTestsRelativeToTop
Bug: 182885307
Test: m nothing
Change-Id: Id1265b07533f226965555e703fb9fa81aea4ec91
2021-03-22 22:09:53 +00:00
Paul Duffin
709e0e32c2 Add TestingBuildParams.RelativeToTop()
The methods returns a copy of TestingBuildParams with every usage of a
path that is relative to the temporary test build directory with a path
relative to a notional top. Similar to how PathRelativeToTop does.

Bug: 182885307
Test: m nothing
Change-Id: I6ec20fc52ed76748138f0d48b4df80f765dfcfdc
2021-03-22 22:09:53 +00:00
Paul Duffin
4e6e35c561 Improve searching for TestingBuildParams using the output file
When searching for an TestingBuildParams this change will compare the
supplied path against the value returned by PathRelativeToTop() as well
as the String() and Rel() values. In the event that it cannot find the
file it also formats the available outputs, one per line with both rel
and path relative to top.

Bug: 182885307
Test: m nothing
Change-Id: Icbd37018b9a028abf37e27d1bea12a407316e031
2021-03-22 22:09:53 +00:00
Paul Duffin
0eda26b96b Move helper methods that take testBuildProvider into baseTestingComponent
Allows the removal of the provider parameter and makes it easier to add
new functionality to baseTestingComponent.

Bug: 182885307
Test: m nothing
Change-Id: Ie8ac600cbce982f2c5fc24a22968efe0c2a29d0c
2021-03-22 22:09:53 +00:00
Paul Duffin
31a228846b Extract functionality common to TestingModule/Singleton
Bug: 182885307
Test: m nothing
Change-Id: Ib7c96b34512ad2a190a24c9dd07ea259d1378b44
2021-03-22 22:09:53 +00:00
Paul Duffin
a49442d0d0 Replace FixturePreparer.visit() with list() am: 4ca6752b21
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647193

Change-Id: Ic0b097e834c94c879645d88fb43ff857336ed3ec
2021-03-22 19:29:16 +00:00
Paul Duffin
2e831d6ae6 Remove errorHandler from FixtureFactory am: cff464f794
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647192

Change-Id: If8cacd24e66108952219597026c0391b660bc3e9
2021-03-22 19:29:08 +00:00
Paul Duffin
559c073415 Allow access to preparers that produced a TestResult am: 592518290f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645675

Change-Id: I7bde6493e80db34631ddac77b6405d5034d36886
2021-03-22 19:28:24 +00:00
Paul Duffin
abe8504ce1 Merge "Ensure that DepIsInSameApex is not called for ExcludeFromApexContentsTag" am: 6bef6fee3c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645680

Change-Id: I2131e494bab389c13499b923618bf62235cb99e9
2021-03-22 19:20:17 +00:00
Paul Duffin
4a1d451405 Convert boot_image_sdk_test.go to fixtures
Bug: 182638834
Test: m nothing
Change-Id: I8c9cb399b15d04ec8465a3b3bb4b43561aef46fd
2021-03-22 19:13:22 +00:00
Pirama Arumuga Nainar
042fce9dfd Merge "Switch to clang r416183 12.0.4." am: 679d5308ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1640559

Change-Id: Ic2dce17dec076c412af4b43484dae7239456d533
2021-03-22 19:13:04 +00:00
Paul Duffin
cf3ee2f87e Allow sdk package tests to optimize their test setup
Extracts the setup for apex from prepareForSdkTest to allow it to be
reused without using all of it. That will allow tests to optimize their
test setup.

Bug: 182638834
Test: m nothing
Change-Id: I2056103b15c2737a616ee29ff890c6af0722e6d2
2021-03-22 18:31:53 +00:00
Paul Duffin
c93c98e315 Use test fixtures in CheckSnapshot()
Using the preparer(s) that were used to run the test to verify the
integrity of the generated snapshot ensures that it will be verified in
the same environment as the snapshot was generated. This ensures that
as sdk tests are migrated to use fixtures that are optimized for each
test that they will benefit from those optimizations when checking the
snapshot.

Bug: 183184375
Test: m nothing
Change-Id: I62b383f9a1d9a77d1cabb101d9d1e4a976170fe3
2021-03-22 18:31:53 +00:00
Paul Duffin
70d3bee3e0 Remove emptyFixtureFactory from apex and java
Bug: 183235980
Test: m nothing
Change-Id: I350b45e2f57430fb158f4141a566e75de17208cd
2021-03-22 18:31:53 +00:00
Paul Duffin
89648f98fa Remove usages of FixtureFactory from misc packages
These packages have already been migrated to use per test build
directory so have no need for a FixtureFactory.

Bug: 183235980
Test: m nothing
Change-Id: I667d1d992caaf0f615de91f89efdae11c44986c2
2021-03-22 18:31:53 +00:00
Paul Duffin
30ac3e7ca7 Remove uses of FixtureFactory from android package
Bug: 183235980
Test: m nothing
Change-Id: I72898ada020ee1a73fd534c61afb5c22fa00c1e5
2021-03-22 18:31:53 +00:00
Paul Duffin
ff2aa69a86 Deprecate FixtureFactory in favor of FixturePreparer
Prior to this FixtureFactory was basically a FixturePreparer with the
additional support for buildDirSupplier. This makes that a reality by
moving the functionality of FixtureFactory into FixturePreparer and
making FixtureFactory extend that with buildDirSupplier.

This also deprecates the Extend() method in favour of simply using the
GroupFixturePreparers() method.

Once all usages of buildDir have been removed so the buildDirSupplier
is no longer required then FixtureFactory will be removed altogether.
In the meantime follow up changes will migrate those tests that do not
require a buildDirSupplier to just use FixturePreparers in preparation
for the eventual removal of FixtureFactory.

Bug: 183235980
Test: m nothing
Change-Id: Ibb4e5bfec2f76ee34dd7de6aed6bbbfe27d337b8
2021-03-22 18:31:53 +00:00
Paul Duffin
4ca6752b21 Replace FixturePreparer.visit() with list()
The visit() method was dropped in favor of a list() method as the
latter makes it easier to treat fixtureFactory, simpleFixturePreparer
and compositeFixturePreparer as simple collections of already flattened
and deduped *simpleFixturePreparers. That will be used in a follow up
change.

Bug: 183235980
Test: m nothing
Change-Id: Ia41ae9bd4f9c39c85865ba698e0da6be00519caf
2021-03-22 18:31:53 +00:00
Paul Duffin
cff464f794 Remove errorHandler from FixtureFactory
The ExtendWithErrorHandler method simply wraps the FixtureErrorHandler
in a FixturePreparer that will set the error handler in the fixture.

Bug: 183235980
Test: m nothing

Change-Id: Icf9a5f62cb532efc120300c2f906cd3397aa6763
2021-03-22 18:31:53 +00:00
Paul Duffin
592518290f Allow access to preparers that produced a TestResult
The Preparer() method allows for another test to be run using the same
preparers as were used to create the TestResult. That is useful when
testing functionality like the sdk snapshot mechanism that generates an
Android.bp and a set of files that are intended to be reconsumed by
Soong. This method allows the test to process that output to ensure
that it is valid. A follow up change will migrate the CheckSnapshot()
method to use this as part of the migration of the sdk package to the
test fixture model.

Previously, the dedupAndFlattenPreparers() would not construct a list
containing all the preparers passed to it as it was trying to avoid
constructing such a list unless necessary. However, as every usage of
this method now needs to construct such a list that functionality has
been added to it.

Bug: 181070625
Test: m nothing
Change-Id: Iab34e2c861bdfd05c44e982224f70c5abc19e468
2021-03-22 18:31:53 +00:00
Paul Duffin
6bef6fee3c Merge "Ensure that DepIsInSameApex is not called for ExcludeFromApexContentsTag" 2021-03-22 18:30:10 +00:00
Pirama Arumuga Nainar
679d5308ec Merge "Switch to clang r416183 12.0.4." 2021-03-22 16:26:13 +00:00
Inseob Kim
0c4eec85fa Fix default value of BoardSepolicyVers
PlatformSepolicyVersion and BoardSepolicyVers haven't assigned correctly
so far. Below is the reason why it hasn't been discovered yet.

DeviceConfig.PlatformSepolicyVersion() was added to support mixed
sepolicy build (setting BOARD_SEPOLICY_VERS and building vendor sepolicy
with old plat policy files). Soong compares PlatformSepolicyVersion()
and BoardSepolicyVers(), and used old vendor sources if both are
different. Back then, the only place where such logic played a role was
selinux contexts. Test codes were running as intended: after setting
BOARD_SEPOLICY_VERS the context files were built against old policies.

But there were two mistakes:

1) PlatformSepolicyVersion() was not added to soong_config.mk, so it was
always empty.
2) BOARD_SEPOLICY_VERS was set to default in system/sepolicy/Android.mk,
which was processed after soong_config. So if BOARD_SEPOLICY_VERS was
not set in BoardConfig.mk, BoardSepolicyVers() was empty, not
PLATFORM_SEPOLICY_VERSION.

And there were no issues as Soong only checked equality.

To fix the issue correctly, this commit adds the variable
PlatformSepolicyVersion, and then handles BoardSepolicyVers correctly by
returning PlatformSepolicyVersion if it's empty.

Test: set BOARD_SEPOLICY_VERS and see vendor_file_contexts changes
Change-Id: Ie55827f47d2903e9739eccacc3874d354d5c9f2d
2021-03-22 22:34:56 +09:00
satayev
0ee372ad6f Merge changes from topic "move_allowed_deps_txt" am: 2b077baa5e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645088

Change-Id: Ib8cabdd7d263b1fdea60759a6ce7696e7949aa7b
2021-03-22 11:23:00 +00:00