Commit Graph

4943 Commits

Author SHA1 Message Date
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
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
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
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
Artur Satayev 7334a69ab6 Merge "Use absolute paths in classpaths.proto." into sc-dev 2021-05-20 09:21:39 +00: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
satayev 2f45f4eec1 Add systemserverclasspath_fragments property to apex.
- All contents of the fragment are added as java_lib dependencies.
- Generated classpaths.proto is added into etc as required.

Bug: 180105615
Test: m nothing
Merged-In: I8e8e8b019c4ca2909182f205a47deffa946de6da
Change-Id: I8e8e8b019c4ca2909182f205a47deffa946de6da
(cherry picked from commit 333a1732b17887260f2290ffacffffeff760eee5)
2021-05-18 10:37:52 +01:00
satayev 7b182e7177 Add "contents" property to systemserverclasspath_fragment.
Similar to bcp_fragment's contents, this property lists all java library
contributions made by this fragment.

Bug: 180105615
Test: m nothing
Merged-In: Ifb1f54d5db290fffaa31933d15207014bb72d2fb
Change-Id: Ifb1f54d5db290fffaa31933d15207014bb72d2fb
(cherry picked from commit 9366a053da11ba44c9d70671dfac7c294c5427d0)
2021-05-18 10:37:51 +01:00
satayev 72ede0fac5 Move classpaths.proto related info into a separate provider.
The new info struct can be easily shared with systemserverclasspath
fragments.

Bug: 180105615
Test: m nothing
Merged-In: I9986e64fdf19f4168da63c156de3dc9bcafac8d8
Change-Id: I9986e64fdf19f4168da63c156de3dc9bcafac8d8
(cherry picked from commit 14e49130bbeba7d222c8851e2f59710ac0f6eb71)
2021-05-18 10:37:51 +01:00
satayev 0cf6de5ca9 Add no-op systemserverclasspath_fragment module.
This would allow to start introducing these modules for apexes that
contribute to SYSTEMSERVERCLASSPATH.

In follow up, it will be evolved:
- platform_systemserverclasspath would have "fragments" property to
  list all individual systemserverclasspath_fragments;
- systemserverclasspath_fragment would have "contents" property to list
  contibuting java libs;
- systemserverclasspath_fragment would generate non-empty
  classpaths.proto config within individual apexes.

Bug: 180105615
Test: m nothing
Merged-In: Ibaaa3fae5f1eab9a41ceecc1214a53be6bbc8ba6
Change-Id: Ibaaa3fae5f1eab9a41ceecc1214a53be6bbc8ba6
(cherry picked from commit aa86bac2b01f7565f1ea8ec7c88308ef5ed6e7e2)
2021-05-18 10:37:51 +01:00
Paul Duffin 6c6dde04bd Make uncompressDex available for use through hiddenAPIModule
In order for the bootclasspath_fragment to perform dex encoding on its
contents it needs to know whether the dex file is uncompressed or not.
This change makes that information available by passing it to
initHiddenAPI, storing it in hiddenAPI struct and providing access
through the hiddenAPIModule.

Bug: 179354495
Test: m droid
Merged-In: I913416b4836766de194203fd8ed5124b61dfa3dd
Change-Id: I913416b4836766de194203fd8ed5124b61dfa3dd
(cherry picked from commit 1bbd0626f2d83036b4e1225cc51edfea5e4055b7)
2021-05-18 08:00:16 +01:00
Paul Duffin c9e52dbc57 Remove hiddenAPI.primary field
Now that the individual modules no longer participate in the generation
of the monolithic files it is no longer necessary to select a single
primary module to provide the information they need.

Bug: 179354495
Test: m droid
Merged-In: If09796de710927e3e3f2ccecad0b57ca5fce5dc9
Change-Id: If09796de710927e3e3f2ccecad0b57ca5fce5dc9
(cherry picked from commit 45897dd66327c4b1dd578650dc2f7f0ec572539b)
2021-05-18 08:00:02 +01:00
Paul Duffin f88ab95d85 Merge initHiddenAPI and hiddenAPIUpdatePaths
These two methods did very similar jobs and merging them together
simplifies the behavior.

