Commit Graph

42633 Commits

Author SHA1 Message Date
TreeHugger Robot f38428bf58 Merge "Propagated srcs from cc_defaults to cc_prebuilt_library_shared." into sc-dev am: ffc9ae993a
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15084348

Change-Id: I9f9e775062e086fa36d6b441e12c2de25f51bea1
2021-06-24 00:33:47 +00:00
TreeHugger Robot ffc9ae993a Merge "Propagated srcs from cc_defaults to cc_prebuilt_library_shared." into sc-dev 2021-06-24 00:18:56 +00:00
Evgenii Stepanov c2adacc92f Disable ubsan diagnostics under HWASan. am: e57ca4ccc3
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15083917

Change-Id: I89863cb162a583c1988855c3dfdea2744ca12a9a
2021-06-23 23:48:28 +00:00
Yu-Chi Cheng 24b2b0fd0c Propagated srcs from cc_defaults to cc_prebuilt_library_shared.
Bug: 191185522
Test: verified on local P21 devices.
Change-Id: I3bab7144213934f6832000793ee6cbc49abd3beb
2021-06-23 15:56:39 -07:00
Evgenii Stepanov e57ca4ccc3 Disable ubsan diagnostics under HWASan.
This is a workaround for a compiler bug that makes this combination
extremely slow to build.

Bug: 191808836
Test: m net_test_btm_iso with SANITIZE_TARGET=hwaddress
Merged-In: Ide7436bbc564413cb2f29355ada5286976607205
Change-Id: Ide7436bbc564413cb2f29355ada5286976607205
(cherry picked from commit b15a564869dada75d78f72489fc50138cd314764)
2021-06-23 15:06:00 -07:00
Paul Duffin 10546275df Remove duplicate component from sdk snapshot am: a1aa7387f7
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15080378

Change-Id: I97343a5fbee03efaf36323d9366215adea2c5e3a
2021-06-23 20:32:52 +00:00
Paul Duffin a488b230fb Add commonSdkLibraryAndImportModule interface am: 3accbb5446
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15080377

Change-Id: Ia9f820fa754184e2bb8feabfb5298fa7f3592643
2021-06-23 18:59:49 +00:00
Paul Duffin a1aa7387f7 Remove duplicate component from sdk snapshot
Previously, an sdk snapshot could contain the following:
* A java_sdk_library_import module, e.g. "foo" which creates component
  modules "foo.stubs", etc.
* A corresponding versioned module, e.g. "sdk_foo@current" which
  created component modules "sdk_foo@current.stubs", etc.
* An internal (to the sdk snapshot) java_import for one of "foo"'s
  components, e.g. "sdk_foo.stubs"
* A corresponding versioned module, e.g. "sdk_foo.stubs@current".

That causes a few problems:
1. The "foo.stubs" is duplicated.
2. The names of the components created by the versioned
   java_sdk_library_import are invalid, as they append the component's
   suffix to the version and not the name before the version.

The latter causes problems when building against prebuilts and fixing
that causes the generated snapshot to be invalid because it contains
duplicate definitions of the "sdk_foo.stubs@current" module. One
explicitly in the Android.bp file and one created by the
"sdk_foo@current" module.

Removing the duplicates from the snapshot causes errors as the name
generated by the snapshot for the component module, i.e.
"sdk_foo.stubs@current" does not match the name generated by the
"sdk_foo@current", i.e. "sdk_foo@current.stubs".

This change fixes them together.

Bug: 179354495
Test: m nothing
Change-Id: I515f235fe21755b5275af12366e96c24c94c0273
2021-06-23 17:46:50 +01:00
Paul Duffin 3accbb5446 Add commonSdkLibraryAndImportModule interface
The commonSdkLibraryAndImportModule defines the methods that a module
which embeds the commonToSdkLibraryAndImport struct need to provide.

