Commit Graph

36370 Commits

Author SHA1 Message Date
Paul Duffin
1b5e8cdbee Merge "Refactor special handling of hidden API encoding for master-art" am: fdd9743609
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707569

Change-Id: Id36a114acd7854164cc3eee2c99e1144372b9f64
2021-05-14 19:18:41 +00:00
Paul Duffin
97961f4837 Merge "Stop generating unnecessary hidden API rules" am: b7c78731d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707574

Change-Id: I96fab0709252e6c0730b5a22a06e8a02358653a3
2021-05-14 19:18:34 +00:00
Paul Duffin
b28f562092 Merge "Generate monolithic hidden API files direct from class jars" am: 21f62ef867
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707573

Change-Id: I19deb2643cc128ca9f25d38152db864fdc0fe199
2021-05-14 19:18:27 +00:00
Paul Duffin
93b312c2dd Merge "Dedup hidden API rule generation" am: 2bc8b3a646
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707572

Change-Id: I7d9edfc6383ba6efbc62714c12aa415cb9a45cfd
2021-05-14 19:17:11 +00:00
Paul Duffin
fdd9743609 Merge "Refactor special handling of hidden API encoding for master-art" 2021-05-14 18:53:43 +00:00
Paul Duffin
b7c78731d4 Merge "Stop generating unnecessary hidden API rules" 2021-05-14 18:53:08 +00:00
Paul Duffin
21f62ef867 Merge "Generate monolithic hidden API files direct from class jars" 2021-05-14 18:52:11 +00:00
Paul Duffin
2bc8b3a646 Merge "Dedup hidden API rule generation" 2021-05-14 18:51:10 +00:00
Paul Duffin
42a9a2ede6 Merge "Allow shared libraries on bootclasspath" am: b0f20d134f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707576

Change-Id: Ia599b240c43ebd916f3bd4f4c0c1a2b2eb512991
2021-05-14 17:19:49 +00:00
Bill Peckham
a1ae5530cb Merge "Fix missing headers for vndk snapshotted libc" am: 054619d198
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1708168

Change-Id: I31cd498323dd3bb13d72b9927958790d8ca95539
2021-05-14 17:19:40 +00:00
Colin Cross
78894a5ab0 Merge "Add order-only dependency on shared libraries" am: 9debc21ca3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707986

Change-Id: Ia6aeecf11efd617344b1628a8b5aa2291c9ad8c0
2021-05-14 17:17:26 +00:00
Paul Duffin
b0f20d134f Merge "Allow shared libraries on bootclasspath" 2021-05-14 17:03:03 +00:00
Bill Peckham
054619d198 Merge "Fix missing headers for vndk snapshotted libc" 2021-05-14 16:52:11 +00:00
Colin Cross
9debc21ca3 Merge "Add order-only dependency on shared libraries" 2021-05-14 16:48:57 +00:00
Paul Duffin
79fd3d728c Allow shared libraries on bootclasspath
A previous change treated this as an error in order to try and detect
issues with misconfigured java_sdk_library modules and/or
bootclasspath_fragment modules but unfortunately this is not always an
error, e.g. when migrating a library that was a shared library to the
bootclasspath.

This change stops treating that as an error.

Bug: 179354495
Test: m nothing
Change-Id: I4a833ab5f4caf86c6cd340090fc65d2c2f141512
2021-05-14 16:14:17 +01:00
Paul Duffin
b6f53c064e Refactor special handling of hidden API encoding for master-art
Instead of encoding the hidden API with an empty set of flags when the
monolithic flags are not available this simply disables encoding
altogether which should have the same behavior at runtime.

This change also removes the unused flags field in hiddenAPISingleton
which was set but never read.

Bug: 179354495
Test: m nothing
Change-Id: I32d5825e5271829993dd4e5be4d4ee1b22fa7b22
2021-05-14 15:57:10 +01:00
Paul Duffin
afaa47c74a Stop generating unnecessary hidden API rules
The rules to extract hidden API information from an individual module
in order to create module specific files are no longer necessary as
the monolithic files are created directly from the module's class jars
and not the module specific files.