Bug: 179354495
Test: m droid
Merged-In: Ibe1a23d54105e6a0e5693079cd8743679301fc85
Change-Id: Ibe1a23d54105e6a0e5693079cd8743679301fc85
(cherry picked from commit 74d18d1d6ff1ad8ec47c34182d1a22945e05e9d5)
2021-05-18 07:59:52 +01:00
Paul Duffin 59190602af Remove configurationName from java library and hidden API
The configurationName was intended to separate the name of the module
from the name used in configuration (such as BootJars) so that the
child implementation library of a java_sdk_library on the bootclasspath
would have hidden API encoding performed on it just as for the main
java_library embedded within the java_sdk_library.

While that did use to work it no longer does as the test added in the
preceding change proves. It is not surprising that this regression does
not appear to have caused any issues as the the child implementation
library is only a build time artifact and not used at runtime.

In future the only modules that will require hidden API encoding are
those that are part of a bootclasspath module so there is no point in
maintaining this capability.

Bug: 179354495
Test: m droid
Merged-In: Ief8136fa9e98600cdd8d36108ec22edc2ebd7c69
Change-Id: Ief8136fa9e98600cdd8d36108ec22edc2ebd7c69
(cherry picked from commit 66cdbf07ef2af6caf42e2c7b77b1a5fb86a4cee3)
2021-05-18 07:59:41 +01:00
Paul Duffin 78fc68695e Add a test for hidden API encoding of java_sdk_library
Fill a hole in the testing of hidden API encoding. Some comments in the
code indicate that the child implementation java_library of a
java_sdk_library should have hidden API flags encoded in its dex jar
just like the embedded java_library. However, this test proves that it
is not working. This will be fixed in a follow up change.

Bug: 179354495
Test: m nothing
Merged-In: Ia581a17f1e48dff252d17f16bf76adf039f46b60
Change-Id: Ia581a17f1e48dff252d17f16bf76adf039f46b60
(cherry picked from commit 0d586581d1c2d6d22e7f00007e50e579ca90df29)
2021-05-18 07:59:29 +01:00
Jeongik Cha 036f8f5e8d Add usesTargetFiles option in dexpreopt_gen
For running dex2oat on the target_files, the paths should be use the
device install path instead of the path starting with $(OUT).
So add usesTargetFiles option and basePath option which indicates
extracted path. With those options, the path is replaced with
$(basePath)/$(device path)

And also, add DexPreoptImageDeviceLocations in the config which refers
to the boot image path(without arch) on the device. Because
DexPreoptImage related device path was missing.

Bug: 158843648
Test: dexpreopt_gen -usesTargetFiles -basePath (extract path) and then
check if paths in the generated shell script are based on on-device
path.

Change-Id: I9667fadbf3b7c6f770e0d1bcbee5d67c1ecd8a3d
Merged-In: I9667fadbf3b7c6f770e0d1bcbee5d67c1ecd8a3d
(cherry picked from commit 4dda75e73e3e52e11b1cd37af33645fcfe5ed980)
2021-05-18 12:09:28 +09:00
Paul Duffin 460952c7f4 Add temporary restriction on hidden API processing
Hidden API processing of a bootclasspath_fragment requires the fragment
provides information, such as dependencies on other fragments and flag
files to override the default flags. Failing to do so will cause hidden
API generation to either fail or to generate different flags to that
generated by the hidden API processing done by platform_bootclasspath
which will cause the build to fail.

Previously, this was handled by only performing hidden API processing
for those modules that provide stub libs and relied on there only being
bootclasspath_fragments defined for ART (which already supports hidden
API processing), and Conscrypt and I18n neither of which provide stubs.
Unfortunately, that can no longer be relied upon due to a couple of
recent changes:
1. A java_sdk_library in a bootclasspath_fragment's content property is
   automatically treated a stub library. That avoids duplication for
   most bootclasspath_fragments that provide the implementation and
   stub libraries through the same java_sdk_library. It does not affect
   either ART, conscrypt or i18n as they all define the implementation
   separately to the stubs.

2. bootclasspath_fragment modules have been defined for a number of
   android modules as they are needed for reasons other than hidden API
   processing.

In combination this meant that rules to perform hidden API processing
were being created but they were not currently being used which is
good because they fail.

However, adding the fragment to the platform-bootclasspath will cause
those rules to be used as the platform_bootclasspath module performs a
consistency check on the hidden API flags generated by each of the
fragments to ensure that they are consistent with those it generates
itself.

The dynamic bootclasspath work will need to add fragments to the
platform_bootclasspath and without this change that would be blocked
until all fragments had been switched to generating hidden API flags
properly.

