Commit Graph

3715 Commits

Author SHA1 Message Date
Paul Duffin
7ef6c2b45c Add test for hiddenAPI index file generation am: 01289a2407 am: e510de2f58 am: 2229b27740
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1575169

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2dcb98a9a0c197a8f347c51f4e663e3c150aa2ac
2021-02-08 13:34:14 +00:00
Paul Duffin
2229b27740 Add test for hiddenAPI index file generation am: 01289a2407 am: e510de2f58
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1575169

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7aa50863bc76dfb8f9a790b824da7fcc087626c9
2021-02-08 12:59:16 +00:00
Paul Duffin
5ce9f42f5a Merge changes I9e94662d,I4b4e0dc8 am: 254aee4843 am: 3c4acc4279 am: fbd6af6226
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574746

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I81f78f2f4e54864be1dec87b2157f32428c54201
2021-02-07 15:52:30 +00:00
Paul Duffin
fbd6af6226 Merge changes I9e94662d,I4b4e0dc8 am: 254aee4843 am: 3c4acc4279
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574746

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4321f7fb64832e85399a20bea30a5a07ca6e93eb
2021-02-07 15:29:20 +00:00
Paul Duffin
01289a2407 Add test for hiddenAPI index file generation
The index file and the metadata file both currently include duplicate
entries due to them including both the <x> and <x>.impl libraries
created by java_sdk_library in their inputs, plus including both source
and prebuilt versions of the same named module. This change adds a test
to illustrate that behavior. A follow up change will correct the problem
and update the test accordingly.

This change only adds a test for the index file because the metadata
file depends on files from frameworks/base which makes it difficult to
test. Bug 177317659 will fix that and allow the metadata file
generation to be tested too.

Bug: 178361284
Test: m nothing
Change-Id: I33921d7267c9f4bb42726343d73f8a396d536aaa
2021-02-07 10:58:24 +00:00
Paul Duffin
254aee4843 Merge changes I9e94662d,I4b4e0dc8
* changes:
  Export implementation class jars for java_boot_libs
  Improve module filtering in hiddenapi stubFlagsRule()
2021-02-07 10:52:01 +00:00
Liz Kammer
73f2874a87 Merge "bp2build: convert paths/module refs to Bazel label" am: b7eab01167 am: 6d5454d0f9 am: 595abf120a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1564272

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I51fd926cdae810906a75ed132dc70fa2f2c74240
2021-02-05 15:40:11 +00:00
Liz Kammer
595abf120a Merge "bp2build: convert paths/module refs to Bazel label" am: b7eab01167 am: 6d5454d0f9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1564272

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I850a7a72980cd003afbb696ff0ae1beba110995a
2021-02-05 15:00:27 +00:00
Liz Kammer
b7eab01167 Merge "bp2build: convert paths/module refs to Bazel label" 2021-02-05 13:39:08 +00:00
Paul Duffin
22ff0aaf51 Export implementation class jars for java_boot_libs
Hiddenapi processing currently requires access to the class
implementation jars for libraries on the bootclasspath which means that
they need to be provided as part of the prebuilts. This change modifies
the java_boot_libs property on the sdk to make those files available.

Modularization of the hiddenapi processing will hopefully remove the
need for these to be exported so this should be temporary.

Bug: 178361284
Test: m art-module-sdk
      check generated snapshot zip contains implementation jars
Change-Id: I9e94662dddb0ddb85a477ae6d27e533085147e88
2021-02-05 13:35:25 +00:00
Paul Duffin
dd63d6d7bd Improve module filtering in hiddenapi stubFlagsRule()
Previously, it ignored any module that was not a platform apex variant
however that required every module that was referenced from the boot
jars to have a platform variant which is not the case when building
from prebuilts.

This change switches it to explicitly check that the variant is for
either the appropriate apex or the platform depending on what is
configured in the BootJars or UpdatableBootJars.

It partially duplicates some logic from the getBootImageJar() function.
It intentionally does not refactor the getBootImageJar() to allow for
reuse because coupling the hiddenapi and dexpreopt logic would make
refactoring either of them more difficult. Any duplicated code will be
deduped once they have both been refactored.

