Commit Graph

4476 Commits

Author SHA1 Message Date
Paul Duffin
f9bedde16f Merge "Change type of Image_name from string to *string" am: 63782aba78 am: fb2be116cc am: 04a10f160c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652449

Change-Id: Ie1c6adc7423d60309259d6555d2949c668dfc8a1
2021-03-29 14:19:53 +00:00
Ulya Trafimovich
39dd0a4b87 Don't enforce <uses-library> checks if dexpreopt for apps is disabled.
Otherwise the check fails, as it depend on non-existent dexpreopt.config
files. This CL fixes broken build cf_x86_phone-userdebug_coverage.

Bug: 183931403
Bug: 132357300
Test: forrest build for cf_x86_phone-userdebug_coverage.
Change-Id: Id3ffeb742c1b82c677795fa701a7b5a867eabbbd
2021-03-29 14:57:34 +01:00
Paul Duffin
682589237f Merge "Convert java/boot_image_test.go to test fixtures" am: 60fbea0ec6 am: 9b66f48c17
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652450

Change-Id: I8d726e6dc502f7821834ac03facd7bcd7b70c381
2021-03-29 13:32:14 +00:00
Paul Duffin
04a10f160c Merge "Change type of Image_name from string to *string" am: 63782aba78 am: fb2be116cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652449

Change-Id: Icc357e1d093767bcf87481cb3f0875f3467a0853
2021-03-29 13:32:09 +00:00
Paul Duffin
4b64ba05b6 Add bootclasspath_fragment as an alias for boot_image
This is part of the work to rename boot_image to bootclasspath_fragment
which is being done for two reasons:
1. To avoid clashing with the bootimg module type.
2. To better reflect what this represents.

While a bootclasspath_fragment can create what ART calls a boot image
(which is different to what the bootimg module type represents) it does
not have to do so.

Bug: 177892522
Test: m nothing
Change-Id: Ib45604be7adc790ded9e27a2ac812dd7522ca8db
2021-03-29 11:05:55 +01:00
Paul Duffin
837486d308 Convert java/boot_image_test.go to test fixtures
Bug: 177892522
Test: m nothing
Change-Id: I91d2bd2eabe5916fd158501bd0d4fdb608919019
2021-03-29 11:05:55 +01:00
Paul Duffin
64be7bb32f Change type of Image_name from string to *string
Bug: 177892522
Test: m nothing
Change-Id: Id72b6079f11c28df6248e71998fb97851cfc5be9
2021-03-29 11:05:55 +01:00
Colin Cross
a9a3bf3e83 Merge changes I71a83e3a,I66101c0c,Ie387c8c4,Iea742e75 am: 045ed0f684 am: db081efb32 am: 3ea82d3acd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652575

Change-Id: I6c5ca130bb1ccdc3aba64de076a24b3b89fe9b67
2021-03-26 17:19:05 +00:00
Colin Cross
3ea82d3acd Merge changes I71a83e3a,I66101c0c,Ie387c8c4,Iea742e75 am: 045ed0f684 am: db081efb32
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652575

Change-Id: I37da513e99d28c8b718800a7dcf0e82520f5c2ec
2021-03-26 16:34:29 +00:00
Colin Cross
045ed0f684 Merge changes I71a83e3a,I66101c0c,Ie387c8c4,Iea742e75
* changes:
  Strengthen metalava sandbox support using sbox
  Move metalava's output files into a subdirectory
  Fix lint warnings in droidstubs.go
  Split droidstubs out of droiddoc.go
2021-03-26 15:14:53 +00:00
Colin Cross
bc13992711 Support sandboxing droiddoc and droidstubs with args properties
args properties can access arbitrary files with $(location) expansions,
so they need to pass them through RuleBuilderCommand.PathsForInputs
to produce a path inside the sandbox.  Extract the arg expansion out
of collectDeps into a new expandArgs method that takes the
RuleBuilderCommand.

Test: TestDroidstubsSandbox
Change-Id: I9022d17bf3cb64c97b2008c4c1b733bf48edca95
2021-03-25 22:21:23 -07:00
Colin Cross
8a63fa9fd2 Merge changes Ie8721dcd,If1827b9d,Iec250a2d,I3f46f611,Idf136919, ... am: ba5fff85a7 am: 0b0fcae3ca am: defc5c9f8a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1651847

Change-Id: Ifc60075b65f4f27134aaab9315e4c0ffe90f2481
2021-03-25 23:03:02 +00:00
Colin Cross
defc5c9f8a Merge changes Ie8721dcd,If1827b9d,Iec250a2d,I3f46f611,Idf136919, ... am: ba5fff85a7 am: 0b0fcae3ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1651847