This change adds a new fragments property to the bootclasspath and
disables hidden API processing for everything other than ART and tests
if the fragments property or stub libs is empty.

Bug: 179354495
Test: - Before making this change.
      - Add com.android.os.statds-bootclasspath-fragment to platform-bootclasspath.fragments
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - hidden API processing fails in statsd as it cannot find java.lang.Object.
      - After making this change, run the above command again and it should pass.

Merged-In: Ifbb362f8fcfb2c06595fbd5ae39421b536e329ef
Change-Id: Ifbb362f8fcfb2c06595fbd5ae39421b536e329ef
(cherry picked from commit 70cfdff3da2ea07cd5cb7f7b91474f6fa0c248e5)
2021-05-17 21:30:03 +01:00
Paul Duffin 20042da220 Merge "Refactor special handling of hidden API encoding for master-art" am: fdd9743609 am: 1b5e8cdbee am: 23b34baa5c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707569

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

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

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

Change-Id: I584f17bd5ee9092730d4e37c5b34233805dd6b1a
2021-05-14 19:52:33 +00:00
Paul Duffin 23b34baa5c Merge "Refactor special handling of hidden API encoding for master-art" am: fdd9743609 am: 1b5e8cdbee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1707569

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

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

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

Change-Id: Ib9a86e05001db3571b1be5ebb851fa5aa63af044
2021-05-14 19:33:15 +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 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
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
Paul Duffin b0f20d134f Merge "Allow shared libraries on bootclasspath" 2021-05-14 17:03:03 +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 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 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 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
Yuntao Xu f2f04e4160 Merge "syntax check to jacoco filters for any build" am: 0589914135 am: 6b968b9531
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1706576

Change-Id: Iaceecc8c587231aa3bed8b7f661c1ebfc2abc8df
2021-05-13 23:59:44 +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
Paul Duffin f3042faefe Add java_sdk_library in bootclasspath_fragment contents to sdk am: a10bd3c127 am: 94a452c768 am: 58fcebb1a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705470

Change-Id: I673fd870c37f11966c4914c033ab8f96b8ece825
2021-05-13 23:23:42 +00:00
Yuntao Xu 0589914135 Merge "syntax check to jacoco filters for any build" 2021-05-13 23:11:48 +00:00
Paul Duffin 58fcebb1a7 Add java_sdk_library in bootclasspath_fragment contents to sdk am: a10bd3c127 am: 94a452c768
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705470

Change-Id: I611119b71b2087c37250968024278ce938cfe04a
2021-05-13 23:05:14 +00: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
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 39ca8223ae Merge "Build boot images in bootclasspath_fragment/platform_bootclasspath" am: 4bbf45faef am: 748d954062 am: 57610650d1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690884

Change-Id: I314c01f74f2fe58576d66c1979a1d1ca14f5cad6
2021-05-13 17:09:17 +00:00
Treehugger Robot 648d0fab59 Merge "Add support for SOONG_SDK_SNAPSHOT_USE_SRCJAR" am: 820397deb2 am: 66f9ac0d33 am: c0de64161c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1706107

Change-Id: I69d8f0ed2459d8722c620d3a9984363318fd5ec2
2021-05-13 17:09:10 +00:00
Paul Duffin 57610650d1 Merge "Build boot images in bootclasspath_fragment/platform_bootclasspath" am: 4bbf45faef am: 748d954062
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690884

Change-Id: Ifa764af1894637846631c9aba05128f7f307df0d
2021-05-13 16:52:54 +00:00
Treehugger Robot c0de64161c Merge "Add support for SOONG_SDK_SNAPSHOT_USE_SRCJAR" am: 820397deb2 am: 66f9ac0d33
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1706107

Change-Id: Id4649acc8899ce6a25fbcdc16fc6c688fa9f4f73
2021-05-13 16:52:37 +00:00
Paul Duffin 4bbf45faef Merge "Build boot images in bootclasspath_fragment/platform_bootclasspath" 2021-05-13 16:32:23 +00:00
Treehugger Robot 820397deb2 Merge "Add support for SOONG_SDK_SNAPSHOT_USE_SRCJAR" 2021-05-13 16:00:40 +00:00
Paul Duffin da21f0e88c Merge "Separate storing config for MakeVars from building boot image" am: f356e5a533 am: eb18e84459 am: 443d6ab74b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690882