Bug: 179354495
Test: m nothing
Merged-In: I7a469ae03ea5c19922200284da08a9ae38a46751
Change-Id: I7a469ae03ea5c19922200284da08a9ae38a46751
(cherry picked from commit 71b33cca9d3a589badc714063e47a28b94df31a1)
2021-06-23 17:46:50 +01:00
Paul Duffin bedbd53288 Add test for sdk that contains overlapping members am: 0e7bb0e80a
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15063349

Change-Id: I0c3d1399e3092f52b79b5329ba9ffce20ef394d2
2021-06-23 09:18:41 +00:00
Paul Duffin 5257d5b67b Remove unused apiModuleName am: 0b5a143c32
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15063348

Change-Id: If5b57f74bb0dbcca7eea23ec824563d0e05c2fd8
2021-06-23 09:18:34 +00:00
Paul Duffin 19bef03853 Fix monolithic hidden API processing with prebuilts am: 2a999332ef
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15063347

Change-Id: I0d71dd747b1305f43cec8fe0ad36f8b6f2b3ea10
2021-06-23 09:18:26 +00:00
Paul Duffin 6c6f1b962a Make CheckHiddenAPIRuleInputs more reusable am: 4c2f78bff4
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15063346

Change-Id: I39917308bdd97c3f367293c7be779e21f6c1c8b1
2021-06-23 09:18:19 +00:00
Paul Duffin 8e8ea06d1e Use classpath elements in platform_bootclasspath am: 3ae9e2cef5
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15063345

Change-Id: I36bd687a4014297a604146c3edc860eab3b22b59
2021-06-23 09:18:11 +00:00
Paul Duffin 0e7bb0e80a Add test for sdk that contains overlapping members
This change adds a test for an sdk that includes a java_sdk_library
directly as well as transitively includes one of the component modules
that it creates. It also adds a test for the names of a versioned
java_sdk_library_import's components as fixing one requires fixing the
other.

The use case added is one that does occur in the art-module-sdk. It has
a couple of pairs of java_sdk_library and java_system_modules that
cause both the java_sdk_library and one of its component modules to be
included in the sdk snapshot. That causes problems when building
against prebuilts.

e.g. The art-module-sdk_art.module.public.api.stubs module is a
duplicate of the art.module.public.api.stubs module created by the
art.module.public.api java_sdk_library_import. The former is added
because the art-module-public-api-stubs-system-modules depends on it.

A follow up change will avoid the component being added to the sdk
snapshot separately and instead cause the snapshot to use the
component created by the java_sdk_library_import in the snapshot.

Bug: 179354495
Test: m nothing
Merged-In: Ifdc1b4a5a7968db2ded3fdb7eb02f9cff77c7c3f
Change-Id: Ifdc1b4a5a7968db2ded3fdb7eb02f9cff77c7c3f
(cherry picked from commit 3302871b7d64ea1cfd5c56b7ac76f5c74db4e7fa)
2021-06-22 19:16:28 +01:00
Paul Duffin 0b5a143c32 Remove unused apiModuleName
Bug: 179354495
Test: m nothing
Merged-In: Id1dd09a11c63981b32af524cffcdbd177c8f0232
Change-Id: Id1dd09a11c63981b32af524cffcdbd177c8f0232
(cherry picked from commit 86fe8f851414d3e1ac6c19f3d16114fe318c8d10)
2021-06-22 19:16:28 +01:00
Paul Duffin 2a999332ef Fix monolithic hidden API processing with prebuilts
Prebuilt modules do not provide classesJars containing annotations.
Previously, the monolithic hidden API processing just used classesJars
from all the modules that provided them so when building against
prebuilts would have fewer classesJars than when building against
sources and so would produce different hidden API flags.

This change will generate the monolithic files from both classesJars
and files previously generated from hidden API processing. A fragment
that has performed hidden API processing will contribute its generated
files whereas standalone libraries and fragments which have not
performed hidden API processing will contribute classesJars.

