Commit graph

34684 commits

Author SHA1 Message Date
Paul Duffin
f49f72f271 Merge "Add preparers for python" 2021-03-18 08:28:35 +00:00
Paul Duffin
0a00e2680d Merge "Fix hole in python testing code that ignored a broken test" 2021-03-18 08:28:10 +00:00
Paul Duffin
1efdb30182 Remove javaMockFS()
Also, removes the workaround that allowed preparers to override files
added in javaMockFS().

The performance of the java tests was determined by running:
  m nothing
  rm -fr out/soong/.bootstrap/soong-java/test/
  time m nothing

Prior to starting this work that returned:
  real  1m30.060s
  user  33m3.028s
  sys   13m25.413s

Immediately prior to this change that returned:
  real  1m2.777s
  user  14m14.352s
  sys   9m40.745s

After applying this change that returned:
  real  0m20.282s
  user  3m7.429s
  sys   0m43.601s

So, this reduced the real time cost of running the java tests from 90
seconds to 20 seconds.

Bug: 182638834
Test: m nothing
Change-Id: I30490fd40ddb0684a5a4975ce1811bab5dc79e4e
2021-03-18 08:02:38 +00:00
Paul Duffin
3d9f268437 Fix TestTurbine to work without javaMockFS()
Bug: 182638834
Test: m nothing
Change-Id: Idf400b5f0d171a504acf006425cbfc514b391e74
2021-03-18 08:02:38 +00:00
Paul Duffin
57c4d79c00 Fix testDexpreoptBoot to work without javaMockFS()
Bug: 182638834
Test: m nothing
Change-Id: I1725d6ce7e1201d8d77e95d3cebb7d8cc882d437
2021-03-18 08:02:38 +00:00
Paul Duffin
171de3ef7c Fix TestClasspath to work without javaMockFS()
Bug: 182638834
Test: m nothing
Change-Id: Icd6fe93cbda418cb4eaf5e99800894d4c4cc5e6f
2021-03-18 08:02:38 +00:00
Paul Duffin
76101fa5ec Convert TestClasspath to test fixtures
The main complication with this change was that many of the tests check
paths that are provided by the default java modules. The location of
them is different in the test fixtures that it is when using
testConfig() and so the test needed to be changed.

Bug: 182638834
Test: m nothing
Change-Id: I6d325dbd3ba39e5de7e53c576d7cfe07bd95a965
2021-03-18 08:02:38 +00:00
Paul Duffin
e26e597fc8 Merge "Fix app tests to work without javaMockFS()" 2021-03-18 08:00:29 +00:00
Paul Duffin
9e993c6162 Merge "Convert app tests that depend on javaMockFS() to test fixtures" 2021-03-18 07:59:54 +00:00
Paul Duffin
8a6fef4db3 Merge "Convert TestUsesLibraries to test fixtures" 2021-03-18 07:59:04 +00:00
Jingwen Chen
6648045f00 bp2build: genrule converter only supports "genrule".
This excludes the bp2build mutator from running for cc_genrule or
java_genrule, which may require alternative implementations.

Test: bp2build; bazel build //bionic/...
Change-Id: Ie14dd6dfa5e806fd6ac6e8f9989356f3880c79bf
2021-03-18 03:41:55 -04:00
Lukács T. Berki
828b1e99ec Merge "Fix writing soong.variables ." 2021-03-18 07:36:53 +00:00
Paul Duffin
abbf63d650 Migrate sdk package to a per test build directory
Bug: 182885307
Test: m nothing
Change-Id: I051f2572ce5e94e2a3a66cf7663797178b7d1506
2021-03-18 01:48:25 +00:00
Paul Duffin
ec74f81b49 Convert xml package to fixtures
Bug: 182885307
Test: m nothing
Change-Id: I9aad3e4e6dbec9c25e8a0aeaf8e0ec1d82e39400
2021-03-18 01:43:50 +00:00
Paul Duffin
94b6960b39 Add preparers for xml
Bug: 181070625
Test: m nothing
Change-Id: I150889a025e1c23eebe1e2764b07fdbd2babef49
2021-03-18 01:43:50 +00:00
Tri Vo
7af79fb49b Remove "-C link-dead-code=y" flag
sysroot no longer builds with this flag.