Change-Id: I3c09cc7cc1c1b56db2e9e806134472863f6a8f19
2021-05-13 14:53:59 +00:00
Paul Duffin 443d6ab74b Merge "Separate storing config for MakeVars from building boot image" am: f356e5a533 am: eb18e84459
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690882

Change-Id: I13f7019e51915305453cc9c5da4cb6c7cc393a71
2021-05-13 14:36:55 +00:00
Paul Duffin f356e5a533 Merge "Separate storing config for MakeVars from building boot image" 2021-05-13 14:01:36 +00:00
Paul Duffin 8a08117373 Merge "Move copying of dex files from dexpreopt_bootjars singleton" am: cfd24da1f4 am: 7be9378c61 am: 817187082c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690881

Change-Id: If03ec0c3263413d2c88d91d510752d6bb3d4de80
2021-05-13 11:52:25 +00:00
Paul Duffin 817187082c Merge "Move copying of dex files from dexpreopt_bootjars singleton" am: cfd24da1f4 am: 7be9378c61
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690881

Change-Id: I75aa39288ab8f7350d7844c7e4dd262c635746d6
2021-05-13 11:35:04 +00:00
Paul Duffin cfd24da1f4 Merge "Move copying of dex files from dexpreopt_bootjars singleton" 2021-05-13 10:53:51 +00:00
Paul Duffin 22628d50f3 Add support for SOONG_SDK_SNAPSHOT_USE_SRCJAR
Test: m SOONG_SDK_SNAPSHOT_USE_SRCJAR=true ipsec-module-sdk
      - check generated snapshot.zip file.
Change-Id: I02991e2a60d7784984b308cff2c47ee809d61f01
2021-05-12 23:13:22 +01:00
Ivan Lozano a072c5ae56 Merge "Refactor vendor snapshot to use LinkableInterface." am: 7ce2dee09e am: 61c475060a am: 001c11e93a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680606

Change-Id: Ifff15886dba6bda0754d086456a1db3b7524e4ed
2021-05-12 21:13:41 +00:00
Ivan Lozano 001c11e93a Merge "Refactor vendor snapshot to use LinkableInterface." am: 7ce2dee09e am: 61c475060a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680606

Change-Id: I2826cb9898e093f5669700c8d98e314b445ee639
2021-05-12 20:55:58 +00:00
Paul Duffin 2fc82ad044 Build boot images in bootclasspath_fragment/platform_bootclasspath
Moves the building of boot images from the dexpreopt_bootjars singleton
to the bootclasspath_fragment and platform_bootclasspath.

The art boot image is generated by the art-bootclasspath-fragment
module and the framework boot image by the platform-bootclasspath
module.

This does temporarly duplicate the generation of an identical boot
profile for each image. As part of the work to modularize the boot
image profile each image will have its own custom default boot profile.

Bug: 177892522
Bug: 186455808
Test: m droid and TreeHugger
Change-Id: I23cf05ec7648749b21c7cf6fcba282b46649a981
2021-05-12 21:51:27 +01:00
Paul Duffin 47932935e9 Separate storing config for MakeVars from building boot image
Previously, the initialization of the dexpreoptBootJars fields used to
store information needed in its MakeVars method was interleaved with
the calls to buildBootImage(). In fact those fields were initialized
from the *bootImageConfig returned by buildBootImage(). However, the
method simply returned the *bootImageConfig value that was passed in.

Separating the initialization from the calls to buildBootImage() allows
the functionality to be moved to platform_bootclasspath separately.

Bug: 177892522
Test: m nothing
Change-Id: I8ba460f60be553516de5f186e14377bb0ec1b2cd
2021-05-12 21:51:27 +01:00
Paul Duffin 7ebebfd5f8 Move copying of dex files from dexpreopt_bootjars singleton
The art dex files are copied in the bootclasspath_fragment and the
non-updatable and updatable dex files are copied in the
platform_bootclasspath.

Bug: 177892522
Test: m nothing
Change-Id: I5d3d533d1a7a9f8e7ae20c12eb33029a898a2cd6
2021-05-12 21:51:19 +01:00
Ivan Lozano d7586b6526 Refactor vendor snapshot to use LinkableInterface.
Refactors the vendor snapshot support to use the LinkableInterface
so that support can be extended to Rust. This CL does not add
vendor snapshot support for Rust; that is left for a follow-on CL.