Bug: 177892522
Test: m out/soong/hiddenapi/hiddenapi-flags.csv
      m SOONG_CONFIG_art_module_source_build=false out/soong/hiddenapi/hiddenapi-flags.csv
      - verify that the files are identical whether built from
        source or prebuilts.
Merged-In: I06f3c7df49626bec21a452bc9abf1bb9e7545e5c
Change-Id: I06f3c7df49626bec21a452bc9abf1bb9e7545e5c
(cherry picked from commit d061d40eb6ffbc9d7cece2945b7276fe2f6759d1)
2021-06-22 19:16:27 +01:00
Paul Duffin 4c2f78bff4 Make CheckHiddenAPIRuleInputs more reusable
Adds a message parameter and allows leading spaces in the expected file
string to allow them to be nicely indented.

Bug: 177892522
Test: m nothing
Merged-In: I33df26610738c48879fa0b8250dc377dd04bb07d
Change-Id: I33df26610738c48879fa0b8250dc377dd04bb07d
(cherry picked from commit 51d7da2c4e62eccc5f0fe11cfa8cdf1cf67aa7c7)
2021-06-22 19:16:27 +01:00
Paul Duffin 3ae9e2cef5 Use classpath elements in platform_bootclasspath
Use classpath elements in newMonolithicHiddenAPIInfo. That means the
method can collate information from both fragments and libraries rather
than just fragments. So, this change moves the collation of the
classesJars into the method.

Bug: 177892522
Test: m out/soong/hiddenapi/hiddenapi-flags.csv out/soong/hiddenapi/hiddenapi-index.csv
      - make sure that this change does not affect the contents.
Merged-In: I7c2a229fab60d02bd211438735a8d7303ed83386
Change-Id: I7c2a229fab60d02bd211438735a8d7303ed83386
(cherry picked from commit 89f570ac44af4bcf5b78fa8dad3d57f24cd3ca0e)
2021-06-22 19:16:27 +01:00
TreeHugger Robot 51020266da Merge "Fix bootDexJarByModule with UNSAFE_DISABLE_HIDDENAPI_FLAGS" into sc-dev am: 7b905a3f10
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15053545

Change-Id: I884120fe615e61797f16e3df1e16bbf516b9a7df
2021-06-22 16:30:45 +00:00
TreeHugger Robot 7b905a3f10 Merge "Fix bootDexJarByModule with UNSAFE_DISABLE_HIDDENAPI_FLAGS" into sc-dev 2021-06-22 16:05:09 +00:00
Paul Duffin 33854343f4 Simplify deapexer support am: 034196d9fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15043820

Change-Id: Ia458296066f43192d2a77b25cbaf1537410f53fc
2021-06-22 10:17:28 +00:00
Adrian Roos c618decdab Fix bootDexJarByModule with UNSAFE_DISABLE_HIDDENAPI_FLAGS
Fixes: 191652687
Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true m
Change-Id: I7d85340681e54fbd0da69596b6846eb446c6ec6d
Merged-In: I7d85340681e54fbd0da69596b6846eb446c6ec6d
(cherry picked from commit e95a15e7c791028365f8360ad8915a851f09a3f0)
2021-06-22 12:05:55 +02:00
Paul Duffin 7290b77229 Remove javalib special case in createDeapexerModuleIfNeeded am: 7db57e0a77
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15043819

Change-Id: I941a0c7dee7451996df31a16c2f216af9001348e
2021-06-21 12:05:46 +00:00
Paul Duffin 034196d9fe Simplify deapexer support
Uses the apex relative path to the file as the identifier that is used
to obtain the path to the corresponding file extracted from the apex.
That is instead of a special constructed string id.

