Commit Graph

35538 Commits

Author SHA1 Message Date
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
Paul Duffin c8aeb00a9c Merge "Add package module to sdk snapshot that contains licenses" 2021-05-12 13:29:38 +00:00
Paul Duffin 62fb7438b1 Merge "Add license modules to the sdk" 2021-05-12 13:28:45 +00:00
Paul Duffin fffd98fd16 Merge "Switch Effective_license_text from []string to Paths" 2021-05-12 13:28:05 +00:00
Paul Duffin 12f5d04859 Merge "Move license module processing to GenerateAndroidBuildActions" 2021-05-12 13:27:15 +00:00
Paul Duffin 0d62615468 Merge "Add baseline test for license with sdk" 2021-05-12 13:27:08 +00:00
Jingwen Chen 3950cd6ed4 bp2build: remove libc_tzcode from denylist.
This now works with --features no_copts_tokenization. With tokenization,
the escaped empty string '\"\"' became an actual empty string '' on the
command line, setting -DWILDABBR to the wrong value.

However, no_copts_tokenization unveiled other problems with Android.bp
flags, such as spaces in existing cflags like
https://cs.android.com/android/platform/superproject/+/master:bionic/libc/Android.bp;l=288;drc=a0a4a6c2967b5b3c02c951ea1145f32ed5564ab9
- this trips up Bazel's copts when generated literally, so the
fix (other than splitting on space and making Soong accept strings that
don't start with dashes as cflags) is to make bp2build split cflags on
spaces before generating them as copts.

Test: bp2build, build bionic/...
Fixes: 186822591
Change-Id: Icf10bd20f6fb81db0b719ca0555fc70c75b91a79
2021-05-12 10:46:15 +00:00
Lukács T. Berki b9ebb7dfd8 Merge "Make @soong_injection usable in standalone builds." 2021-05-12 06:26:31 +00:00
Yuntao Xu 89733a4ce5 Merge "Support LOCAL_ENFORCE_USES_LIBRARIES in androidmk" 2021-05-11 21:30:21 +00:00
Yuntao Xu c97761e781 Support LOCAL_ENFORCE_USES_LIBRARIES in androidmk
1. add LOCAL_ENFORCE_USES_LIBRARIES support in the androidmk tool;
2. add one test case.

Bug: 187838385
Test: run 'm androidmk'
Test: TreeHugger
Change-Id: Ibdde2a5a58ef45655a3083b592fa21f7fe63d032
2021-05-11 12:39:54 -07:00
Elliott Hughes 4dac3874f1 Merge "Use SHT_RELR relocations where possible." 2021-05-11 17:29:39 +00:00
Jaewoong Jung ccbbeb6965 Merge "Strict updatability linting against dependencies." 2021-05-11 15:24:06 +00:00
Lukacs T. Berki 3069dd9d71 Make @soong_injection usable in standalone builds.
Test: Presubmits.
Change-Id: I942e627f9f7b7428834258ef3ccefb7f1f5c7606
2021-05-11 16:54:29 +02:00
Andrew Walbran ed00a40686 Merge "Output machine-readable file with all soong keywords." 2021-05-11 14:38:09 +00:00
Treehugger Robot a556647c50 Merge "Generate empty classpaths.proto for bootclasspath_fragment.go." 2021-05-11 12:53:23 +00:00
Andrew Walbran 75bba11bbc Output machine-readable file with all soong keywords.
Test: make, looked at output
Change-Id: Id0427e1a4f04515493c4dadb9e2856518e3a08dd
2021-05-11 11:10:25 +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
satayev 7b6d059326 Merge "Move conv_classpaths.proto to packages/modules/common." 2021-05-11 09:30:03 +00:00
Paul Duffin 6213170b3e Add package module to sdk snapshot that contains licenses
This ensures that the LSC license tool does not attempt to add a
package module to an sdk snapshot Android.bp.

Bug: 181569894
Test: m nothing
Change-Id: I37b66e0df56c5b9ec255f66cb4f2a066ea96a738
2021-05-11 08:38:30 +01:00
Paul Duffin b0bb376efa Add license modules to the sdk
Adds initial support for adding license modules to the sdk, along with
any referenced license text files. There is a number of minor
improvements to be made but the core of the support is there and it
works for ART sdks.

Basically, this change will automatically add license modules
referenced from any sdk member module as an internal sdk member. An
internal module has an sdk snapshot specific name that will not
conflict with the source module and which cannot be referenced from
outside the sdk snapshot.

Bug: 181569894
Test: m art-module-sdk art-module-host-exports art-module-test-exports
      - diff output before and after this change
        made sure that every prebuilt had a licenses field
        and that the license modules were added
Change-Id: I0c5ccabf58f4ef487e42ef8e61a5b2a74c0e81af
2021-05-11 08:28:49 +01:00
Paul Duffin ec0836af3a Switch Effective_license_text from []string to Paths
Effective_license_text contains paths to files that are copied from
one module to another and so need to be converted to Paths within the
context of the owning module as the paths are relative to the owning
module's directory.

The previous code did convert the license_text property to paths but
converted it back to strings again which was confusing and does not
follow the normal pattern.

Bug: 181569894
Test: m nothing
Change-Id: Iea09ee7f3de1187a2c3e41455ca83b0233d904b2
2021-05-11 08:24:59 +01:00
Paul Duffin df5a90502d Move license module processing to GenerateAndroidBuildActions
Previously, the processing of the license module was done in the
licensesPropertyFlattener method which is called for all modules before
their GenerateAndroidBuildActions method is called. This change moves
the processing into the license module's GenerateAndroidBuildActions
method which was previously empty to match the normal practice.

Bug: 181569894
Test: m nothing
Change-Id: I3736879bfa4b4d1f4e2b35770852a02d09b3db83
2021-05-11 08:24:59 +01:00
Paul Duffin e96108d797 Add baseline test for license with sdk
This change adds a test that includes license modules that are used by
modules which are part of an sdk but which does not yet copy the
license module into the snapshot. It includes the refactoring changes
needed to allow license modules to be used in an sdk test and provides
a baseline against which future changes can be compared.

Bug: 181569894
Test: m nothing
Change-Id: I60722f43cc9cc8375d97f46eb4c281e6c38987cd
2021-05-11 08:24:59 +01:00
Paul Duffin 05f86890ee Merge "Add support for name-less modules and property comments" 2021-05-11 07:19:06 +00:00
Paul Duffin bea70fb54e Merge "Allow an sdk member type not to provide a bp property" 2021-05-11 07:18:41 +00:00
Paul Duffin f08e7c444c Merge "Allow sdk snapshot to contain source module type" 2021-05-11 07:18:06 +00:00
Paul Duffin 9a59e70fe1 Merge "Move setting of prefer to createMemberSnapshot" 2021-05-11 07:17:32 +00:00
Lukács T. Berki 9c9a069ae6 Merge "Fix typo caused by incorrect git merge." 2021-05-11 06:01:30 +00:00
Paul Duffin 0df49686b3 Add support for name-less modules and property comments
Bug: 181569894
Test: m nothing
Change-Id: Ia4da1d2a55a924db82ae999da455adedbaca47c0
2021-05-11 01:00:12 +01:00
Paul Duffin 1308205638 Allow an sdk member type not to provide a bp property
Bug: 181569894
Test: m nothing
Change-Id: I7e98f14cb377683457fba32fd05d6c614f78ffeb
2021-05-11 01:00:06 +01:00
Paul Duffin 0d4ed0ac56 Allow sdk snapshot to contain source module type
Bug: 181569894
Test: m nothing
Change-Id: I30513dd22e2719099a1a1ef63cacc98336d02e9f
2021-05-11 00:59:56 +01:00
Colin Cross b00df8cc48 Merge "Store real number of records in regular end record when possible" 2021-05-10 23:14:11 +00:00
Paul Duffin 83ad956ec4 Move setting of prefer to createMemberSnapshot
Test: m nothing
Change-Id: Iab1c048fe74a5e474f68ce4acc6c1b41381368ca
2021-05-11 00:05:53 +01:00
Rupert Shuttleworth 3b413d35a4 Fix typo caused by incorrect git merge.
Test: bazel build //bionic/...
Test: cd cc; go test
Test: cd bp2build; go test
Change-Id: I334e02609203f332384256e990f2c40a016fc9e5
2021-05-10 18:41:51 -04: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
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 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
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
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