Commit Graph

36283 Commits

Author SHA1 Message Date
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
Paul Duffin c012dfc534 Merge "Generalize deapexer module to export any files" am: d8561166eb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697666

Change-Id: I055c7f96e30cba9cbb3dfd09d0e6e9194e35a4f0
2021-05-10 20:01:26 +00:00
Paul Duffin 977a1c20cd Merge "Simplify prebuilt_apex/apex_set common properties" am: 9f361c301d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697665

Change-Id: Ibc5be44b5fa804272c66a22b6d19ca81d3201f8c
2021-05-10 19:57:41 +00:00
Chris Parsons 0864831019 Handle cc_library shared/static only properties
Also handle whole_static_libs via a different attribute
(whole_archive_deps), separating these dependencies from regular static
deps.

Test: Build //bionic/libdl with bazel in conjunction with bzl
changes

Change-Id: I45019b6127a0d2731592ec35537ca15e77001cc2
2021-05-10 14:06:47 -04:00
Paul Duffin d8561166eb Merge "Generalize deapexer module to export any files" 2021-05-10 16:49:06 +00:00
Paul Duffin 9f361c301d Merge "Simplify prebuilt_apex/apex_set common properties" 2021-05-10 15:55:03 +00:00
Paul Duffin 955ddedc44 Merge "Derive deapexer module properties from transitive dependencies" am: eeec6bd460
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697058

Change-Id: I706fc7a18b7597e1e7d9d3aaef128a3dd6320899
2021-05-10 14:47:05 +00:00
Paul Duffin c9b695b6d7 Merge "Move creation of deapexer modules to separate mutator" am: b60def6def
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697057

Change-Id: I023a8dba9ef6e433e0e6b992a7e936d3f0adf237
2021-05-10 14:46:12 +00:00
Paul Duffin eeec6bd460 Merge "Derive deapexer module properties from transitive dependencies" 2021-05-10 14:33:49 +00:00
Paul Duffin b60def6def Merge "Move creation of deapexer modules to separate mutator" 2021-05-10 14:31:18 +00:00
Paul Duffin 3bae068ee5 Generalize deapexer module to export any files
Previously, the deapexer module had to duplicate the java library
specific logic for constructing the path to the library's dex file in
the .apex file. That is not something that the deapexer needs to be
aware of, all it needs is a list of files that should be exported.

This change moves that logic into the prebuilt_apex/apex_set modules
and generalizes the deapexer module so that it can export any files
that are requested.

The deapexer module does still need to know which java modules need
access to exported files so it can add dependencies from them onto
itself. However, it does not need to know what the type of the module
is.

Bug: 186455808
Test: m nothing
      m SOONG_CONFIG_art_module_source_build=false nothing
Change-Id: I71c6f0f761efe3b6d66d54273786e98cd545811c
2021-05-10 14:26:37 +01:00
satayev 73c7b8547a Move conv_classpaths.proto to packages/modules/common.
The classpaths.proto file is needed at build time to generate appropriate
classpath configs for the modules. Unbundled ART branches do not include
packages/modules/SdkExtenstion in their manifest; so put the proto in a
project that should be visible to all unbundled modules.

Bug: 180105615
Test: m nothing
Change-Id: Ie5be1822fbee92f280332622a9317894cc98d7ac
2021-05-10 13:14:23 +01:00
Paul Duffin bb0dc13afe Simplify prebuilt_apex/apex_set common properties
Moves all properties common to prebuilt_apex and apex_set module types
into prebuiltCommonProperties. Removes selectedApexProperties from
Prebuilt as that duplicated, and masked, the same property in
prebuiltCommon.

Bug: 187266082
Test: m nothing
      m SOONG_CONFIG_art_module_source_build=false nothing
      - this fails but not because of missing APEX variants
Change-Id: Ice7dfb8e18bb526fdd5b41bcd518c6971564d81b
2021-05-10 12:01:29 +01:00
Rupert Shuttleworth b68f7c11d3 Merge "Add temporary workaround for pack_relocations linker flag conversion for bp2build." am: e8f13bbb04
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1700745

