Commit Graph

42519 Commits

Author SHA1 Message Date
Paul Duffin a1c6be19fb Merge "Support removed API members in modular hidden API processing" into sc-dev 2021-05-25 10:25:47 +00:00
Paul Duffin a1522da36b Merge "Support hidden API processing for fragments with dependencies" into sc-dev 2021-05-25 10:25:41 +00:00
Paul Duffin 49eff1d147 Merge changes I5459c56d,I9b5c7c74 into sc-dev
* changes:
  Remove bootclasspathApiInfo
  Fix hidden API flags in com.android.i18n
2021-05-25 10:25:28 +00:00
TreeHugger Robot fa08e19460 Merge changes I9f780b20,I53805737,I7373ba10,Ia5c5f65a into sc-dev
* changes:
  Rename hiddenAPIFlagFileInfo to HiddenAPIInfo
  Separate input to flag generation from hiddenAPIFlagFileInfo
  Separate output of flag generation from hiddenAPIFlagFileInfo
  Separate monolithic hidden API processing from hiddenAPIFlagFileInfo
2021-05-25 10:07:28 +00:00
Paul Duffin 588e22a6bc Tighten bootclasspath_fragment property validation
Previously, due to legacy reasons, the property validation did not
require a contents property and allowed the image_name to be either
"art" or "boot". Those reasons no longer apply and so this change
requires a contents property and only allows the image_name to be set
to "art" if specified.

Bug: 177892522
Test: m nothing
Merged-In: I8855d6e5365ef0b55490e90e7b6c0081cf070ee5
Change-Id: I8855d6e5365ef0b55490e90e7b6c0081cf070ee5
(cherry picked from commit 8018e50ddb141dea7891918c4178a7a394a788d8)
2021-05-25 09:30:20 +01:00
Paul Duffin 0788cd6038 Only export boot image files to APEX if they are actually created
Previously, the generation of the rules to create the boot image files
was separate from the code to provide those files to the APEX which
meant that it was possible for the APEX to try and use files that had
no rules to create them.

This changes avoids that by only exporting the files once the rules
have been created.

This necessitated a few changes to tests that were relying on the
previous behavior. Including removing completely the test that used an
image_name: "boot" as that is no longer a valid configuration name as
its functionality has been replaced by platform_bootclasspath.

A follow up change will make the validation of the properties of
bootclasspath_fragment stricter to prevent "boot" being used as the
image_name.

Bug: 177892522
Bug: 188680624
Test: lunch qemu_trusty_arm64-userdebug
      m droid dist
      - verify that before this change it fails and after this change
        it works.
      m com.android.art
      - verify that this change does not change the APEX contents with
        either qemu_trusty_arm64-userdebug or aosp_arm64-userdebug
Merged-In: I0497a151eb0731cbe6a1a7e7bbbb1e4dda75898f
Change-Id: I0497a151eb0731cbe6a1a7e7bbbb1e4dda75898f
(cherry picked from commit 58e0e769c9b1f4dbad95acfd1792dd91e716e456)
2021-05-25 09:30:20 +01:00
Paul Duffin 973bedb987 Add SOONG_SDK_SNAPSHOT_VERSION support
SOONG_SDK_SNAPSHOT_VERSION=current will generate unversioned and
versioned prebuilts and a versioned snapshot module. This is the
default behavior. The zip file containing the generated snapshot will
be <sdk name>-current.zip.

SOONG_SDK_SNAPSHOT_VERSION=unversioned will generate unversioned
prebuilts only and the zip file containing the generated snapshot will
be <sdk name>.zip.

SOONG_SDK_SNAPSHOT_VERSION=<number> will generate versioned prebuilts
and a versioned snapshot module only. The zip file containing the
generated snapshot will be <sdk name>-<number>.zip.

Bug: 157884619
Test: m nothing
      m SOONG_SDK_SNAPSHOT_VERSION=current art-module-sdk
      - check that the generated Android.bp file has not changed
        from the default.
      m SOONG_SDK_SNAPSHOT_VERSION=none art-module-sdk
      - check that the generated Android.bp file does not contain
        versioned modules.
      m SOONG_SDK_SNAPSHOT_VERSION=2 art-module-sdk
      - check that the generated Android.bp file only contains
        version 2 of each module.