LLVM ERROR: Cannot select: 0x7f7c39be9b48: v8i8 = AArch64ISD::VSLI 0x7f7c39696120, 0x7f7c39693fc8, 0x7f7c39d86528, prebuilts/rust/linux-x86/1.50.0/src/stdlibs/library/core/src/../../stdarch/crates/core_arch/src/aarch64/neon/mod.rs:2324:5
  0x7f7c39696120: v8i8,ch = CopyFromReg 0x7f7c420b1c98, Register:v8i8 %13, prebuilts/rust/linux-x86/1.50.0/src/stdlibs/library/core/src/../../stdarch/crates/core_arch/src/aarch64/neon/mod.rs:2324:5
    0x7f7c39be90e8: v8i8 = Register %13
  0x7f7c39693fc8: v8i8,ch = load<(dereferenceable load 8 from %ir.b)> 0x7f7c420b1c98, 0x7f7c39694510, undef:i64, prebuilts/rust/linux-x86/1.50.0/src/stdlibs/library/core/src/../../stdarch/crates/core_arch/src/aarch64/neon/mod.rs:2324:19
    0x7f7c39694510: i64,ch = CopyFromReg 0x7f7c420b1c98, Register:i64 %17, prebuilts/rust/linux-x86/1.50.0/src/stdlibs/library/core/src/../../stdarch/crates/core_arch/src/aarch64/neon/mod.rs:2324:19
      0x7f7c39be52d8: i64 = Register %17
    0x7f7c39bea230: i64 = undef
  0x7f7c39d86528: i32,ch = CopyFromReg 0x7f7c420b1c98, Register:i32 %18, prebuilts/rust/linux-x86/1.50.0/src/stdlibs/library/core/src/../../stdarch/crates/core_arch/src/aarch64/neon/mod.rs:2324:5
    0x7f7c39be5ea0: i32 = Register %18
In function: _RNvNtNtNtCsfOHkQPwunBC_4core9core_arch7aarch644neon9vsli_n_s8B7_
11:40:52 ninja failed with: exit status 1

Bug: 147140513
Test: build/run local rust_fuzz executable with asan+sancov.
Change-Id: I00c81f25f562bb9f18169a199eaf95ebeb7dbbe6
2021-03-17 18:00:28 -07:00
Pirama Arumuga Nainar
5ef0c52bdf Merge "Update clang used for bindgen to clang-r412851" 2021-03-18 00:27:30 +00:00
Paul Duffin
9cbbbb8137 Convert sysprop package to fixtures
Bug: 182885307
Test: m nothing
Change-Id: I2e69e7b5eb3bad579df39c9dd49f2d670881a265
2021-03-18 00:21:41 +00:00
Paul Duffin
6e3ce72b3c Add preparers for sysprop
Bug: 181070625
Test: m nothing
Change-Id: I3c9c36e7270b68ff7d354acb239b47441335a931
2021-03-18 00:21:38 +00:00
Jiyong Park
e7569bc544 Merge "Add vbmeta module type" 2021-03-18 00:02:41 +00:00
Paul Duffin
220ddd7a6b Clean up java package use of python build components
Bug: 182885307
Test: m nothing
Change-Id: I206ebc075c568a09008ec8b63122922dd87ba318
2021-03-17 23:56:58 +00:00
Paul Duffin
803876aaa6 Convert python package to fixtures
Bug: 182885307
Test: m nothing
Change-Id: I78506a10f0e6ba8ad4952e8305f47ffd5a33b359
2021-03-17 23:56:56 +00:00
Paul Duffin
d0890452e3 Add preparers for python
Bug: 181070625
Test: m nothing
Change-Id: I590ad62db6fd62719c83286780563cf6d55e3e17
2021-03-17 23:56:29 +00:00
Paul Duffin
c60dd805ad Fix hole in python testing code that ignored a broken test
The test running code would only check errors if there were any
reported. That ignored the "module with duplicate runfile path" test
which was not reporting the expected error.