Change-Id: I069dcf492a2be20557f6279286b7a9096d82da7c
2021-05-10 10:57:41 +00:00
Paul Duffin 57f8359fe3 Derive deapexer module properties from transitive dependencies
Previously, the deapexer module properties were simply passed through
from the prebuilt_apex/apex_set modules. This change derives the
properties from the transitive dependencies of the modules so that it
can automatically include the contents of a bootclasspath_fragment
module without having to duplicate them in the exported_java_libs
property.

Part of this change involves moving the addition of dependencies onto
the prebuilt apex's contents from DepsMutator to ComponentDepsMutator
so that they can be visited in the createDeapexerModule() function. The
ComponentDepsMutator runs before prebuilts without matching sources are
renamed to match the source name which simplifies the process of adding
dependencies directly onto the prebuilts.

The deapexerDeps method was renamed as the dependencies are added both
for use by deapexer and also to create APEX variants for access by
platform_bootclasspath so the name was confusing.

Bug: 187266082
Test: m nothing
      m SOONG_CONFIG_art_module_source_build=false nothing
      - this fails but not because of missing APEX variants
Change-Id: Icb4f883e7d2b63739e5ff0dc6edb8a906d80189b
2021-05-10 11:51:20 +01:00
Paul Duffin 5dda3e387e Move creation of deapexer modules to separate mutator
Previously, deapexer modules were created by the LoadHook which meant
that the deapexer module could not use any information derived from the
dependencies of the prebuilt_apex/apex_set modules. This change moves
the creation into a separate mutator that runs after
ComponentDepsMutator and before DepsMutator. That means that a follow
up change can use information from dependencies added by the former
mutator in order to create the deapexer module and the deapexer module
can itself add dependencies onto other modules.

This change also dedups the logic to determine whether a deapexer
module is needed by pushing it down into the createDeapexerModule
method which was renamed to createDeapexerModuleIfNeeded to reflect its
conditional nature.

Bug: 187266082
Test: m nothing
      m SOONG_CONFIG_art_module_source_build=false nothing
Change-Id: I65316473ff1e4b2827ff48ab5a870a8ce5c0475a
2021-05-10 11:41:40 +01:00
Rupert Shuttleworth e8f13bbb04 Merge "Add temporary workaround for pack_relocations linker flag conversion for bp2build." 2021-05-10 10:40:23 +00:00
Paul Duffin a96729add3 Merge "Add SOONG_SDK_SNAPSHOT_PREFER support" am: 4d0ee38fb7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697674

Change-Id: Ic3e13afe9897c7dc1d1302c8e1f688daac805710
2021-05-10 09:20:25 +00:00
Rupert Shuttleworth b28a33ceca Add support for shared_libs in cc_library targets. am: c50fa8dd05
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697794

Change-Id: Iac3b732e28b87ae39062fa025b26dd73cf60f9e9
2021-05-10 09:19:37 +00:00
Rupert Shuttleworth 143be94016 Add temporary workaround for pack_relocations linker flag conversion for bp2build.
Test: added unit test
Test: bazel build //bionic/...
Change-Id: I28217026f5846820ea2cc32cf8790948a54a9365
2021-05-10 05:17:42 -04:00
Paul Duffin 4d0ee38fb7 Merge "Add SOONG_SDK_SNAPSHOT_PREFER support" 2021-05-10 09:00:47 +00:00
Rupert Shuttleworth c50fa8dd05 Add support for shared_libs in cc_library targets.
Test: cd bp2build; go test

Test: bazel build //bionic/...

Test: ./build/bazel/scripts/run_presubmits.sh

Change-Id: I71e279470a0d69b243dd0a2b53ce31842fd36ee4
2021-05-10 03:35:32 -04:00
Treehugger Robot f8f3b93130 Merge "Rename fields in dexpreopt config" am: 564fce4578
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699427

Change-Id: I4b7b7660109810ffccca2711cfe492a5787194c3
2021-05-08 02:04:33 +00:00
Treehugger Robot 564fce4578 Merge "Rename fields in dexpreopt config" 2021-05-08 01:47:39 +00:00
Colin Cross 06eea2c9b8 Store real number of records in regular end record when possible
Only store uintmax for the number of entries in the regular end record
if it doesn't fit.  p7zip 16.02 rejects zip files where the number of
entries in the regular end record is larger than the number of entries
counted in the central directory.