Merged-In: I087e9d7d3ad110508a3d6a39bca50cbb46b3ce82
Change-Id: I087e9d7d3ad110508a3d6a39bca50cbb46b3ce82
(cherry picked from commit 43f7bf0efddb6609c249b87cb9b6d26f62d76e02)
2021-05-25 09:30:19 +01:00
Justin Yun acd459728a Do not filter LLNDK lib from llndk.libraries.txt
llndk.libraries.txt is used to list the LLNDKs for the linkerconfig.
This is also required to define the VNDK snapshot modules of LLNDK
stub libraries.
The list had a filter for hwasan libraries, but the filter must be
used only for the LLNDK_LIBRARIES make variable, but not for the
llndk.libraries.txt file.

Bug: 189070366
Bug: 188716508
Test: m nothing
Test: LLNDK_LIBRARIES in make_vars-*.mk does not include hwasan.
Change-Id: I820dd1161892dc76700aa1d696ea2643764d2052
Merged-In: I820dd1161892dc76700aa1d696ea2643764d2052
(cherry picked from commit 611e886ca73cdab96aaff32b5ff1f86222951dff)
2021-05-25 13:29:48 +09:00
Paul Duffin 54c1f08aa9 Support removed API members in modular hidden API processing
Previously, the hidden API flags generated for a bootclasspath_fragment
did not include removed API members. That was because it did not supply
a file containing the dex signatures of the removed API members.

The monolithic hidden API processing uses combined-removed-dex which is
the output of a genrule that takes as input the *removed.txt files from
all the APIs and uses metalava to construct the dex signatures file.
This change does the equivalent for the *removed.txt files for the APIs
provided by a bootclasspath_fragment and then passes them to the rule
that generates the final all-flags.csv.

Bug: 179354495
Test: - Update packages/modules/RuntimeI18N to enable hidden API
        processing.
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - Before this change that fails as the flags generated for the
        i18n-bootclasspath-fragment differ from the monolithic flags.
	After this change that passes.
      - Verify that this change does not change any of the monolithic
        hidden API files.
      m com.android.i18n
      - Verify that the apex file before and after this change are byte
        for byte identical.
Merged-In: I6a21edb8a5231666e3f35b2c99a8687f36dd98fd
Change-Id: I6a21edb8a5231666e3f35b2c99a8687f36dd98fd
(cherry picked from commit 32cf58a8fcfc043246a9c402b32c863e8aebc499)
2021-05-24 20:26:02 +01:00
Paul Duffin 67c1e57551 Support hidden API processing for fragments with dependencies
Previously, a bootclasspath_fragment that depended on classes provided
by another bootclasspath_fragment did not support hidden API processing
as it would not supply information about those dependencies.

This change adds support for that as follows. Each fragment:
1. Exports the transitive sets of stub dex jars for each of the public,
   system, test and core_platform APIs (where relevant).
2. Adds dependencies onto its dependent fragments.
3. Retrieves the API stubs dex jars from its dependent fragments and
   passes them to the "hiddenapi list" tool which will use them to
   resolve dependencies but will not output them to the generated
   flags.

Once the flags are generated the existing encoding functionality
encodes the flags into the dex files of the bootclasspath_fragment's
content modules which are then packaged into the apex.

Bug: 179354495
Test: m com.android.sdkext
      - verify that this does not change the contents of the apex files
Merged-In: I3e82a6dbb437f1e417e5d7e25aeb212e378603d0
Change-Id: I3e82a6dbb437f1e417e5d7e25aeb212e378603d0
(cherry picked from commit f1b358cb5764039ff7502e9f73ad0abfdc91c7aa)
2021-05-24 20:26:02 +01:00
Paul Duffin 6a58cc94d1 Remove bootclasspathApiInfo
Previously, the bootclasspathApiInfo was only used for tests and follow
up changes will need to provide the stub dex jars. This change moves
the stubJarsByKind into HiddenAPIInfo and removes bootclasspathApiInfo
and the corresponding provider.

Bug: 179354495
Test: m nothing
Merged-In: I5459c56de561c053ed671dc9d5cb3ee4820c0ee8
Change-Id: I5459c56de561c053ed671dc9d5cb3ee4820c0ee8
(cherry picked from commit 18cf19745e2fffb184a7b42f50609ea98d4adb1d)
2021-05-24 18:20:09 +01:00
Paul Duffin 71955b4bc3 Rename hiddenAPIFlagFileInfo to HiddenAPIInfo
This reflects that it has expanded from its initial purpose to include
more than just flag files. It is exported for use in tests in other
packages.