Change-Id: I93a2b690fa182ec885e3c941df516c2e04679f1c
2021-03-25 22:13:56 +00:00
Colin Cross
ba5fff85a7 Merge changes Ie8721dcd,If1827b9d,Iec250a2d,I3f46f611,Idf136919, ...
* changes:
  Replace ANDROID_SDK_HOME with ANDROID_PREFS_ROOT for metalava
  Simplify lint rules using improved RuleBuilder rsp support
  Support multiple rsp files in RuleBuilder
  Pass rsp files into sbox and rewrapper
  Add test for sbox input sandboxing
  Support multiple rsp files in REParams
  Move response file handling to a separate package
2021-03-25 20:55:56 +00:00
Paul Duffin
b682a0d827 Merge "Filter duplicate modules in platform_compat_config_singleton" am: f329307878 am: 8313fb112c am: d412d5404f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652267

Change-Id: I638fd20fa3ec3220985dc5b9f36d66c30015e276
2021-03-25 19:47:55 +00:00
Paul Duffin
2f2b70575f Merge "Fix TestDroiddoc's reliance on absolute paths" am: 6c968b1f0f am: 166ae29441 am: 37bb2910cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652617

Change-Id: I4c1bcda18cd65b19766aa385759696a5d7f0fbda
2021-03-25 19:47:37 +00:00
Roland Levillain
436b98b4bb Merge "Fix a typo in the definition of varApexNames in java/dexpreopt_bootjars.go." am: 737ad608ab am: 1cb436ebf0 am: ff6d63e4f2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652467

Change-Id: Ida829111b3ef8f005ff6f138411904de2f1ce093
2021-03-25 19:42:56 +00:00
Paul Duffin
d412d5404f Merge "Filter duplicate modules in platform_compat_config_singleton" am: f329307878 am: 8313fb112c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652267

Change-Id: I0d3d24bb408375cf08d129acb8b6f89c66636a34
2021-03-25 19:02:17 +00:00
Paul Duffin
37bb2910cc Merge "Fix TestDroiddoc's reliance on absolute paths" am: 6c968b1f0f am: 166ae29441
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652617

Change-Id: I0342edafa036858721bfc0e919cfc7c63ae5010d
2021-03-25 19:02:02 +00:00
Roland Levillain
ff6d63e4f2 Merge "Fix a typo in the definition of varApexNames in java/dexpreopt_bootjars.go." am: 737ad608ab am: 1cb436ebf0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652467

Change-Id: Ibd098123bdde4b3c08d71b557f9b9a9b1e26b106
2021-03-25 19:00:06 +00:00
Colin Cross
6aa5c40393 Strengthen metalava sandbox support using sbox
Run sandbox metalava rules inside sbox, which copies only the expected
inputs into a separate directory tree.  This ensures it can't read any
extra inputs.

Test: m hwbinder.stubs
Test: TestDroidstubs
Test: TestDroidstubsSandboxed
Change-Id: I71a83e3af6a385cc23f895397c2c883a2ac5fa22
2021-03-25 11:11:36 -07:00
Colin Cross
cb77f75aae Move metalava's output files into a subdirectory
Move all of the output files of the metalava rule into a single
subdirectory to make it compatible with sandboxing in sbox.

Test: TestDroidstubs
Change-Id: I66101c0c224dee702c8175e61c12cc9cd1aa8b93
2021-03-25 11:11:36 -07:00
Colin Cross
0d5324165a Fix lint warnings in droidstubs.go
Test: none
Change-Id: Ie387c8c4feddad7bd134604e442fd326e606cd2f
2021-03-25 11:11:36 -07:00
Colin Cross
2207f87756 Split droidstubs out of droiddoc.go
Split part of droiddoc.go into droidstubs.go.  Also split droiddoc_test.go
and droidstubs_test.go out of java_test.go.

Test: go test ./java
Change-Id: Iea742e75b6925b135016f7bbf3a168c696a6c433
2021-03-25 11:11:34 -07:00
Paul Duffin
f329307878 Merge "Filter duplicate modules in platform_compat_config_singleton" 2021-03-25 18:09:38 +00:00
Colin Cross
7ee54ffd70 Replace ANDROID_SDK_HOME with ANDROID_PREFS_ROOT for metalava
Fixes warnings:
Warning: Using ANDROID_SDK_HOME for the location of the '.android' preferences location is deprecated, please use ANDROID_PREFS_ROOT instead.
Support for ANDROID_SDK_HOME is deprecated and will be removed in 6.0