Bug: 184042776
Test: m nothing
Change-Id: Id0c4970ca00053484a52677d182153cbc454c301
2021-05-12 14:01:10 -04:00
Jaewoong Jung 310e197d6d Merge "Strict updatability linting against dependencies." am: ccbbeb6965 am: 9319584fad am: bcaf0e855b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1702008

Change-Id: Ie02a46af6665bd6158a4bc1acd72be5d129d0854
2021-05-11 16:34:54 +00:00
Jaewoong Jung bcaf0e855b Merge "Strict updatability linting against dependencies." am: ccbbeb6965 am: 9319584fad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1702008

Change-Id: I9f334ee36a091a02b8df1a7493299675c656ed5a
2021-05-11 16:10:22 +00:00
Jaewoong Jung ccbbeb6965 Merge "Strict updatability linting against dependencies." 2021-05-11 15:24:06 +00:00
Treehugger Robot ddcf758f8c Merge "Generate empty classpaths.proto for bootclasspath_fragment.go." am: a556647c50 am: 3e51be492f am: 613e4c502a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699193

Change-Id: Ia92df6204946e3e28341cd27a75d108b657754cc
2021-05-11 13:44:08 +00:00
Treehugger Robot 613e4c502a Merge "Generate empty classpaths.proto for bootclasspath_fragment.go." am: a556647c50 am: 3e51be492f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699193

Change-Id: Ia3e193863fffc4222edd3ddc908a5f489f1e7a61
2021-05-11 13:27:02 +00:00
satayev 3db3547d1f Generate empty classpaths.proto for bootclasspath_fragment.go.
- Adds all required details for bootclasspath_fragment to implement
  classpath_fragment.
- Keeps the actual boot jars in platform-bootclasspath to begin with.
- Makes sure to put the file in apex/etc/classpath on device. Note that
  for platform versions of classpath fragment AndroidMkEntries perform
  the installation, while for APEXes it must be plumbed via apex.go.

Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: I6101ebdf5b8bcbe95c0b7ce21f3f67a2685aef50
2021-05-11 10:34:47 +01:00
Jaewoong Jung 476b9d6d17 Strict updatability linting against dependencies.
Propagate strict_updatability_linting to transitive dependencies using a
top-down mutator.

Test: lint_test.go
Bug: 182349282
Change-Id: Ifc9e58f1a597e3c7725ee49b4027afb6f42f45cb
2021-05-10 15:30:00 -07:00
Treehugger Robot 8c112087cb Merge "Rename fields in dexpreopt config" am: 564fce4578 am: f8f3b93130 am: 517f7ba95b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699427

Change-Id: Iadeefe9966ca6b3ce5815befc6f6616c87a7c26b
2021-05-08 02:45:56 +00:00
Treehugger Robot 517f7ba95b Merge "Rename fields in dexpreopt config" am: 564fce4578 am: f8f3b93130
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699427

Change-Id: I6614ad3de51e09cd74ef0b75e31bfca3ac116cb5
2021-05-08 02:27:10 +00:00
Treehugger Robot 564fce4578 Merge "Rename fields in dexpreopt config" 2021-05-08 01:47:39 +00:00
satayev 4cb335b3e5 Merge "Declare ConfiguredJarList in specific fragment implementations." am: ee7e359131 am: 4c58850bbf am: 01ac28b3bb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699192

Change-Id: Id0913f243c279cd8d64982d3b8fe16c66b3b3fae
2021-05-07 20:51:15 +00:00
satayev 01ac28b3bb Merge "Declare ConfiguredJarList in specific fragment implementations." am: ee7e359131 am: 4c58850bbf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699192

Change-Id: Ief67bfa6e112726d610acc30547b3526d563bce0
2021-05-07 20:29:12 +00:00
satayev ee7e359131 Merge "Declare ConfiguredJarList in specific fragment implementations." 2021-05-07 19:41:08 +00:00
Treehugger Robot 4fe97969e7 Merge "Split SYSTEMSERVERCLASSPATH entries from platform_bootclasspath." am: 3b755d4560 am: afa1bff5aa am: 1ba4987c0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689755

Change-Id: Id30b2f1354e36af0183b814c4f93fbc620345738
2021-05-07 19:13:59 +00:00
Treehugger Robot 1ba4987c0e Merge "Split SYSTEMSERVERCLASSPATH entries from platform_bootclasspath." am: 3b755d4560 am: afa1bff5aa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689755