Bug: 179354495
Test: m nothing
Merged-In: I9f780b20e18ce3a774e4aa04a276463070a64c34
Change-Id: I9f780b20e18ce3a774e4aa04a276463070a64c34
(cherry picked from commit af99afa919790cc76a9b1a1947d473065ecb65a5)
2021-05-24 18:20:08 +01:00
Paul Duffin 699a00489e Fix hidden API flags in com.android.i18n
Change 70cfdff3da2ea07cd5cb7f7b91474f6fa0c248e5 changed the hidden API
flags in com.android.i18n as it stopped the i18n-bootclasspath-fragment
from making the hidden API flag files available for use by
platform-bootclasspath.

This change fixes that by exporting the flag files even if hidden API
flag generation is skipped.

Bug: 179354495
Test: m com.android.i18 out/soong/hiddenapi/hiddenapi-flags.csv
      - make sure that the flags in
        packages/modules/RuntimeI18n/apex/hiddenapi/hiddenapi-max-target-o-low-priority.txt
        are reflected in the core-icu4j dex files in the apex.
Merged-In: I9b5c7c74bd996ab447bc0e0452da5fd49191a35d
Change-Id: I9b5c7c74bd996ab447bc0e0452da5fd49191a35d
(cherry picked from commit 62370923911827d0a9cf6103e47652f40ca2cd25)
2021-05-24 18:20:08 +01:00
Paul Duffin 5aadef8ab5 Separate input to flag generation from hiddenAPIFlagFileInfo
Encapsulating the information needed by hidden API processing in a
struct makes it easy to add additional information in future and allows
the code to populate that struct from various different sources to be
grouped together.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Merged-In: I53805737dff36a3ae87aca5aad51cf46ae1361fe
Change-Id: I53805737dff36a3ae87aca5aad51cf46ae1361fe
(cherry picked from commit 1352f7c4715d3d311a2644b9337e4b1028d82cb0)
2021-05-24 18:20:08 +01:00
Paul Duffin cad63842d2 Separate output of flag generation from hiddenAPIFlagFileInfo
HiddenAPIFlagOutput encapsulates the paths to the files produced by the
hidden API flag generation of a single bootclasspath_fragment. It is
returned from hidden API flag generation and is embedded within the
hiddenAPIFlagFileInfo so they can be passed to other modules.

Unlike the fields it replaces in hiddenAPIFlagFileInfo the fields in
HiddenAPIFlagOutput are of type Path not Paths which makes it easier to
use.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Merged-In: I7373ba1001cac3a75eb54a23e62fa52f5013ee7f
Change-Id: I7373ba1001cac3a75eb54a23e62fa52f5013ee7f
(cherry picked from commit 1e6f5c4e633bab71d82eace7bad0f52494ef1839)
2021-05-24 18:20:07 +01:00
Paul Duffin 9e3b906581 Separate monolithic hidden API processing from hiddenAPIFlagFileInfo
The hiddenAPIFlagFileInfo was being used for both the input and output
of bootclasspath_fragment and platform_bootclasspath and also to pass
information around to various hidden API rule methods. Supporting
multiple different uses in this way made it hard to reason about.

This change creates a separate structure for use by the
platform_bootclasspath. Follow up changes will split out other
functionality into separate types.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Merged-In: Ia5c5f65ae5645486c42819c669a8601588217f88
Change-Id: Ia5c5f65ae5645486c42819c669a8601588217f88
(cherry picked from commit 438eb57a2744b9b0bd38a5526e67cacf43c42b31)
2021-05-24 18:20:07 +01:00
Jiyong Park c110a43b92 Update VndkMustUseVendorVariantList after aidl-freeze-api
Bug: 188713899
Test: m
Change-Id: Ib1287208a1c6cfc40e4c01617b64ce05c6c88f6e
2021-05-24 23:51:19 +09:00
satayev 53d0678b57 Rename generate proto config file to match classpath type.
There is no need to leak soong module names.

Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: I04f4e181d2f42b9d71641980a2c7c4e8cbc8e426
Merged-In: I04f4e181d2f42b9d71641980a2c7c4e8cbc8e426
2021-05-24 13:38:45 +01:00
Paul Duffin b40610ad00 Perform hidden API encoding in bootclasspath_fragment
Previously, the apex content info was populated with hidden API encoded
dex jars retrieved directly from the java module. This change retrieves
the unencoded dex jars from the java module, encodes them and then
stores the result in the apex content info.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Merged-In: Ib1b6eb8b62ac50e03b9e0d07c877ca70bb6f6d25
Change-Id: Ib1b6eb8b62ac50e03b9e0d07c877ca70bb6f6d25
(cherry picked from commit 54c98f5b4af1b47b922bd76a4dbf0aca50c2a453)
2021-05-23 18:41:47 +01:00
Paul Duffin ed587c367b Refactor hiddenAPIEncodeDex for use by bootclasspath_fragment
Previously, if the method was called multiple times by the same module
the resulting build rules would all use the same temporary directory
which meant that if run in parallel they would conflict with each
other. This change fixes that by providing a jar specific temporary
directory so it can be used by bootclasspath_fragment to encode its
content modules.