Test: m android_stubs_current
Change-Id: Ie8721dcda0578c670dfc796675ba43cda16883f6
2021-03-25 11:06:45 -07:00
Colin Cross
5bedfa2d45 Simplify lint rules using improved RuleBuilder rsp support
With the improved RuleBuilder rsp support a manual resources.list
file is not necessary, use FlagWithRspFileInputList instead.

The switch to RBE support in RuleBuilder in
Iab4e09d961891ef182643583d4d456e413bc5e39 obsoleted tracking remoteInputs
and remoteRSPInputs, remove them.

writeLintProjectXML was written to allow it to be applied to a separate
rule than the one that ran lint, but it is not used that way.  Using
the same rule for both means that manual tracking of the input
dependencies described by the project.xml rule but read by the lint
rule is not necessary, just treat them as inputs to the single rule.

Test: m lint-check
Test: m USE_RBE=true RBE_LINT=true RBE_LINT_EXEC_STRATEGY=remote lint-check
Change-Id: If1827b9dede3ebcd0792b6b4b8114d3199f6570b
2021-03-25 11:06:45 -07:00
Colin Cross
ce3a51dc96 Support multiple rsp files in RuleBuilder
The lint rule is manually creating a second rsp file because Ninja
only supports on per rule.  Move the support into RuleBuilder so
that it can apply the same rewrites that it does to the primary
one.

Test: TestRuleBuilder_Build
Change-Id: Iec250a2d60e74ccf1b4ad085a960fec6867ea559
2021-03-25 11:06:45 -07:00
Colin Cross
a4eafddc41 Support multiple rsp files in REParams
rewrapper supports a comma separate list of rsp files, replace
REParams.RSPFile with REParmas.RSPFiles.

Test: remoteexec_test.go
Change-Id: I7850c071c23d368d6fad4480dd527d146c13c6d3
2021-03-25 11:06:45 -07:00
Paul Duffin
6c968b1f0f Merge "Fix TestDroiddoc's reliance on absolute paths" 2021-03-25 18:02:26 +00:00
Roland Levillain
737ad608ab Merge "Fix a typo in the definition of varApexNames in java/dexpreopt_bootjars.go." 2021-03-25 17:25:44 +00:00
Paul Duffin
4dd6cdb3bc Fix TestDroiddoc's reliance on absolute paths
TestDroiddoc compares the value returned by OutputFiles(""), which will
usually be absolute paths including the temporary buildDir, against
paths returned from TestingBuildParam.RelativeToTop(), which does not
currently change the Path contents and so will include absolute
temporary paths. However, a follow up change to this will make the
TestingBuildParam.RelativeToTop() also change the Path contents at
which point this test would be comparing relative to absolute paths.

So, this change makes sure that they are all converted to relative to
top paths before comparison.

Bug: 183650682
Test: m droid
Change-Id: Ia4478f527af27a920945f5849525e5031cc5b8b6
2021-03-25 13:14:37 +00:00
Paul Duffin
bb9ff5108b Filter duplicate modules in platform_compat_config_singleton
Previously, unpacking a snapshot containing a
prebuilt_platform_compat_config into a source build would cause build
failure because of duplicate ids because the singleton would collate
ids from both prebuilts (versioned and unversioned) and source.

This change filters out versioned prebuilts and only uses prebuilts
that are preferred and source modules that have not been replaced by a
prebuilt.

Bug: 182402754
Test: m nothing
Change-Id: Idacbb34444e5156370df70bf88c6e8a7e2d67890
2021-03-25 12:53:25 +00:00
Ulyana Trafimovich
0fb7be1174 Merge "Allow using updatable boot jars in dexpreopt (but don't use them yet)." am: 2258cbbe42 am: 29dae7ed73 am: a7836fa341
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647188

Change-Id: Ib00f2aced5791d0c36e4593b36c09fd7976ad006
2021-03-25 12:25:01 +00:00
Ulyana Trafimovich
a7836fa341 Merge "Allow using updatable boot jars in dexpreopt (but don't use them yet)." am: 2258cbbe42 am: 29dae7ed73
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647188

Change-Id: I1849bcde5949b3d19a996bc01837469518c6cba7
2021-03-25 11:29:43 +00:00
Paul Duffin
c80f01ee04 Merge "Convert test that disallows non existent paths to use fixtures" am: e742ee14f8 am: 4a08263f48 am: cd3cc29952
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647169

Change-Id: I2e08b61169a01a256e87da0d5ff338c83751814f
2021-03-25 10:52:55 +00:00
Ulyana Trafimovich
2258cbbe42 Merge "Allow using updatable boot jars in dexpreopt (but don't use them yet)." 2021-03-25 10:13:45 +00:00
Paul Duffin
cd3cc29952 Merge "Convert test that disallows non existent paths to use fixtures" am: e742ee14f8 am: 4a08263f48
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647169