Change-Id: I6346fe8c962441bebd49bb007f888e3577a94cbe
2021-05-07 18:49:22 +00:00
Treehugger Robot 3b755d4560 Merge "Split SYSTEMSERVERCLASSPATH entries from platform_bootclasspath." 2021-05-07 18:34:52 +00:00
satayev 013485bd83 Declare ConfiguredJarList in specific fragment implementations.
Each specific classpath_fragment module knows what jars must be part
of the corresponding classpaths.proto config.

Note that bootclasspath_fragment does not implement classpath_fragment
yet, thus all boot jars and all system server jars go into corresponding
platform classpaths.

Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: I6a8c7b0a5d17d62e790a441b8e2c5c1a816e7f30
2021-05-07 16:31:07 +01:00
Paul Duffin 5e1308f1a4 Merge "Install updatable-bcp-packages.txt and boot-image.bprof" am: 225e4dbae4 am: 655970204c am: 690697082b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699203

Change-Id: I9d9dd64c8ba4c2512403a647c322964f225d35d9
2021-05-07 15:24:38 +00:00
Paul Duffin 690697082b Merge "Install updatable-bcp-packages.txt and boot-image.bprof" am: 225e4dbae4 am: 655970204c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699203

Change-Id: I4954e75a300a11f86a20e7113afaeec107295faf
2021-05-07 15:04:51 +00:00
Paul Duffin fc84067bd3 Merge "Stop exporting java_sdk_library libs in the snapshot" am: 320055eb8c am: 78ff835a32 am: 2e4abd4a58
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697676

Change-Id: If10f3212b75bd6aca4126c633fce3f66fd3da40f
2021-05-07 14:21:56 +00:00
Paul Duffin 225e4dbae4 Merge "Install updatable-bcp-packages.txt and boot-image.bprof" 2021-05-07 14:14:20 +00:00
Paul Duffin 2e4abd4a58 Merge "Stop exporting java_sdk_library libs in the snapshot" am: 320055eb8c am: 78ff835a32
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697676

Change-Id: I309abc61fb11075093214df29eda9ef1d44cd595
2021-05-07 14:05:10 +00:00
Paul Duffin 320055eb8c Merge "Stop exporting java_sdk_library libs in the snapshot" 2021-05-07 13:34:33 +00:00
Paul Duffin c05cbcebb5 Merge "Make all SdkMemberTypes support transitive member deps" am: dbb490359a am: e1fab6a30b am: 8d108bac17
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699188

Change-Id: I65568bd7614795269017f59c0e3e3f28ef9b91eb
2021-05-07 13:03:34 +00:00
Paul Duffin 668b463729 Merge "Add missing calls to InitSdkAwareModule" am: 820ed78954 am: c74ff5cae5 am: 33334e65b7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699185

Change-Id: I905acd55de919d38a0248d32b5daabf8452e9d23
2021-05-07 13:03:15 +00:00
Paul Duffin 8d108bac17 Merge "Make all SdkMemberTypes support transitive member deps" am: dbb490359a am: e1fab6a30b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699188

Change-Id: Ia82883e6085db6f19ed5c5307b78e72959cd4da2
2021-05-07 12:44:10 +00:00
Paul Duffin 33334e65b7 Merge "Add missing calls to InitSdkAwareModule" am: 820ed78954 am: c74ff5cae5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699185

Change-Id: I4bf1ee3640bab68d7c38079e71eec25f212a84c3
2021-05-07 12:43:54 +00:00
Jeongik Cha a596909342 Rename fields in dexpreopt config
Add 'host' into the name of fields regarding path on the host side to
distinguish between paths on the device(which will be added in the
following commit), and paths on the host.

Bug: 158843648
Test: build and flash, and then
  adb wait-for-device \
    && adb -s $S root \
    && adb -s $S logcat \
    | grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C 1
Change-Id: Ib2645ed51591ba2f4b726c115b401ad2bd6675da
2021-05-07 21:40:23 +09:00
Paul Duffin dbb490359a Merge "Make all SdkMemberTypes support transitive member deps" 2021-05-07 12:31:15 +00:00
satayev 95e9c5bbfa Split SYSTEMSERVERCLASSPATH entries from platform_bootclasspath.
Boot jars are different to system server jars at build level, due to
added complexity of dexpreopt. As a logical separation add a new
classpath fragment type and split existing classpaths.proto generation
into relevant pieces.

Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: I88bec09fc920166ffd0092faef980754ddeb6593
2021-05-07 13:24:16 +01:00
Paul Duffin 820ed78954 Merge "Add missing calls to InitSdkAwareModule" 2021-05-07 12:15:16 +00:00
Paul Duffin be007d1800 Install updatable-bcp-packages.txt and boot-image.bprof
Previous refactorings of the code for creating these two files caused
them to be created before the boot.prof file instead of afterwards. As
a result even though they were appended to the list of files to install
they were discarded when the boot.prof file set the list rather than
appended to it. That worked before the refactoring because the
boot.prof file set the list first before the others were appended to
it.

