Commit Graph

42385 Commits

Author SHA1 Message Date
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
Liz Kammer b6dbc87c97 Define a narrower context for getting arch props
go best practices recommend defining an interface where it is used and
limiting the scope

Test: go test soong tests
Change-Id: I96293ba594d37360b1a8910161477133d4aafdd9
2021-05-14 15:14:40 -04: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 1b3dbb7c7d Merge "Allow shared libraries on bootclasspath" am: b0f20d134f am: 42a9a2ede6 am: 8a9a8ffd2f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707576

Change-Id: I5d9603841e7dd422bcd18e45249556918f724fcc
2021-05-14 18:21:45 +00:00
Bill Peckham a7eec840cc Merge "Fix missing headers for vndk snapshotted libc" am: 054619d198 am: a1ae5530cb am: 94f308c04a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1708168

Change-Id: I7aa49e3be1ca027ef6a16c8cd3c1b378eb512575
2021-05-14 18:21:23 +00:00
Colin Cross 25c60df217 Merge "Add order-only dependency on shared libraries" am: 9debc21ca3 am: 78894a5ab0 am: 690de6069b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707986

Change-Id: Id03071cc3809d0c4212839f6be3fec547ae3a61c
2021-05-14 18:19:52 +00:00
Paul Duffin 8a9a8ffd2f Merge "Allow shared libraries on bootclasspath" am: b0f20d134f am: 42a9a2ede6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707576

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

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

Change-Id: I621d6b50633b130e5db16e3b90f40690fe700e94
2021-05-14 17:50:07 +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 27f8ab9c19 Make hidden API handle jacoco-stubs consistently am: 098c878838 am: 86d7f1ba59 am: 63f7830b71
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707571

Change-Id: I9bf7ab8b354098403a1591622008d6363526015f
2021-05-14 12:52:52 +00:00
Paul Duffin 63f7830b71 Make hidden API handle jacoco-stubs consistently am: 098c878838 am: 86d7f1ba59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707571

Change-Id: I23ba1c6f9d5a06e6a1ea03f201ef2499af5417d1
2021-05-14 12:18:23 +00: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 7102bb1c47 Use java_sdk_library in bootclasspath_fragment contents as stubs am: 34827d4c0e am: e48bebd77d am: 735c0a088c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707567

Change-Id: Ia904dca2a2dcb866db1f25412479273d686b0169
2021-05-14 07:35:22 +00:00
Paul Duffin 37f80999a2 Validate monolithic and modular hidden API flags are consistent am: dfa1083fee am: 02618f854e am: 10e912e02f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705309

Change-Id: I65c4a0ac5e3c3b4ee701efc7c8ba28b7ebe7e344
2021-05-14 07:35:16 +00:00
Paul Duffin 7a73beac0e Generate hidden API flags for a bootclasspath_fragment am: 2fef136885 am: c23b7e4d5b am: d66a44fe65
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705308

Change-Id: I8179467fb3a1d1280e872b843b6faa326e435ce0
2021-05-14 07:35:02 +00:00
Paul Duffin 735c0a088c Use java_sdk_library in bootclasspath_fragment contents as stubs am: 34827d4c0e am: e48bebd77d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707567

Change-Id: Ic590746d95d388c3f5a8df719d57c4587f731c2a
2021-05-14 07:16:52 +00:00
Paul Duffin 10e912e02f Validate monolithic and modular hidden API flags are consistent am: dfa1083fee am: 02618f854e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705309

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

Change-Id: I6a5f1667db83ce176179b520621eb47b074d326b
2021-05-14 07:16:35 +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 a4ec850482 Populate hiddenAPI structure even when not active am: 001e606e5c am: 251bb0cfaf am: e3ab70f204
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707568

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

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

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

Change-Id: I70daf119a679f01ac216b482fa95f6b21c1a64da
2021-05-14 06:25:17 +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 3cf22ccb31 Merge "syntax check to jacoco filters for any build" am: 0589914135 am: 6b968b9531 am: f2f04e4160
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1706576

Change-Id: I6a95529702279a50c095c423f2052b2f5ce01b21
2021-05-14 00:16:14 +00:00