Also, cleans up, simplifies and improves the documentation.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Merged-In: I0ebe61abc8e16111c6e8a822eb96c57846b98461
Change-Id: I0ebe61abc8e16111c6e8a822eb96c57846b98461
(cherry picked from commit 0916595b1c9bf71224b98a6a2fdee941690446f6)
2021-05-23 18:41:47 +01:00
TreeHugger Robot 5ff8e3f567 Merge changes from topic "far-dep-exists" into sc-dev
* changes:
  Check for product variant in addition to core variant.
  Plumb through OtherModuleFarDependencyVariantExists from blueprint.
2021-05-22 12:54:47 +00:00
Pirama Arumuga Nainar dcabea581c [cc/coverage] Define a macro during coverage builds
Bug: http://b/186576313

During a coverage build, pass the __ANDROID_CLANG_COVERAGE__ macro to
native compilations.  This allows tools like dalvikvm and dex2oat, which
would otherwise call _exit(), to write profiles on coverage builds by
calling exit() instead.

Test: `m CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS="art" nothing`
          and check compiler flags in out/soong/build.ninja.
Change-Id: I18315b89170abdd650e4c6c55577688348c42225
(cherry picked from commit 551b06d9e69066baf1b621b20d4b838ac2f28902)
2021-05-21 13:48:41 -07:00
Martin Stjernholm f7a62e6c73 Merge changes I4e7a7ac5,I0c73361b into sc-dev
* changes:
  Record the actual APEXes that a module is part of.
  Rename InApexes -> InApexVariants
2021-05-21 19:22:15 +00:00
Martin Stjernholm 55d7ed4bbf Merge changes I0c80b546,Ibc673303,I70317eb8 into sc-dev
* changes:
  Skip TestDex2oatToolDeps on Darwin.
  Don't fail if the target module is disabled in dex2oat tool dependencies.
  Use oatdump rather than oatdumpd for boot jar boot.*.oatdump.txt files.
2021-05-21 16:00:02 +00:00
Paul Duffin 7555fcbab3 Store dex jar paths in bootclasspath_fragment's apex content info
Previously, the DexBootJarPathForContentModule(module) simply called
directly through to the module to retrieve the dex jar path. This
change changes it so the bootclasspath_fragment retrieves the dex
jars from the module and stores them in the info structure for this
method to retrieve directly.

This makes it easier for the bootclasspath_fragment to stop retrieving
hidden API encoded dex jars from the module and perform the encoding
itself.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Merged-In: Ic79dea080f10f4017f1a75d6d1fb5a3bfe04c2ce
Change-Id: Ic79dea080f10f4017f1a75d6d1fb5a3bfe04c2ce
(cherry picked from commit 1a8010a24171c4ac1928b659f48dc680ee8b0353)
2021-05-21 09:34:53 +01:00
Paul Duffin 0bd5b06209 Move hidden API encoding after resource merging
Previously, the hidden API encoding was done before resource merging.
However, hidden API modularization requires that the encoding be done
by the bootclasspath_fragment/platform_bootclasspath modules which will
be after the resource merging. Therefore, this change moves the hidden
API encoding after to match the future behavior.

It also moves the initHiddenAPI() method call after resource merging
too and passes it the result of the resource merging so it is available
for the bootclasspath modules via bootDexJar().

Although the resource merging was not always done when it was done it
would reorder the entries in the generated jar to match java ordering,
which puts the MANIFEST.MF first. This change preserves that behavior
by adding -j to the call to MergeZipCmds. This does mean that jars
which did not require resource merging now have a different order but
as both orders work that is not a significant change.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that apart from the ordering change in the jars that this does
        not change the contents of the apex files