Bug: 178361284
Test: m droid
Change-Id: I4b4e0dc8ee40c1ba1713d7ef72df13d175e84af6
2021-02-05 13:33:25 +00:00
Ulyana Trafimovich
eceb8ff9f0 Merge "Don't write nonexistent DEX file paths to dexpreopt.config files." am: 9b91082452 am: 1fdefc2c57 am: 8c723918ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574745

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I55cac496bdcaa4dc83a92c50b013812e616da8b7
2021-02-05 12:51:32 +00:00
Ulyana Trafimovich
8c723918ee Merge "Don't write nonexistent DEX file paths to dexpreopt.config files." am: 9b91082452 am: 1fdefc2c57
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574745

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9f39d40678f0d818403c2ab2c6d015e34860e928
2021-02-05 12:24:15 +00:00
Paul Duffin
cee3a2a610 Merge "Detect empty apex in ConfiguredJarList" am: b8887127ba am: 6664c04ce9 am: b00bde6fb0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574743

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2f05ec97a66a4d238fa3df89f3dc64ab07dae5cd
2021-02-05 11:23:35 +00:00
Ulyana Trafimovich
9b91082452 Merge "Don't write nonexistent DEX file paths to dexpreopt.config files." 2021-02-05 11:10:03 +00:00
Paul Duffin
b00bde6fb0 Merge "Detect empty apex in ConfiguredJarList" am: b8887127ba am: 6664c04ce9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574743

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I42edc356e4a6cc4ec548c36a023a4fee6d5d94dd
2021-02-05 10:50:07 +00:00
Paul Duffin
b8887127ba Merge "Detect empty apex in ConfiguredJarList" 2021-02-05 09:30:15 +00:00
Treehugger Robot
cbd43544e2 Merge "data dependency of java_test_host can be arch-specific" am: f860a2ab66 am: 685daa0dd9 am: ef8d0e264a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574806

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie564d402e593ef04e17e7e78ebb54754e6f6a20d
2021-02-05 05:49:34 +00:00
Treehugger Robot
ef8d0e264a Merge "data dependency of java_test_host can be arch-specific" am: f860a2ab66 am: 685daa0dd9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574806

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib39fd01d7c7f0a3360d71262e9d9819fca576090
2021-02-05 05:01:57 +00:00
Liz Kammer
356f7d45c1 bp2build: convert paths/module refs to Bazel label
This currently expands all globs, still need to support converting glob
syntax.

Test: go build_conversion_test
Test: GENERATE_BAZEL_FILES=true m nothing
Test: m nothing
Bug: 165114590
Change-Id: If7b26e8e663d17566fad9614ca87a8da1f095284
2021-02-04 13:45:56 -05:00
Jiyong Park
cdd9b8392d data dependency of java_test_host can be arch-specific
This allows java_test_host to have arch-specific data files. Currently,
VirtualizationHostTestCases needs this to have arch-specific kernels as
its data.

Bug: N/A
Test: m VirtualizationHostTestCases
Change-Id: Ib5680ef48b613955ad92c9bc212184ac75900d3e
2021-02-05 00:29:47 +09:00
Ulya Trafimovich
c0f64799da Don't write nonexistent DEX file paths to dexpreopt.config files.
A path to an nonexistent file caused dex2oat to write an empty path in
the class loader context stored inside of the OAT/ODEX file, which
resulted in class loader context mistmatch and a failure to load
dexpreopt code on device.