Bug: 177892522
Test: m nothing
Merged-In: I5dc77c8fb272bac289b8891d1eac801e541af1f5
Change-Id: I5dc77c8fb272bac289b8891d1eac801e541af1f5
(cherry picked from commit b4bbf2ca10cc8509e3ae0ab104e9e3b55861831b)
2021-06-21 10:54:22 +01:00
Paul Duffin 7db57e0a77 Remove javalib special case in createDeapexerModuleIfNeeded
Removes the special case in createDeapexerModuleIfNeeded for handling
java libraries and just get the Import and SdkLibraryImport module
types to implement RequiredFilesFromPrebuiltApex instead.

Bug: 177892522
Test: m nothing
Merged-In: I5cc341b5b4168b8eb196f72273a00d498de6856f
Change-Id: I5cc341b5b4168b8eb196f72273a00d498de6856f
(cherry picked from commit fef5500a766d1f515ff19038e8e0e8f606e07287)
2021-06-21 10:54:22 +01:00
Paul Duffin 952cf37aa4 Merge "Add ClasspathElement support" into sc-dev am: 062838fcca
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027225

Change-Id: Iddbe68633b0fbcc732f0629488cbab7bc1ee27ee
2021-06-20 18:29:14 +00:00
Paul Duffin f2e652126c Merge "Extract createEntriesForApexFile" into sc-dev am: 1970d6c5ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027224

Change-Id: I5ea3c0f9f00d4018f41ab7f482298314c67dead4
2021-06-20 18:28:38 +00:00
Paul Duffin 062838fcca Merge "Add ClasspathElement support" into sc-dev 2021-06-20 18:06:03 +00:00
Paul Duffin 1970d6c5ce Merge "Extract createEntriesForApexFile" into sc-dev 2021-06-20 18:05:55 +00:00
Nikita Ioffe ee7c4620dc Merge "Set default value of generate_hashtree property to true" into sc-dev am: 5476c95e50
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027218

Change-Id: I8ae27361d19783af8111e6e06cba07546ca0eeb7
2021-06-19 00:25:35 +00:00
Nikita Ioffe 5476c95e50 Merge "Set default value of generate_hashtree property to true" into sc-dev 2021-06-19 00:12:16 +00:00
Paul Duffin 1b147bfc33 Export boot image files from prebuilt_apex/apex_set am: b508405e08
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027898

Change-Id: I11e607a2273eae85cfdf9600f8e4b6940648b9ee
2021-06-18 20:12:35 +00:00
Paul Duffin a4e76447e9 Copy boot dex jars from prebuilt art-bootclasspath-fragment if preferred am: a0089ec78c
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027897

Change-Id: I181fc206673957d70b53ab6c14d9ebc491c76bb8
2021-06-18 20:12:21 +00:00
Paul Duffin 6be215cda7 Exclude jacocoagent from boot jars package check am: 4fd7dc7de0
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027895

Change-Id: Id406b8cafdccbe69fac4e14127fce6f1d357afe9
2021-06-18 20:12:08 +00:00
Paul Duffin d5a0c20b8b Move boot jars package check into platform_bootclasspath am: e11254793d
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027894

Change-Id: I8fbd2f3e533a926a07451c6b73a373117df2f06c
2021-06-18 20:12:07 +00:00
Paul Duffin ac924b5d7d Cleanup bootclasspathFragmentInitContentsFromImage am: 360f8359f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027893

Change-Id: Ic9131f97aad43ec537684bf720b71fa66015c318
2021-06-18 20:11:44 +00:00
Paul Duffin 6eb77d303a Combine hidden API encoding with flag generation am: c75bbcecdb
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027892

Change-Id: I077a75a7a5ff597563bedd4fd9d06073d0d693be
2021-06-18 20:11:15 +00:00
Paul Duffin dc6f5e8765 Copy implementation and header jars to make when possible am: fd53e21098
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027896

Change-Id: Iacd3da316eda75ce87ad9b0e273940f53d5a6c65
2021-06-18 20:11:03 +00:00
Paul Duffin 665032bc0d Make apex variants of prebuilt apex exported modules available in make am: c30aea20a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027891