Merged-In: If74baad5659301ca6ca9c0f6484374420dda8c34
Change-Id: If74baad5659301ca6ca9c0f6484374420dda8c34
(cherry picked from commit 4de94504335e614efcdc4d0d86f1cfad758f83e8)
2021-05-21 09:34:53 +01:00
Bill Peckham 8f37844151 Check for product variant in addition to core variant.
It's possible that a module will have a product variant
but not a core variant. In that case, we still need to
apply the vendor suffix to the androidmk module name.

Bug: 188720375
Bug: 187963715
Test: Build vendor image using vendor snapshot.

Change-Id: I190fdd707ca23357d1c324c1b1f3318457625f03
Merged-In: I190fdd707ca23357d1c324c1b1f3318457625f03
(cherry picked from commit 4016d7b53e70bdf53dfdc93c8a7969f70fe2eb05)
2021-05-21 11:44:45 +09:00
Martin Stjernholm a46656213e Plumb through OtherModuleFarDependencyVariantExists from blueprint.
Test: m nothing
Bug: 188398129
Change-Id: I64147293b6c51b437219e76e9e372fe56b977722
Merged-In: I64147293b6c51b437219e76e9e372fe56b977722
(cherry picked from commit 408ffd8ccadf998a364bfe69aed2faa214853a76)
2021-05-21 11:43:30 +09:00
Justin Yun a42f005bd1 VNDK snapshot may provide LLNDK stub libraries
VNDK snapshots newer than v30 have LLNDK stub libraries. In that
case, the vendor variant for the BOARD_VNDK_VERSION must not be
generated from the LLNDK modules. They are already provided by the
VNDK snapshots.
Generate the vendor variant of the BOARD_VNDK_VERSION only if
BOARD_VNDK_VERSION has an integer value less than or equal to 30.

Bug: 187963715
Bug: 181815415
Test: m nothing
Change-Id: I31e90f4d7e7678c45558f6bf987f5582a4c34f78
Merged-In: I31e90f4d7e7678c45558f6bf987f5582a4c34f78
(cherry picked from commit dee806fd094c81515aa9ec88efd0f594a057afb0)
2021-05-21 08:30:07 +09:00
Artur Satayev da6a90de83 Merge "Populate individual classpath_fragments' classpaths.proto configs." into sc-dev 2021-05-20 22:08:05 +00:00
satayev 95bfbb169f Populate individual classpath_fragments' classpaths.proto configs.
To avoid duplicates on *CLASSPATH environ variables at runtime, remove
split entries from platform-*classpath, i.e. all updatable jars that
have their own classpath fragments should not appear in the
platform-*classpath's classpaths.proto config.

Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: Id2759ab8e106cc183e695bf3509a6ab60ab0ef2a
2021-05-20 19:07:29 +01:00
Jiyong Park 59b9f14173 Record the actual APEXes that a module is part of.
Consider this case:

apex {
    name: "com.android.foo",
    native_libs: ["foo"],
}

override_apex {
    name: "com.mycompany.android.foo",
    base: "com.android.foo",
}

cc_library {
    name: "foo",
}

There are two APEXes defined: "com.android.foo" and
"com.mycompany.android.foo" which is a copy of "com.android.foo" with
some properties overridden (e.g. signing keys).

The module "foo" is mutated into two variants by the apex mutator: the
platform variant and the apex variant. The former has the variation name
"" and the later has "apex<min_api_ver>" which usually is "apex10000".

Internally, the apex variant has an alias "com.android.foo".

ApexInfo.InApexVariants() returns only "com.android.foo" when called for
the module "foo".

We can see that the information that "foo" is also part of
"com.mycompany.android.foo" is completely lost. This is causing problem
when we compare the apex membership by their "soong module name", not
the "apex name". In the example above, the two modules have different
soone module names, but have the same apex name: "com.android.foo".

To fix that, this CL introduces a new field `InApexes` to the `ApexInfo`
struct. It has the actual name of the APEXes that the module is part of.
With the example above, `InApexes` is ["com.android.foo",
"com.mycompany.android.foo"].

Cherry-picked from https://r.android.com/1710529.

Bug: 180325915
Test: m nothing
Test: m nothing on non-AOSP targets with ag/13740887 applied.