This change corrects that mistake, and then fixes the test which had
started to fail.

It is possible that the failing test highlights a bug in the python
code but if so that will need to be fixed in a follow up bug.

Bug: 183046274
Test: m nothing
Change-Id: I961b15a452725e7b15ba9d21b4a4a672ba3d004a
2021-03-17 23:56:23 +00:00
Treehugger Robot
ab534a3b5c Merge "bootimg signs image using verity_utils" 2021-03-17 23:37:04 +00:00
Kousik Kumar
c3a22d8ebd Allowlist RBE_num_retries_if_mismatched variable
This variable tells reproxy the number of times an action that
mismatches between local and remote-executions should be run remotely to
determine if the action is inherently non-deterministic.
An action is considered non-deterministic if the number of unique output
digests we get from the remote-run is > 1.

Bug: b/178842439
Change-Id: I0d50eed29b801be67a7ede9b25ce7f4535980f05
2021-03-17 14:22:05 -04:00
Paul Duffin
1b29e003f3 Add prebuilt_platform_compat_config
It just provides the metadata needed by the global singleton as the
rest is in the apex.

Bug: 182402754
Test: m nothing
Change-Id: I511df7a3a06dab13ddb9ad63392ae5310dfee9c4
2021-03-17 18:16:31 +00:00
Paul Duffin
0b8177873a Correct typo in the name of compatConfigTag
It was called compatConfigsTag which is inconsistent.

Bug: 182402754
Test: m nothing
Change-Id: I4636d72cee53b361f3b0ab17789e61a439c34edf
2021-03-17 18:16:31 +00:00
Paul Duffin
8c535dad36 Allow apex dependencies to be restricted to source modules only
An upcoming change to create a prebuilt_platform_compat_config module
will break if the apex tries to use it instead of a
platform_compat_config because the former does not provide all the
information that the apex needs. This change will allow the
compatConfigsTag to be configured to prevent the prebuilt from being
used even when it is preferred.

Bug: 182402754
Test: m nothing
Change-Id: Ib9dc06c038f7cf3fc229f3c4d2b025335a4715b4
2021-03-17 18:16:31 +00:00
Paul Duffin
29072a9c1e Separate metadata provider from apex contents provider
The platform_compat_config_singleton only needs access to the metadata
so this separates that method into its own interface, distinct from the
one needed by the apex. This also adds a test to ensure that the merging
still works.

Bug: 182402754
Test: m nothing
Change-Id: I5212239786810e5fc5eb99831b1122db93d1329f
2021-03-17 18:16:28 +00:00
Paul Duffin
64d371896e Add AssertIntEquals
Bug: 182402754
Test: m nothing
Change-Id: Ifed5cd656b6ad72ef59f9a5fadb10add5807c015
2021-03-17 17:55:00 +00:00
Paul Duffin
afeee22c17 Add emptyFixtureFactory in java package
Bug: 182402754
Test: m nothing
Change-Id: I6a01b846a8aee5a0ace9e6ac056ee439bf6f12f7
2021-03-17 17:50:22 +00:00
Paul Duffin
961543309f Reorganize the platform_compat_config.go file
The types and methods are separated and interleaved with each other
so this moves them so that they are together.

Bug: 182402754
Test: m nothing
Change-Id: I275f6af30491d2440499b9ee3f201eea227d23f8
2021-03-17 17:50:22 +00:00
Pirama Arumuga Nainar
7b33d41170 Update clang used for bindgen to clang-r412851
Test: presubmit
Change-Id: I4883bd3c26a4037d01829c0806fc908b2c8e1c37
2021-03-17 10:37:51 -07:00
Paul Duffin
ccdc0bef30 Convert android/namespace_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: I9a47c98d1e178d43644b8137bb37f337d05afd78
2021-03-17 16:18:17 +00:00
Paul Duffin
85034e92b6 Add FixtureIgnoreErrors
Bug: 182885307
Test: m nothing
Change-Id: Ib7e70b624db2f70374b755e97757ed21462b485a
2021-03-17 16:18:17 +00:00
Paul Duffin
d250ff620a Convert android/rule_builder_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: I6b8f4c419810e3766abaadfea403967c6714a484
2021-03-17 16:18:17 +00:00
Paul Duffin
54054686be Convert android/paths_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: I319322bab04135b84fb58af261ddfaaf8e9c2e3b
2021-03-17 16:18:17 +00:00
Paul Duffin
f62dc9b7a8 Convert android/module_test.go to test fixtures
Replaces the uses of buildDir in the unit test methods with t.TempDir()
as it just needs a temporary directory.