Change-Id: I117fe9f9c64680b38fcd90d5fbb1bca204d094b7
2021-06-18 20:11:02 +00:00
Paul Duffin 52c4f3a877 Create APEX variant for prebuilt_apex/apex_set am: 5ec165d755
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15027890

Change-Id: I15a2281a18e4c4b920339beb65b5f7ad365b0c36
2021-06-18 20:10:26 +00:00
Paul Duffin f23512fa58 Add ClasspathElement support
The configuration of the bootclasspath, e.g. PRODUCT_BOOT_JARS,
includes libraries that are standalone and libraries that are part of
an APEX. All libraries that are part of an APEX must also be part of a
bootclasspath_fragment. Currently, the libraries and fragments are
handled separately but that is limiting as it does not make it easy to
process all the libraries while treating those from fragments
differently to standalone libraries. That is needed for hidden API
processing as it needs to use classesJars from standalone libraries
but pre-generated flag files from fragments.

This change adds support for ClasspathElements which is represents the
classpath as a whole while differentiating between standalone libraries
and fragments.

Bug: 177892522
Test: m nothing
Merged-In: I7a4adc67164a46079eb8ec0a17fc755044b4949d
Change-Id: I7a4adc67164a46079eb8ec0a17fc755044b4949d
(cherry picked from commit e245b61aa212e70acf0afc71aac03f8412ec5f9d)
2021-06-18 21:02:10 +01:00
Paul Duffin 9dc8c54fc4 Extract createEntriesForApexFile
While this seems like a simple refactoring it does actually fix an
issue. Previously, when the ExtraEntries func was being defined inline
within the for ... loop it used the loop variable "fi". Unfortunately,
that meant that the func created on each iteration ended up using the
value for "fi" that was set on the last iteration.

Extracting the creation of the entry into a separate method means that
each func created gets its own "fi" variable with the correct values.

Bug: 177892522
Test: m SOONG_CONFIG_art_module_source_build=false nothing
      - without this change it reported duplicate rules for apache-xml.jar
        which is the last entry in the art-bootclasspath-fragment. With
        this change it works fine.
Merged-In: Ia063b513f758e1bbe73407c0441b72453f412acf
Change-Id: Ia063b513f758e1bbe73407c0441b72453f412acf
(cherry picked from commit 155c17779c5e5937fa987b81df6697fc3c23607e)
2021-06-18 21:02:10 +01:00
Nikita Ioffe cd3654f9fe Set default value of generate_hashtree property to true
Test: presubmit
Test: m
Bug: 190621617
Change-Id: I546730f168632c5d5d41c686853bde93a8ba7911
Merged-In: I546730f168632c5d5d41c686853bde93a8ba7911
(cherry picked from commit e261ae64e2d72f6b7fab29f513ba00ca50e2ba24)
2021-06-18 15:06:06 +01:00
Paul Duffin b508405e08 Export boot image files from prebuilt_apex/apex_set
Previously, the prebuilt art-bootclasspath-fragment did not provide any
boot image files. That meant it was impossible to build any module that
requires access to those files from prebuilts, e.g. any module that
needs to be dexpreopt-ed.

This change enables that module to retrieve those files from the
prebuilt_apex.

Bug: 177892522
Bug: 189298093
Test: m nothing
      m droid SOONG_CONFIG_art_module_source_build=false SKIP_BOOT_JARS_CHECK=true
      - the previous command does not work but this change does fix one
        of the issues reported.
Merged-In: I1d4d9545172d79282918130df6b9aa55471bffc1
Change-Id: I1d4d9545172d79282918130df6b9aa55471bffc1
(cherry picked from commit 5466a3699c550d1fa67066db48951b765156be4f)
2021-06-18 12:11:17 +01:00
Paul Duffin a0089ec78c Copy boot dex jars from prebuilt art-bootclasspath-fragment if preferred
Previously, the boot dex jars were only copied to the predefined
locations used by the build from the source art-bootclasspath-fragment
if it was preferred, otherwise no files were copied. That caused build
failures when attempting to build with ART prebuilts. This change
copies the files from prebuilts too.