This change appends the boot.prof file to the list making the order in
which they are added irrelevant.

Bug: 187494247
Test: m nothing
      - check DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED in generated
        make_vars file to ensure it includes all 3 files.
Change-Id: Idb94531daf61b1b047c72eb5c67a57d3fdced05c
2021-05-07 13:07:34 +01:00
Paul Duffin f93ca54858 Merge "Transitively add APEX variants for contents of prebuilt_apex/apex_set" am: c76155cd71 am: c8e88cf3f7 am: 85e40bba2c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697056

Change-Id: Ieed47b213f67248c1bc13957036c1037c356789b
2021-05-07 09:15:50 +00:00
Paul Duffin 85e40bba2c Merge "Transitively add APEX variants for contents of prebuilt_apex/apex_set" am: c76155cd71 am: c8e88cf3f7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697056

Change-Id: I25aaada86866e4a869972a106d07a8e7c9208f68
2021-05-07 09:00:35 +00:00
Paul Duffin b17d044628 Transitively add APEX variants for contents of prebuilt_apex/apex_set
This is part of the work needed to allow the exported_java_libs
property to be replaced by exported_bootclasspath_fragments.

Bug: 187266082
Test: m nothing
      m SOONG_CONFIG_art_module_source_build=false nothing
Change-Id: I2c1d70a390200b93163f9799719290c9d55a041c
2021-05-06 23:43:43 +01:00
Paul Duffin e7c94a689b Stop exporting java_sdk_library libs in the snapshot
The libs property in java_sdk_library is not safe to export as it can
contain libraries that contain implementation specific classes. No
snapshot appears to need this capability but if it does become
necessary then either it will need to use the existing stub_only_libs
property or a new one will need to be added.

Bug: 157884619
Test: m nothing
Change-Id: I60a069177dbee4070d311b23d25f4eb3c5e7ea13
2021-05-06 23:22:15 +01:00
Paul Duffin 2d3da31d41 Make all SdkMemberTypes support transitive member deps
Previously, only those SdkMemberTypes which had specific need to
automatically add some of their dependencies as sdk members would cause
the sdk to visit their transitive dependencies. However, as any module
can have dependencies on license modules and license modules need to be
included in the sdk then it needs to visit transitive dependencies of
all members.

So, this change removes the support for allowing an SdkMemberType to
control whether its transitive dependencies are visited and just visits
them all.

This does not have any effect on sdk snapshots as in order for a
dependency to be added to an sdk it needs to be added with a tag that
implements SdkMemberTypeDependencyTag and the only tags that implement
this are used by SdkMemberTypes that had enabled transitive members.

Bug: 181569894
Test: m art-module-sdk art-module-host-exports art-module-test-exports
      - verify that this change has no effect on the generated snapshots
Change-Id: If0293af0237aa7e39335e5b8383a41c023ff5853
2021-05-06 23:13:06 +01:00
Paul Duffin b6b89a4074 Add missing calls to InitSdkAwareModule
A follow up change will add methods to SdkBase which requires its
module field to have been initialized.

Bug: 181569894
Test: m nothing
Change-Id: I9b02f260ad3f82316cc7ab3b5717b7e81090b0d8
2021-05-06 23:13:06 +01:00
satayev 9428cfec39 Rename classpath_fragment.go methods for better readability. am: 128ce2ff73 am: 0309f55c23 am: b2f4c1919b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697680

Change-Id: I3925effc85faa254f9f684919a6f7a0c47e9ea52
2021-05-06 15:09:32 +00:00
satayev b2f4c1919b Rename classpath_fragment.go methods for better readability. am: 128ce2ff73 am: 0309f55c23
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697680