Bug: 182885307
Test: m nothing
Change-Id: I70452d548eff53c0bccada09f60eba7a615b5371
2021-03-17 16:18:17 +00:00
Paul Duffin
7c166b4529 Convert android/defaults_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: Iaf74bb9bece4eed717efa813b9b8ba51ecce5135
2021-03-17 16:18:17 +00:00
Paul Duffin
3d11961d43 Add AssertSame
Bug: 182885307
Test: m nothing
Change-Id: I9af030ae9cd3fcfd3442af82c5fcba60aec80861
2021-03-17 16:18:17 +00:00
Paul Duffin
140a8e183d Convert android/csuite_config_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: Ic3a83b0051553be7dea0284310db6304bb815eb1
2021-03-17 16:18:17 +00:00
Paul Duffin
738a6d5bc4 Convert android/arch_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: I4c9c133a1560731869fa5e8fdd81ecc4f54f4821
2021-03-17 16:18:10 +00:00
Paul Duffin
50deaae872 Add OptionalFixturePreparer
Sometimes it is necessary to optionally add a preparer. e.g. There are
many parameterized tests where one of the parameters is some additional
test setup but not every test provides it so it will default to the
"zero" value of whatever type is used for the test setup parameter
Migrating those tests to use test fixtures will typically require that
the test setup parameter be changed to a FixturePreparer, which by
default will be nil.

Attempting to use a nil FixturePreparer in the test fixtures will fail
so the OptionalFixturePreparer was added to wrap a possibly nil
FixturePreparer and thereby avoiding complicating each test with
similar logic.

Bug: 182885307
Test: m nothing
Change-Id: Ia12b2af2105fdc69af4e0b909a37a7b86f1af299
2021-03-17 16:10:56 +00:00
Paul Duffin
d210afa406 Remove android/apex_test.go use of buildDir
This test does not process any bp files it just needs a directory to
pass to TestConfig so it can use that to fake a PathContext. So, this
just replaces buildDir with a call to T.TempDir().

Bug: 182885307
Test: m nothing
Change-Id: I17c0435b7c45e4f8cb8b03a8ec8e57cfe397975b
2021-03-17 16:10:56 +00:00
Paul Duffin
9ca14c1987 Convert android/androidmk_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: Ic3969988a6fa642be3e8fc23c8d008f13128b846
2021-03-17 16:10:56 +00:00
Paul Duffin
854d661572 Migrate bpf package to a per test build directory
Bug: 182885307
Test: m nothing
Change-Id: I0ee9575af056057ca37831a3afebba2be1e54d27
2021-03-17 16:10:55 +00:00
Lukacs T. Berki
720b3964fe Fix writing soong.variables .
ConfiguredJarList had a marshaler but no unmarshaler.

Bug: 182965747
Test: Presubmits.
Change-Id: Id03669f4a0a3d389063a4e4b11af6d6be63dbba3
2021-03-17 16:35:13 +01:00
Colin Cross
45a4971808 Merge changes from topic "rule_builder_rsp"
* changes:
  Remove unescaped spans support from RuleBuilder
  Add explicit rspfile argument to RuleBuilderCommand.FlagWithRspFileInputList
  Ninja escape RuleBuilder rule params
2021-03-17 15:14:19 +00:00
Lukacs T. Berki
5f6cb1d6d3 Compile soong_build for debugging if needed.
That is, when SOONG_DELVE= is set.

Test: "m nothing; SOONG_DELVE=port m nothing; m nothing"
Change-Id: I16bd4e54e81b93202573935df134d413feea9bb2
2021-03-17 15:03:14 +01:00