Bug: 177892522
Bug: 189298093
Test: m nothing
      m droid SOONG_CONFIG_art_module_source_build=false SKIP_BOOT_JARS_CHECK=true
      - the previous command does not work but this change does fix one
        of the issues reported.
Merged-In: I35b37355170546daf6ecac2134d1ca9a73d0e3bc
Change-Id: I35b37355170546daf6ecac2134d1ca9a73d0e3bc
(cherry picked from commit ce918b0278628afe4de73b09f73bac777d545b7e)
2021-06-18 12:11:17 +01:00
Paul Duffin 4fd7dc7de0 Exclude jacocoagent from boot jars package check
This replicates the previous behavior when the boot jars package check
was performed by a singleton. When the singleton was removed and the
check was performed by the platform-bootclasspath the logic to exclude
jacocoagent from the list was lost. This change replaces it.

Bug: 191377804
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true check-boot-jars
      - fails without this change passes with this change.
Merged-In: If9eae254045bef9a0c0963213721fc12a9f463cb
Change-Id: If9eae254045bef9a0c0963213721fc12a9f463cb
(cherry picked from commit 7f8721618cbdcd169694d980cd598d0b80ef9629)
2021-06-18 12:11:17 +01:00
Paul Duffin e11254793d Move boot jars package check into platform_bootclasspath
Bug: 177892522
Bug: 189298093
Test: m check-boot-jars
      m SOONG_CONFIG_art_module_source_build=false check-boot-jars
      - Ran both commands with and without java.lang in the
        package_allowed_list.txt
Merged-In: Iba1a881c8f6b6919d5c0c0520eb3073658f3b8d2
Change-Id: Iba1a881c8f6b6919d5c0c0520eb3073658f3b8d2
(cherry picked from commit c8ead41ba9426a31c8ca3d7228991a45ccff6299)
2021-06-18 12:11:17 +01:00
Paul Duffin 360f8359f3 Cleanup bootclasspathFragmentInitContentsFromImage
Removes some unnecessary logic left over from previous changes.

Bug: 177892522
Test: m nothing
Merged-In: Id11e2ea8a647283af1b152b33757132e44dcd6c3
Change-Id: Id11e2ea8a647283af1b152b33757132e44dcd6c3
(cherry picked from commit 58e7586b3d8fffa63b869c421a36c69fdd30a264)
2021-06-18 12:11:17 +01:00
Paul Duffin c75bbcecdb Combine hidden API encoding with flag generation
Previously, the rules to perform hidden API encoding were generated
separately to the rules to perform hidden API flag generation. This
change combines them within the (renamed) produceHiddenAPIOutput()
method and makes the paths to the encoded dex files an output of the
generateHiddenAPIBuildActions method alongside the paths to the
generated flag files.

As encoded dex jars are now an output of the produceHiddenAPIOutput()
method which is implemented for both prebuilts and source
bootclasspath_fragment modules that necessitated the prebuilt also
providing paths to encoded dex files. That in turn required updates to
some of the tests to provide dex files from prebuilt_apex modules.

Similarly, as the produceHiddenAPIOutput() method may not be called
for some bootclasspath_fragment modules as they do not yet provide all
the information needed to perform hidden API encoding then it is
necessary to extract the encoded dex files produced by the modules
themselves. That also required a few changes to tests that did not
previously provide dex files.

Bug: 177892522
Test: m com.android.art
      - check that this change does not change the contents of the apex
        file, i.e. is byte-for-byte identical.
Merged-In: I60996a34d06ed1c87ed244ab3509621999ad86ec
Change-Id: I60996a34d06ed1c87ed244ab3509621999ad86ec
(cherry picked from commit e521881bd45de0306bc2e80d5c746ae361d6ffe2)
2021-06-18 12:11:17 +01:00