An example of a faulty class loader context for GoogleDialer, can be
seen either with oatdump or by grepping logcat for class loader context
mimatch messages (the first empty PCL[] is expected, note the second
empty PCL[] in the subcontext for shared libraries):

  PCL[]{PCL[]#PCL[/system/framework/org.apache.http.legacy.jar*22205474]

This CL removes the nonexistent path from the generated dexpreopt.config
file, which works in conjunction with a change in makefiles that stops
using the removed config field. This is possible because makefiles can
access DEX files using a module name and "intermediates-dir-for" macro.

Bug: 132357300
Test: lunch cf_x86_64_phone-userdebug && m && launch_cvd \
      adb wait-for-device && adb root && adb logcat \
      | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
      # empty grep output, no errors
Change-Id: I8d16f77c6f76ad6234cc4114ad3545cbe572ef13
2021-02-04 12:14:51 +00:00
Paul Duffin
9c3ac96f1f Detect empty apex in ConfiguredJarList
Previously, ConfiguredJarList would accept an empty apex name,
e.g. ":jar" which makes no sense as every apex has to have a non-empty
name. This change makes an empty apex invalid.

In order to improve the test coverage of the TestConfiguredJarList test
this change also changes the implementation of
CreateTestConfiguredJarList([]string) to marshal the supplied strings
into a json list and then unmarshal into a ConfiguredJarList which more
closely matches how it is used at runtime.

Bug: 178361284
Test: m nothing
Change-Id: I7dfec6b4cc1923aa99746e976da0393922ef0791
2021-02-04 10:07:41 +00:00
Paul Duffin
b0fabd99c9 Merge "Switch hiddenapi to use OutputPath instead of ModuleOutPath" am: e1f9b35d92 am: 5a648cf0df am: f553a9f40d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1571202

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4746791f889525597a5e3266b17973882f3fb361
2021-02-03 11:54:23 +00:00
Paul Duffin
f553a9f40d Merge "Switch hiddenapi to use OutputPath instead of ModuleOutPath" am: e1f9b35d92 am: 5a648cf0df
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1571202

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9a1e1890545da1fd16918831567f22f03e73cf65
2021-02-03 11:10:01 +00:00
Paul Duffin
e1f9b35d92 Merge "Switch hiddenapi to use OutputPath instead of ModuleOutPath" 2021-02-03 10:02:36 +00:00
Tobias Thierer
00da5c60fb Merge "go/Android.bp: Clarify sdk_version documentation." am: dadc62cdb4 am: 922e7f941a am: dec7caec15
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1518598

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0723ce5d973138b5dbc14688c8b22beb065d15c6
2021-02-02 20:17:54 +00:00
Tobias Thierer
dec7caec15 Merge "go/Android.bp: Clarify sdk_version documentation." am: dadc62cdb4 am: 922e7f941a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1518598

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie46c8ea7ea179f2e87fe6f1a6741c0035cb87766
2021-02-02 19:34:48 +00:00
Tobias Thierer
dadc62cdb4 Merge "go/Android.bp: Clarify sdk_version documentation." 2021-02-02 18:19:38 +00:00
Paul Duffin
612e610063 Switch hiddenapi to use OutputPath instead of ModuleOutPath
In order to allow the hiddenapi code which expects its inputs to be
ModuleOutPath to consume the output from the deapexer module type (used
by prebuilt_apex) this change converts the hiddenapi from using
ModuleOutPath to use OutputPath instead.

This is part of a general cleanup to remove ModuleOutPath that is
separated out in order to avoid having the hiddenapi work dependent
upon and possibly delayed by issues with that general cleanup.

Bug: 178361284
Bug: 179124768
Test: m droid
Change-Id: I890f775bf5e33528dbaa62b95fa4198185ff8bf8
2021-02-02 14:42:05 +00:00
Paul Duffin
9ce9d882cb Merge "Move creation of paths into hiddenAPIGenerateCSV" am: 8705ba06bf am: 9031379011 am: 3e9ce4716a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1564637

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0b6941d69f05dc5ba0e2466a1a2406ef7d2f6444
2021-02-01 20:31:20 +00:00
Paul Duffin
3e9ce4716a Merge "Move creation of paths into hiddenAPIGenerateCSV" am: 8705ba06bf am: 9031379011
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1564637

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I37d8002f30b31451dc683ce72156d50f2e55ac64
2021-02-01 19:49:23 +00:00
Paul Duffin
8705ba06bf Merge "Move creation of paths into hiddenAPIGenerateCSV" 2021-02-01 17:28:20 +00:00
Paul Duffin
f7e2ff5dc9 Merge "Fix some minor issues with boot_image" am: aded43c808 am: 92db324beb am: 2c1c3cac9e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1566176

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iad8a038903907bfc0a74a98852929c1fa7961cf3
2021-02-01 11:47:48 +00:00
Paul Duffin
fff9e13ed8 Merge "Add boot_images to apex" am: 4a838dfb3f am: 4849ec99b9 am: 4694cf7c81
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1560278

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I59b4310efac004352f572252b78d68155f7d78e9
2021-02-01 11:39:07 +00:00
Ulyana Trafimovich
6be59d88c7 Merge "Write module dexpreopt.config for Make." am: a4fce3b488 am: 682808f0ad am: 136d087a8e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1541538

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2972ea7c62c787b8b674185d0e1febf19e173112
2021-02-01 11:38:58 +00:00
Paul Duffin
a78406f692 Merge "Add documentation for the different files created by hiddenapi" am: 523bb85995 am: e3b48e4034 am: 4c73a0d554
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1564636

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib82002ecf7d15dcda3dddb23ed2ef6fc9dcb85eb
2021-02-01 11:38:47 +00:00
Paul Duffin
2c1c3cac9e Merge "Fix some minor issues with boot_image" am: aded43c808 am: 92db324beb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1566176

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I54537d03a79ad26895ecbee9be0e64fbde575c0f
2021-02-01 11:02:35 +00:00
Paul Duffin
4694cf7c81 Merge "Add boot_images to apex" am: 4a838dfb3f am: 4849ec99b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1560278

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I61aa45660665daf63e98ff1d51c2171ba76e0aa8
2021-02-01 11:02:23 +00:00
Ulyana Trafimovich
136d087a8e Merge "Write module dexpreopt.config for Make." am: a4fce3b488 am: 682808f0ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1541538

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4c0696bbcf536ddbf875c9e6c9e43bbc602b4b3f
2021-02-01 11:02:14 +00:00
Paul Duffin
4c73a0d554 Merge "Add documentation for the different files created by hiddenapi" am: 523bb85995 am: e3b48e4034
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1564636

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I442b5bfd65dbb863d79926c562dbe81205518501
2021-02-01 11:02:07 +00:00
Paul Duffin
aded43c808 Merge "Fix some minor issues with boot_image" 2021-02-01 10:21:34 +00:00
Paul Duffin
4a838dfb3f Merge "Add boot_images to apex" 2021-02-01 10:21:21 +00:00
Ulyana Trafimovich
a4fce3b488 Merge "Write module dexpreopt.config for Make." 2021-02-01 10:16:57 +00:00
Paul Duffin
5bbfef8718 Fix some minor issues with boot_image
Mistakenly used HostAndDeviceDefault (which builds host and device
variants by default) instead of HostAndDeviceSupported which only
builds a device variant by default.

Moved the test definitions of art and framework boot images from being
defined in all Java related tests into the test where they belong. This
is needed in order to improve the ART and framework boot image specific
testing.

Bug: 177892522
Test: m droid
Change-Id: I16771f09bd789033e18c58ae6dd4b6b9e865d831
2021-01-30 12:57:26 +00:00
Paul Duffin
a1d6025a49 Add boot_images to apex
Previously, the apex module had to hard code behavior specific to the
art apex module in order to include the art boot image. This change
adds support to the apex module to allow the boot images to be
specified per apex.

In combination with a change to add the "art-boot-image" to the ART
apex this allows the custom code for handling the art boot image in
apex to be removed.

That custom apex code also included the logic to ensure that the
GlobalSoongConfig was initialized for use by the dex_bootjars
singleton. That logic has been moved from the APEX to the boot_image
module. That ensures that it will be run if and only if a boot_image
module is present in the checked out repos. So, limited manifest
checkouts which do not contain the art or frameworks/base repos (which
is where the boot_image modules are defined) will not attempt to run
this logic, which would fail because dex2oat would not be present.

Bug: 177892522
Test: m droid
Change-Id: I02d25fbef6e864e31eb5e0f4eb50358c79486db0
2021-01-30 12:45:07 +00:00
Martin Stjernholm
a43e5c3cde Merge "Fix boot jar handling when both source and prebuilt APEXes and modules are present." am: c4e17317d1 am: d593a73257 am: 8784b2fe5d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1553594

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I37251d12bf78ce055394956b74bafb64ebbf8e6e
2021-01-30 00:54:15 +00:00
Martin Stjernholm
8784b2fe5d Merge "Fix boot jar handling when both source and prebuilt APEXes and modules are present." am: c4e17317d1 am: d593a73257
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1553594

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia050858ba2a5810b0e708f61a12fe536b571af7f
2021-01-29 23:43:27 +00:00
Paul Duffin
34982f1096 Move creation of paths into hiddenAPIGenerateCSV
A minor refactoring to simplify the generation of the CSV files.

Test: m nothing
Bug: 178361284
Change-Id: If79d21c7cebc6643a404973d3e0e5f174d7b0bb1
2021-01-29 13:22:31 +00:00
Paul Duffin
ff774a04ad Add documentation for the different files created by hiddenapi
Test: m nothing
Bug: 178361284
Change-Id: Id55646b9d4b7bc1acdb4ed6a6dd4456b746eb54c
2021-01-29 13:19:51 +00:00