Change-Id: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e
Merged-In: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e
2021-05-20 17:36:22 +01:00
Martin Stjernholm 5053baab54 Skip TestDex2oatToolDeps on Darwin.
This fixes https://r.android.com/1711292.

Cherry-picked from https://r.android.com/1713990.

Test: m nothing
Bug: 188647117
Bug: 145934348
Bug: 172480615
Change-Id: I0c80b546a814d799562f374148eae5ca23b0e1f8
Merged-In: I0c80b546a814d799562f374148eae5ca23b0e1f8
2021-05-20 17:36:22 +01:00
Jiyong Park 712e8b5b1b Rename InApexes -> InApexVariants
.. in preparation for the upcoming change. This change doesn't alter any
behavior.

InApexes is a misleading name. People expects that it has the list of
soong module names of the APEXes that a module is part of. So, for
example, `core-oj` is a part of both `com.android.art` and
`com.google.android.art`. However, in reality, that's not true. The
field has `com.android.art` only. This is because the two APEXes
(android and Google) have the same apex name which is `com.android.art`.
That apex name is used in various places like the `apex_available` and
allows us to keep using the same name regardless of whether the APEX is
overridden or not.

However, this is causing problems in some cases where the exact list of
soong module names is required. The upcoming change will add a new field
to handle the case and the new field actually will get the name
'InApexes'. So, the existing field is renamed to a less misleading name
`InApexVariants`.

Cherry-picked from https://r.android.com/1710528.

Bug: 180325915
Test: m nothing

Change-Id: I0c73361b452eddb812acd5ebef5dcedaab382436
Merged-In: I0c73361b452eddb812acd5ebef5dcedaab382436
2021-05-20 17:36:22 +01:00
Martin Stjernholm cae43e1c16 Don't fail if the target module is disabled in dex2oat tool
dependencies.

dexpreopt.RegisterToolDeps runs late after prebuilt dependencies have
been resolved, and there's special code in dex2oatPathFromDep to
resolve the prebuilt from the source module. However, if the source
module is disabled then the dependencies check in validateAndroidModule
will complain, so we need to disable that check in this particular
situation.

Also add a comment to explain why dexpreopt.RegisterToolDeps needs to
run so late.

Cherry-picked from https://r.android.com/1711292.

Test: m nothing
Bug: 145934348
Bug: 172480615
Change-Id: Ibc673303d0336768fa23261a2068e91a08f46a30
Merged-In: Ibc673303d0336768fa23261a2068e91a08f46a30
2021-05-20 17:36:02 +01:00
Martin Stjernholm 244aebd4f8 Use oatdump rather than oatdumpd for boot jar boot.*.oatdump.txt files.
oatdumpd isn't available as a prebuilt.

Cherry-picked from https://r.android.com/1711291.

Test: m SOONG_CONFIG_art_module_source_build=false droid
Bug: 172480615
Change-Id: I70317eb8f253272d629f23063cbe265d556caad3
Merged-In: I70317eb8f253272d629f23063cbe265d556caad3
2021-05-20 17:36:02 +01:00
Luke Huang 0573b316d3 Fix the apex compatible issue on the platform Q
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1710971

Bug: 187907243
Change-Id: If81c03e8d828cb9e421e48d887b06d5e7ab37d5f
(cherry picked from commit 0c96eb74e228c80881bc2ccbcf2a9d2df9643bc5)
Merged-In: I9aceb7ba33baa23d193a6d554e7892a5d5f0effa
2021-05-20 12:53:22 +00:00
Paul Duffin 796421bdf1 Merge "Test dex jar paths provided to apex by bootclasspath_fragment" into sc-dev 2021-05-20 09:38:16 +00:00
Artur Satayev 7334a69ab6 Merge "Use absolute paths in classpaths.proto." into sc-dev 2021-05-20 09:21:39 +00:00
Paul Duffin d90fde3758 Test dex jar paths provided to apex by bootclasspath_fragment
This change adds a test to verify the existing behavior to provide a
baseline against which following changes can be compared.