Bug: 179354495
Test: verified that the monolithic out/soong/hiddenapi/... files are
      unchanged by this change
Change-Id: I573ac17f3ea5da5a2a7e4f08718160dacca71c0c
2021-05-14 15:57:10 +01:00
Paul Duffin
537ea3d04c Generate monolithic hidden API files direct from class jars
Previously, the monolithic hidden API files, e.g. hiddenapi-index.csv
file, were generated in two steps. First, each module created its own
files using the information in its class jars. Then, the monolithic
files were created by merging those module specific files into a larger
file.

This change switches to generating the monolithic files directly from
the class jar files and bypassing the intermediate files.

In order to ensure that this change did not change the monolithic files
it is necessary for the hiddenapi-metadata.csv to go through a
reformatting step. Hopefully, this will be able to be removed in a
follow up change.

Bug: 179354495
Test: verified that the monolithic out/soong/hiddenapi/... files are
      unchanged by this change
Change-Id: I5a78e747516014b7c0f402a4b4431b14be6a84b2
2021-05-14 15:57:04 +01:00
Paul Duffin
850e61f234 Dedup hidden API rule generation
Bug: 179354495
Test: verified that the monolithic out/soong/hiddenapi/... files are
      unchanged by this change
Change-Id: I54b677c97712a7573ff5eed017c1b2198b80bc51
2021-05-14 14:53:19 +01:00
Paul Duffin
86d7f1ba59 Make hidden API handle jacoco-stubs consistently am: 098c878838
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707571

Change-Id: I5b1116f5fadda22142f3bf40f2782c9cf8afc10c
2021-05-14 12:03:46 +00:00
Inseob Kim
cc12d90753 Fix missing headers for vndk snapshotted libc
VNDK snapshot depends on addExportedGeneratedHeaders to grab generated
headers. This change adds a missing addExportedGeneratedHeaders call to
make libc's headers captured correctly.