Fixes: 187485108
Test: TestZip64P7ZipRecords
Change-Id: I0d116e228a0ee26e4e95bb3f35771da236a056eb
2021-05-08 00:18:04 +00:00
satayev 4c58850bbf Merge "Declare ConfiguredJarList in specific fragment implementations." am: ee7e359131
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699192

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

Change-Id: I1241af54ca19334578bb43005700bde5fae32afa
2021-05-07 18:41:01 +00:00
Elliott Hughes a09ee94843 Merge "Remove most of the remaining references to gccCmd." am: aa4c712989
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1696319

Change-Id: Ia39631f189b56118df77fd22794cb3add7fc25a5
2021-05-07 18:35:21 +00:00
Elliott Hughes 8df4b3dc6b Use SHT_RELR relocations where possible.
Ideally we'll want to move this logic to the toolchain itself, but right
now the linker doesn't even know it's targeting Android, let alone which
API level.

Bug: http://b/147452927
Test: treehugger
Change-Id: I6c5c822d0767e789fa0e2c8e5668fddfd90680bb
2021-05-07 11:35:19 -07:00
Treehugger Robot 3b755d4560 Merge "Split SYSTEMSERVERCLASSPATH entries from platform_bootclasspath." 2021-05-07 18:34:52 +00:00
Elliott Hughes e21f8f645c Merge "Remove unused parts of the strip implementation." am: 2e0436c7af
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697656

Change-Id: I4fa057fce73f68a436dad57d7d6ff0387297c1ff
2021-05-07 18:33:04 +00:00
Elliott Hughes aa4c712989 Merge "Remove most of the remaining references to gccCmd." 2021-05-07 18:15:42 +00:00
Elliott Hughes 2e0436c7af Merge "Remove unused parts of the strip implementation." 2021-05-07 18:15:17 +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 655970204c Merge "Install updatable-bcp-packages.txt and boot-image.bprof" am: 225e4dbae4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699203

Change-Id: I1153a08b44946b9d4b8100e79f55faa77f232386
2021-05-07 14:34:55 +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 64fb526cd0 Add SOONG_SDK_SNAPSHOT_PREFER support
By default the generated snapshot has prefer: false. Building it with
SOONG_SDK_SNAPSHOT_PREFER=true will force it to generate prefer: true.

Bug: 157884619
Test: m nothing
      m SOONG_SDK_SNAPSHOT_PREFER=true art-module-sdk
      - check the generated Android.bp file to make sure it contains
        prefer: true
Change-Id: Ied297b32d9bd4822a140fa99016f38e234c50f64
2021-05-07 14:54:35 +01:00
Paul Duffin 78ff835a32 Merge "Stop exporting java_sdk_library libs in the snapshot" am: 320055eb8c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697676

Change-Id: If21ded2582835f36062511d43d03aa2c10827cf4
2021-05-07 13:48:55 +00:00
Paul Duffin 320055eb8c Merge "Stop exporting java_sdk_library libs in the snapshot" 2021-05-07 13:34:33 +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 e1fab6a30b Merge "Make all SdkMemberTypes support transitive member deps" am: dbb490359a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699188

Change-Id: Id7f35c99e3cf7ffdb9627afb73b802fac734e154
2021-05-07 12:36:35 +00:00
Paul Duffin 11abc8f8d6 Merge "Make licenseModule SdkAware" am: e746f30a0b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699187

Change-Id: I700e883007f12cf70a118b9708314c1297c18144
2021-05-07 12:36:28 +00:00
Paul Duffin dbb490359a Merge "Make all SdkMemberTypes support transitive member deps" 2021-05-07 12:31:15 +00:00
Paul Duffin e746f30a0b Merge "Make licenseModule SdkAware" 2021-05-07 12:31:03 +00:00
Paul Duffin bef3a5ce3e Merge "Make sdk tests more realistic" am: e0fc8725f3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699186

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

Change-Id: Ic6c043bb9f549fc2326f44b50ee5ff2f38c199c1
2021-05-07 12:27:37 +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 e0fc8725f3 Merge "Make sdk tests more realistic" 2021-05-07 12:16:25 +00:00
Paul Duffin 820ed78954 Merge "Add missing calls to InitSdkAwareModule" 2021-05-07 12:15:16 +00:00