Bug: 179354495
Test: m nothing
Merged-In: Ib7dadf3e65151f4e925251f7b1a9c099e824ea63
Change-Id: Ib7dadf3e65151f4e925251f7b1a9c099e824ea63
(cherry picked from commit f2fa0b5e8ee57369ac920969071eee2b56cc04db)
2021-05-20 07:56:17 +01:00
TreeHugger Robot b05357c76e Merge "Add usesTargetFiles option in dexpreopt_gen" into sc-dev 2021-05-20 01:28:10 +00:00
Paul Duffin 59db6d4c5d Workaround to make AlwaysUsePrebuiltSdks() work with platform_bootclasspath
The AlwaysUsePrebuiltSdks() causes all java_sdk_library_import modules
to be preferred over the source, i.e. as if they had prefer: true set.
That interacts badly with the work that is being done to integrate the
bootclasspath_fragment/platform_bootclasspath modules into the build.

It would work fine once that integration has been completed but in the
interim it causes problems. e.g. it does not cause a problem in AOSP
because those java_sdk_library_import modules that are affected have
already been integrated into the build properly.

Unfortunately, internally that is not the case because there are
java_sdk_library/java_sdk_library_import modules that still need to
be updated.

Before the java_sdk_library_import can be safely preferred each
java_sdk_library/java_sdk_library_import module that contributes to the
bootclasspath must:
* Be in the contents of matching bootclasspath_fragment and
  prebuilt_bootclasspath_fragment modules.
* Have an apex and one of a prebuilt_apex/apex_set that contains the
  dex implementation jar and lists the prebuilt_bootclasspath_fragment
  name in its exported_bootclasspath_fragments property.

Safely preferred in this context means that the whole build will
continue to work rather than the current situation which is that only
some of the build will work and some will fail if an attempt is
actually made to build it.

Unfortunately, many java_sdk_library_import modules are missing:
* The prebuilt_bootclasspath_fragment.
* The exported_bootclasspath_fragments property on the
  prebuilt_apex/apex_set that contains them.

Together these cause the following symptoms:
1. The java_sdk_library_import does not have a dex implementation jar.
2. The java_sdk_library_import does not have a myapex variant.

These workarounds will avoid Soong reporting build failures. However,
the build will still fail if an attempt is made to build anything
produced by the platform-bootclasspath, e.g. hidden API processing or
a system image.

Bug: 188505921
Bug: 179354495
Test: m TARGET_BUILD_APPS=Calendar
Change-Id: I3226e21cd6a7f9e4d6bbe94e54129ac5e1d4c679
2021-05-19 14:12:45 +00:00
satayev 6bd823241f Use absolute paths in classpaths.proto.
The intention before was to use relative paths to a partition where a
config is defined. However, jars in /system_ext partition are planned to
be declared in /system's classpaths.proto config.

Bug: 180105615
Test: derive_classpath_test, CtsClasspathsTestCases
Change-Id: Icc3e1a903c34187cfcd67a3ae7bc3dd746445c03
Merged-In: Icc3e1a903c34187cfcd67a3ae7bc3dd746445c03
(cherry picked from commit 7d22657c458b7cf7f79cdd3c298bfec13be93533)
2021-05-19 12:22:23 +01:00
Colin Cross 3aec9423fe Don't propagate ASAN through shared library dependencies
Propagating enabling ASAN through shared library dependencies
doesn't make much sense, because only the non-ASAN variant is exposed
to Make, leading to an non-installed dependency.

Bug: 186487510
Test: TestAsan
Change-Id: I7d3f20f2d10beac09c66c6b6dcb7a34a513ff3b8
Merged-In: I7d3f20f2d10beac09c66c6b6dcb7a34a513ff3b8
(cherry picked from commit af98f58242c043b2f96dd6f415b18354af06b473)
2021-05-18 12:27:25 -07:00
TreeHugger Robot 9e06a2bddf Merge "Add systemserverclasspath_fragments property to apex." into sc-dev 2021-05-18 12:45:51 +00:00
Paul Duffin 64816e613d Merge "Add "contents" property to systemserverclasspath_fragment." into sc-dev 2021-05-18 12:19:09 +00:00
Paul Duffin c4a77332af Merge "Move classpaths.proto related info into a separate provider." into sc-dev 2021-05-18 12:19:04 +00:00
Paul Duffin fe07b367ea Merge "Add no-op systemserverclasspath_fragment module." into sc-dev 2021-05-18 12:18:55 +00:00
Paul Duffin 6acb50e5a3 Merge "Make uncompressDex available for use through hiddenAPIModule" into sc-dev 2021-05-18 10:40:43 +00:00
Paul Duffin 1c560dddf3 Merge "Remove hiddenAPI.primary field" into sc-dev 2021-05-18 10:40:37 +00:00