Change-Id: I7d91d68f6402e087a1f7693373fe101e979907a2
2021-03-25 10:03:03 +00:00
Paul Duffin
49ed211c7a Merge "Cleanup usages of Dex2oatDepTag" am: 958408d921 am: 15204cf1ea am: 6a8ac75e6a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652452

Change-Id: If6f759f545421848c466659e1cd8ccc80ef50e4b
2021-03-24 23:51:28 +00:00
Paul Duffin
6a8ac75e6a Merge "Cleanup usages of Dex2oatDepTag" am: 958408d921 am: 15204cf1ea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652452

Change-Id: Iea09f5217e72ff0a1051f455adee3bfff1ebe889
2021-03-24 23:10:25 +00:00
Nicolas Geoffray
8fb9e03dfa Merge "Fix "filename too long" issue on Luci caused by test name" am: ed35a90d2c am: 1176680a1e am: 938db1752c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652453

Change-Id: I59ad97dd6cb5d883866ed7be36c86068721c7965
2021-03-24 22:38:12 +00:00
Paul Duffin
76e5c8a37f Convert test that disallows non existent paths to use fixtures
This change needed to add some additional files to the registered
files for PrepareForTestWithJavaDefaultModules because otherwise they
would fail when "TestAllowNonExistentPaths = false". Those files were
being added by the TestJavaLintRequiresCustomLintFileToExist (albeit in
some cases in different locations to that required by the default
modules but as the files are needed by the modules defined in
PrepareForTestWithJavaDefaultModules they should be defined in it.

A couple of other places also provided some files so moving them into
PrepareForTestWithJavaDefaultModules caused some conflicts which needed
to be resolved.

Bug: 183184375
Test: m nothing
Change-Id: I76ce9f1673c1c1c4000635b76b8377d582224bf1
2021-03-24 22:08:05 +00:00
Paul Duffin
958408d921 Merge "Cleanup usages of Dex2oatDepTag" 2021-03-24 22:04:58 +00:00
Nicolas Geoffray
938db1752c Merge "Fix "filename too long" issue on Luci caused by test name" am: ed35a90d2c am: 1176680a1e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652453

Change-Id: Icfaf4342d2236a45c69db7ab26ff62b72f73d40e
2021-03-24 21:55:13 +00:00
Paul Duffin
13a70313b2 Merge changes I94f66e3e,I233a4fe1,Idbb37485 am: a1063c09f6 am: 842bbe246a am: 14ef1b2928
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1651209

Change-Id: I809f1327c8838d24f0b4a41f4b09642c533c960d
2021-03-24 15:49:12 +00:00
Paul Duffin
a35178b105 Fix "filename too long" issue on Luci caused by test name
Stop including fields in the test name for TestJavaSdkLibraryEnforce to
reduce its length to avoid the filename too long limit.

Test: m nothing
      Check the lengths before (~240) and after (~74) to make sure
      there was a sizeable reduction.
Change-Id: I275a1110e5102b8ea8376759f28c7c6333a5efee
2021-03-24 15:09:37 +00:00
Paul Duffin
14ef1b2928 Merge changes I94f66e3e,I233a4fe1,Idbb37485 am: a1063c09f6 am: 842bbe246a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1651209

Change-Id: I8a4ab1c605742ab62a6f871b378c96d2d2febaa9
2021-03-24 15:02:36 +00:00
Paul Duffin
b506c9dc11 Cleanup usages of Dex2oatDepTag
Creates a new deptag type for it so that it can implement the marker
interfaces that will exclude it from being added to the APEX and from
visibility enforcement. The latter is probably not an issue ATM because
the dependencies are added after visibility checks are enforced but
this code is undergoing lots of refactoring so that may change.

Bug: 177892522
Test: m nothing
Change-Id: Ibd167d557adec761a2e3eed78f4d334c40a04fb9
2021-03-24 14:34:40 +00:00
Roland Levillain
d603c7dbae Fix a typo in the definition of varApexNames in java/dexpreopt_bootjars.go.
Change-Id: If1267cf18dcd307316cce8d2cac7c6f5c173f3d4
Test: `m nothing` in internal tree
Bug: 180325915
2021-03-24 14:24:04 +00:00
Paul Duffin
a1063c09f6 Merge changes I94f66e3e,I233a4fe1,Idbb37485
* changes:
  Group all the preparations needed for testing dexpreopt
  Separate methods used for fixture based and legacy tests
  Use more inclusive language in dexpreopt/testing.go
2021-03-24 13:41:56 +00:00