Bug: 181326838
Test: VNDK_SNAPSHOT_BUILD_ARTIFACTS=true m dist vndk && unzip -l
out/dist/*.zip

Change-Id: Iaa89b5255c836761a26c77bb27f35f768f49039e
2021-05-14 20:15:55 +09:00
Paul Duffin
098c878838 Make hidden API handle jacoco-stubs consistently
Previously, when code coverage was enabled the monolithic hidden API
processing would add jacoco-stubs to public APIs only as that would
make them accessible for everyone. However, the
art-bootclasspath-fragment added jacoco-stubs to public, system and
test APIs as that was the simplest way of handling it and while the
extract APIs were unnecessary they would not change behavior.

Unfortunately, that lead to a difference in the flags generated which
caused the check that verifies flags are consistent between the
monolithic and modular files to fail.

This change adds jacoco-stubs to system and test APIs for the
monolithic hidden API processing to ensure consistency.

Bug: 179354495
Bug: 188143639
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true out/soong/hiddenapi/hiddenapi-flags.csv
      - ran before making the change to reproduce the problem and after
        to verify the fix.
Change-Id: Icbd15f0ece871a8c44d9e4a73fd0f7acc3760bba
2021-05-14 10:19:46 +00:00
Paul Duffin
e48bebd77d Use java_sdk_library in bootclasspath_fragment contents as stubs am: 34827d4c0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707567

Change-Id: Ie666d52edb78080becf91b2976c2e37420a591ad
2021-05-14 06:53:23 +00:00
Paul Duffin
02618f854e Validate monolithic and modular hidden API flags are consistent am: dfa1083fee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705309

Change-Id: I06e9d4f6235fb05a15ea86f132ac740a2e973c27
2021-05-14 06:53:17 +00:00
Paul Duffin
c23b7e4d5b Generate hidden API flags for a bootclasspath_fragment am: 2fef136885
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705308

Change-Id: I1366239380164141b6c4b8ccb3eba7955704421e
2021-05-14 06:46:56 +00:00
Paul Duffin
251bb0cfaf Populate hiddenAPI structure even when not active am: 001e606e5c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707568

Change-Id: I019e147931b2bbaacfc538df5ba3ce6e019464c2
2021-05-14 06:11:16 +00:00
Paul Duffin
5afc79746a Disallow shared libraries in bootclasspath_fragment contents am: f4600f6e6a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707566

Change-Id: I91d1e97f0eaeafa6d9feca9d5c478b7dc643dc4f
2021-05-14 06:10:37 +00:00
Colin Cross
58dd6a92e5 Add order-only dependency on shared libraries
Improve the dependency accuracy by adding an order-only dependency
on the shared library alongside the existing depenency on the
table of contents file.  The dependency won't cause the module
to be rebuilt when the the shared library changes, but will allow
anything using the ninja graph for sandboxing to know the dependency
exists.

Test: manual
Change-Id: I3accbcabee62fa0ad3eb3d1aaedc5a4bffe27308
2021-05-13 18:01:24 -07:00
Paul Duffin
34827d4c0e Use java_sdk_library in bootclasspath_fragment contents as stubs
A java_sdk_library specified in the bootclasspath_fragment contents
must be providing APIs for the bootclasspath_fragment and so must be
treated as if they were specified in the stub_libs. This avoids having
to specify them in both contents and stub_libs.

Bug: 179354495
Test: m nothing
Change-Id: I535065ee1a79b439e2676f35e06a75d4626adcaf
2021-05-14 01:49:19 +01:00
Paul Duffin
dfa1083fee Validate monolithic and modular hidden API flags are consistent
This makes sure that where there is overlap between the hidden API
flags generated for a module and the monolithic flags that they are
identical. That ensures that the modular hidden API flags will be
compatible with previous releases that relied on the monolithic flags.

Bug: 179354495
Test: m out/soong/.intermediates/art/build/boot/art-bootclasspath-fragment/android_common_apex10000/modular-hiddenapi/all-flags.csv
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - Create some inconsistencies between the above two files.
      m out/soong/hiddenapi/hiddenapi-flags.csv.valid
Change-Id: Iaf9e23cef63e221608955d89dc8d496bcc70c86e
2021-05-14 01:49:19 +01:00
Paul Duffin
2fef136885 Generate hidden API flags for a bootclasspath_fragment
This change adds support for generating the hidden API flags for the
contents of a bootclasspath_fragment. Currently, it will only work for
the art-bootclasspath-fragment as it has no support for creating
dependencies between bootclasspath_fragment modules which will be
needed for handling any other bootclasspath_fragment.

The hidden API flag generation added by this change is completely
separate to the normal hidden API processing and is not as yet encoded
in dex jars so will have no effect on the runtime.

The generated files are provided for use by other modules and copied
into the sdk snapshot. That is needed to allow the build to verify that
the hidden API flags generated by the individual bootclasspath_fragment
modules are consistent with the flags generated for the whole
bootclasspath, whether building from source or prebuilts.

Bug: 179354495
Test: m art-module-sdk
      m out/soong/.intermediates/art/build/boot/art-bootclasspath-fragment/android_common_apex10000/modular-hiddenapi/all-flags.csv
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - test that the former file is a subset of the latter and that
        where they overlap they are identical.
Change-Id: Ie27303e2960953db1b7abe95510e3bca4411b09a
2021-05-14 01:48:51 +01:00
Paul Duffin
001e606e5c Populate hiddenAPI structure even when not active
The modular hidden API processing needs access to the classesJarPaths
and bootDexJarPath fields of the hiddenAPI structure even if the
modules are not themselves considered to be active participants in the
existing hidden API processing.

This change moves the initialization of those fields to before inactive
modules are ignored.

Bug: 179354495
Test: m art-module-sdk out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: I06f96d39d0b413295d3e2af50453ebe7e4d3e9c8
2021-05-14 01:45:42 +01:00
Yuntao Xu
6b968b9531 Merge "syntax check to jacoco filters for any build" am: 0589914135
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1706576

Change-Id: I2fb69092310540ef9029fe76075a3b6098ec3070
2021-05-13 23:44:58 +00:00
Paul Duffin
f4600f6e6a Disallow shared libraries in bootclasspath_fragment contents
Bug: 177892522
Test: m nothing
Change-Id: I78c8ef8664ec1eb0fe3456a2de2cb956162ca0da
2021-05-14 00:39:24 +01:00
Yuntao Xu
0589914135 Merge "syntax check to jacoco filters for any build" 2021-05-13 23:11:48 +00:00
Treehugger Robot
2a4deaaf6d Merge "Soong: check if lndk is needed for apex build" am: ef0439d969
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705069

Change-Id: I6155c3404d7b125f84eed05299c16c09da6fca7c
2021-05-13 23:05:05 +00:00
Treehugger Robot
ef0439d969 Merge "Soong: check if lndk is needed for apex build" 2021-05-13 22:49:39 +00:00
Paul Duffin
94a452c768 Add java_sdk_library in bootclasspath_fragment contents to sdk am: a10bd3c127
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705470

Change-Id: I03dcf4b107c2cd390f6f90ce930bfbf007c147b2
2021-05-13 22:42:06 +00:00
Zhijun He
ec2858799b Soong: check if lndk is needed for apex build
This is to fix the unnecessary dependencies inclusion
when building apex modules.

Test: Build
Bug: 186306595
Change-Id: I1f3bbdb0a1f97a8338b45ca29c92acf9b20eadd3
2021-05-13 14:04:45 -07:00
Paul Duffin
a10bd3c127 Add java_sdk_library in bootclasspath_fragment contents to sdk
A java_library specified in a bootclasspath_fragment's contents
property will be automatically added to the sdk containing that
bootclasspath_fragment. Previously, if that was attempted with a
java_sdk_library it would be added to the sdk as if it was a normal
java_boot_libs which would prevent the sdk from containing the
API specific artifact such as current.txt files and stub libraries
and sources.

This change fixes that and adds a java_sdk_library as a java_sdk_libs
module.

Bug: 177892522
Test: m nothing
Change-Id: Ided57b846ce5b8940c7e898c786fd77602582ea2
2021-05-13 21:25:42 +01:00
Paul Duffin
1d579e9694 Merge "Add support for converting OptionalPath to Paths" am: 17ccf26748
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1706747

Change-Id: I9605a7479b974ef369de702ededb84a3ba0c1f37
2021-05-13 19:51:55 +00:00
Yuntao Xu
5b009aedf9 syntax check to jacoco filters for any build
Perform syntax check to jacoco filters for any build.

Bug: 183622051
Test: Manual
Test: TreeHugger
Change-Id: Iff90d7b45bdad8706c43c7e16d98270af688d20b
2021-05-13 12:42:24 -07:00
Paul Duffin
17ccf26748 Merge "Add support for converting OptionalPath to Paths" 2021-05-13 19:33:09 +00:00
Paul Duffin
748d954062 Merge "Build boot images in bootclasspath_fragment/platform_bootclasspath" am: 4bbf45faef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690884

Change-Id: I455bd7455192bd6f6ac392d6932310f116038d57
2021-05-13 16:52:11 +00:00
Paul Duffin
4bbf45faef Merge "Build boot images in bootclasspath_fragment/platform_bootclasspath" 2021-05-13 16:32:23 +00:00
Treehugger Robot
66f9ac0d33 Merge "Add support for SOONG_SDK_SNAPSHOT_USE_SRCJAR" am: 820397deb2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1706107

Change-Id: I987da5cdbad7e165251a4fbf1524cd9de77e676a
2021-05-13 16:23:33 +00:00
Treehugger Robot
820397deb2 Merge "Add support for SOONG_SDK_SNAPSHOT_USE_SRCJAR" 2021-05-13 16:00:40 +00:00
Paul Duffin
eb18e84459 Merge "Separate storing config for MakeVars from building boot image" am: f356e5a533
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690882

Change-Id: I55f26ed260006f9e1cf65c505775b0aac2120c8e
2021-05-13 14:24:49 +00:00
Paul Duffin
c088ab8e01 Merge "Make hidden API bootclasspath_fragment test more realistic" am: 7dbfe7c4ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1706746

Change-Id: I41122234294c3e7f7dc6d6171dce14216fda0298
2021-05-13 14:23:30 +00:00
Paul Duffin
f356e5a533 Merge "Separate storing config for MakeVars from building boot image" 2021-05-13 14:01:36 +00:00