Change-Id: Id7792fd28b5b8904cdbe1b3cefbd3546fee13277
2021-05-06 14:52:55 +00:00
satayev 128ce2ff73 Rename classpath_fragment.go methods for better readability.
Bug: 180105615
Test: m nothing
Change-Id: Ic663c22e5b7cbab487dc1fe99805e08843c3213d
2021-05-06 13:27:28 +01:00
satayev ff97fc5f87 Merge "Make SystemServerJars ConfiguredJarList." am: 63bc30fc12 am: fb5c5cd8ee am: 0caa3a31f1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1695707

Change-Id: I092ce2214e749870d0298b53ea925ba77b6b4f03
2021-05-06 12:24:59 +00:00
satayev 0caa3a31f1 Merge "Make SystemServerJars ConfiguredJarList." am: 63bc30fc12 am: fb5c5cd8ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1695707

Change-Id: Iac71d56beab3b106a20275867034e871b00a974c
2021-05-06 12:09:30 +00:00
satayev 63bc30fc12 Merge "Make SystemServerJars ConfiguredJarList." 2021-05-06 11:32:39 +00:00
Anton Hansson 65b1fcbd30 Merge "Move stub providers to droidstubs.go" am: 93e8f79577 am: 6e2cb706a9 am: 1c7a3af8e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697050

Change-Id: Ia78cd777b640ec199e83124303b4969712ab0d98
2021-05-05 14:25:35 +00:00
Anton Hansson 1c7a3af8e9 Merge "Move stub providers to droidstubs.go" am: 93e8f79577 am: 6e2cb706a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697050

Change-Id: I4ba9fb69d07b6ce5c7d7bed21b0d2a10e20b019c
2021-05-05 14:07:10 +00:00
satayev 9a6f87ebd6 Make SystemServerJars ConfiguredJarList.
Consistent with plumbing of boot jars. SystemServerJars only support /system/framework/ jars.

Bug: 180105615, 155630745
Test: m && launch_cvd
Change-Id: I58b005b7c4103c8e250090e995b1d9b2f9ed4a76
2021-05-05 14:24:02 +01:00
Anton Hansson 93e8f79577 Merge "Move stub providers to droidstubs.go" 2021-05-05 13:17:37 +00:00
Anton Hansson 5260932812 Move stub providers to droidstubs.go
They fit better there than in droiddoc.go.

Test: m nothing
Change-Id: I44588f1df2094f14881f920246bd19ffc6e1615c
2021-05-05 10:36:05 +01:00
Paul Duffin df2363886c Support dex_import on platform_bootclasspath am: 4977540bcb am: d40a947de4 am: 07ec76efa9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690875

Change-Id: Ib5b1708ff780fb2eb485752dc97531b5df10324d
2021-05-04 18:39:55 +00:00
Paul Duffin 07ec76efa9 Support dex_import on platform_bootclasspath am: 4977540bcb am: d40a947de4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690875

Change-Id: I0b3db8fc192526b65aeecf406adceb2a37339002
2021-05-04 18:12:26 +00:00
Paul Duffin 4977540bcb Support dex_import on platform_bootclasspath
Maintain compatibility with previous behavior by ignoring dex_import
during hidden API processing.

Bug: 179354495
Test: m nothing
Change-Id: I976b02129bf981b7b61dce233567d6f89e04f92d
2021-05-04 14:07:23 +01:00
Colin Cross f66d8c85fc Merge changes If6996bd8,I91df5c3f am: b55ceca568 am: f40a872210 am: 57230dd2a0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1691595

Change-Id: I4b96418a2f4079b9d493fe8039f785a9cb1e0e1b
2021-05-04 00:05:16 +00:00
Colin Cross 57230dd2a0 Merge changes If6996bd8,I91df5c3f am: b55ceca568 am: f40a872210
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1691595

Change-Id: I1590eed9ebbfe556383a15f142f2782076492869
2021-05-03 23:49:34 +00:00
Colin Cross 29c294b2cf Time out and dump stacks from R8 processes after 30 minutes
R8 processes are sometimes hanging on the build servers.  Wrap R8 with
run_with_timeout to dump the stacks with jstack and kill the process
after 30 minutes.  Switch from running with the r8-compat-proguard
shell script to running the jar directly so that jstack gets the pid
of the java process.

Bug: 181095653
Test: m checkbuild
Test: m NetworkStackNextIntegrationTests
Test: m USE_RBE=true RBE_R8=true RBE_R8_EXEC_STRATEGY=remote NetworkStackNextIntegrationTests
Change-Id: If6996bd8eb39c7a8453d79e825004339c009ade2
2021-04-30 14:14:46 -07:00