Commit graph

32586 commits

Author SHA1 Message Date
Jiyong Park
cdd9b8392d data dependency of java_test_host can be arch-specific
This allows java_test_host to have arch-specific data files. Currently,
VirtualizationHostTestCases needs this to have arch-specific kernels as
its data.

Bug: N/A
Test: m VirtualizationHostTestCases
Change-Id: Ib5680ef48b613955ad92c9bc212184ac75900d3e
2021-02-05 00:29:47 +09:00
Jiyong Park
599992bc3e Install ko to /lib/modules
... not to /lib/module

Bug: 178980227
Test: m
Change-Id: I6a5357e9e83e736181b885b64c76e0b7e5ffadf2
2021-02-05 00:29:47 +09:00
Jiyong Park
940dfd4db2 android_filesystem is OutputFileProducer
... to be able to reference the module in data property of test modules.

Bug: N/A
Test: m VirtualizationHostTestCases
Change-Id: I199f070e811011cea6189ef24c0b2d8a683f79d0
2021-02-05 00:29:47 +09:00
Inseob Kim
53b2427fc9 Merge "Allow common arch for recovery" 2021-02-04 06:19:28 +00:00
Julien Desprez
23c38fa9a7 Merge "Test changing default of cc_test_host" 2021-02-04 00:47:24 +00:00
Treehugger Robot
56d12a058e Merge "Add no_op binary." 2021-02-03 18:27:14 +00:00
Treehugger Robot
aef038aac1 Merge "Force ART modules to be built from source here, regardless of default." 2021-02-03 13:45:00 +00:00
Dario Freni
3627f8350d Add no_op binary.
Even if this binary is only used in a testing apex for dynamic common
library apex that will be removed once we have a production version
ready, we need said apex to be marked as updatable too.

Bug: 177879489
Bug: 179013728
Test: builds
Change-Id: I8ae519da164f1f5355d4c2dfeca88a497cda7990
(cherry picked from commit 0d3ff6d918)
2021-02-03 10:34:13 +00:00
Paul Duffin
e1f9b35d92 Merge "Switch hiddenapi to use OutputPath instead of ModuleOutPath" 2021-02-03 10:02:36 +00:00
Paul Duffin
7e2fad3f89 Merge changes I0f746a11,I08e61a24
* changes:
  Make OutputPath implement objPathProvider
  Allow CopyDepsToZip() to work on WritablePath
2021-02-03 10:01:39 +00:00
Treehugger Robot
ee0c35bcf8 Merge "bp2build: rename method for readability." 2021-02-03 07:40:26 +00:00
Treehugger Robot
7a1c2b181c Merge changes from topic "mkboot"
* changes:
  Add bootimg module type
  android_filesystem supports compressed cpio format
  add prebuilt_kernel_modules module
  arch.<arch>.deps now works in android_filesystem
2021-02-02 23:26:57 +00:00
Martin Stjernholm
bd396b6d8a Force ART modules to be built from source here, regardless of default.
When we start switching vanilla platform builds to use ART prebuilts,
this script should still build from sources.

Test: TH
Bug: 172480615
Change-Id: I04cb61b484855d22f22fd9b82f6abb30eb5665c3
2021-02-02 22:24:00 +00:00
Matthew Maurer
632f080f88 Merge "rust: Use v0 mangling format globally" 2021-02-02 20:30:56 +00:00
Tobias Thierer
dadc62cdb4 Merge "go/Android.bp: Clarify sdk_version documentation." 2021-02-02 18:19:38 +00:00
Paul Duffin
612e610063 Switch hiddenapi to use OutputPath instead of ModuleOutPath
In order to allow the hiddenapi code which expects its inputs to be
ModuleOutPath to consume the output from the deapexer module type (used
by prebuilt_apex) this change converts the hiddenapi from using
ModuleOutPath to use OutputPath instead.

This is part of a general cleanup to remove ModuleOutPath that is
separated out in order to avoid having the hiddenapi work dependent
upon and possibly delayed by issues with that general cleanup.

Bug: 178361284
Bug: 179124768
Test: m droid
Change-Id: I890f775bf5e33528dbaa62b95fa4198185ff8bf8
2021-02-02 14:42:05 +00:00
Paul Duffin
0267d49255 Make OutputPath implement objPathProvider
Needed to allow OutputPath to replace some usages of ModuleOutPath.

Bug: 179124768
Test: m droid
Change-Id: I0f746a11c53ed8c9c9193b57afc0b06c0249ff75
2021-02-02 13:33:51 +00:00
Paul Duffin
4076a75fd7 Allow CopyDepsToZip() to work on WritablePath
Makes the method more generally usable as it can work with any
WritablePath not just OutputPath. Also, makes it independent of whether
PathForModuleOut() returns ModuleOutPath or OutputPath.

Bug: 179124768
Test: m nothing
Change-Id: I08e61a24722198aa92fa2f8a2d096b1a8bf9c5c2
2021-02-02 13:32:12 +00:00
Jingwen Chen
4d2c0878a3 bp2build: rename method for readability.
Rename GenerateSoongModuleTargets to GenerateBazelTargets to reflect its return type.

Test: TH
Change-Id: I5359c8f4365750790837a9d412946d0b7fae64b7
2021-02-02 07:06:56 -05:00
Inseob Kim
20fb5d4e24 Allow common arch for recovery
Test: build
Change-Id: I9cffd399e0d00b53c344aac6045eadcf5be78cb3
2021-02-02 20:07:58 +09:00
Julien Desprez
3b933d3165 Test changing default of cc_test_host
Switching all cc_test_host to unit_tests: true by default.
Resolved all the failures (passing presubmit) to enable this.

Test: presubmit trigger
Bug: 177450457
Change-Id: I815e40786c0b62cf0aadd9b837d35c48332639da
2021-02-01 17:34:44 -08:00
Matthew Maurer
20768b8840 rust: Use v0 mangling format globally
By default, rust uses the `legacy` mangling format. Using llvm coverage
switches it to using the new `v0` format. Rather than pushing the llvm
coverage back to `legacy` format, move Android forwards to `v0`. This
also has the added benefit that Rust symbols can be detected in the
codebase by looking for a leading "_R", aiding in demangler selection.

Test: builds, resulting object files have leading _R rather than _Z
Test: atest keystore2_test
Bug: 178565008
Change-Id: I7fcd591535d08260686c62fbfa6f7b61b31ed989
2021-02-02 00:23:26 +00:00
Inseob Kim
38ce066d3b Merge changes from topics "snapshot_androidmk_suffix", "snapshot_list_module"
* changes:
  Remove global state on module suffixes from vendor and recovery snapshots
  Remove some global state from vendor and recovery snapshots
2021-02-01 23:46:02 +00:00
Paul Duffin
8705ba06bf Merge "Move creation of paths into hiddenAPIGenerateCSV" 2021-02-01 17:28:20 +00:00
Treehugger Robot
1020772b04 Merge "bp2build: flatten *_defaults properties." 2021-02-01 15:54:20 +00:00
Jiyong Park
1f7b93e976 Add bootimg module type
The new module type is to build the boot partition images. Boot
partition image consists of kernel, ramdisk, dtb, etc. which are
processed by the mkbootimg tool. There are two flavors of boot
partition: boot and vendor_boot. The choice is configured via the
'vendor_boot' property. Currently, only `vendor_boot: true` case is
supported.

But: 178978059
Test: m cf_bootimg-5.10
Change-Id: Iee689d9d666e8e6e5af7db02a76dd39d1e4d0e3a
2021-02-02 00:41:57 +09:00
Jiyong Park
11a65979d8 android_filesystem supports compressed cpio format
The format is used to create ramdisk image. Building ramdisk image in
Soong is required to have vendor_boot.img in the virt APEX.
vendor_boot.img consists of ramdisk and dtb.

Bug: 178980227
Test: m
Change-Id: Ie4e90cef8407b6e4bdf7f03f93724cdc3cd45c20
2021-02-02 00:41:57 +09:00
Jiyong Park
6446b62e9e add prebuilt_kernel_modules module
prebuilt_kernel_modules is a build rule for processing and installing
kernel module files. The module files are processed by depmod to build
modules.{load|alias|deps|softdeps} files. Debug symbols are stripped
from the module files and then all the files are installed to
./lib/modules/<kernel_version> directory.

This is the Soong-equivalent of the 'build-image-kernel-modules-dir`
macro and is expected to replace it in the future.

Bug: 178980227
Test: m

Change-Id: I772ac816824921d275869e35b93a083d239a2450
2021-02-02 00:41:57 +09:00
Jiyong Park
2136d15326 arch.<arch>.deps now works in android_filesystem
android_filesystem is a multi targets module type inhering from
PackagingBase. Since it's a multi-targets module, it is mutated only for
the common arch and therefore arch-specific properties are NOT squashed
into the matching top level property (i.e. setArchProperties is no op).

As a result, the values set in arch.<arch>.deps property were ignored.

This fixes the issue by explicitly adding the properties in
arch-specific structs and reading the properties in the matching arch.

Also added a set of tests for non-multi-target modules.

Bug: N/A
Test: m
Change-Id: Ibd4b509e73fa1760cc38b3661a08f83a6f639705
2021-02-02 00:41:28 +09:00
Colin Cross
a889080aba Remove global state on module suffixes from vendor and recovery snapshots
Propgate the Android.mk suffix from source modules into the snapshot so
that it can be used for the prebuilt modules.

Bug: 177098205
Test: vendor_snapshot_test.go
Change-Id: Iea151dc91395f714fbcad1df3a6fd0874e5455d9
2021-02-01 20:06:29 +09:00
Colin Cross
e0edaf9d49 Remove some global state from vendor and recovery snapshots
Snapshots storead global sets of modules that should be replaced with
vendor snapshot modules.  Move the data instead to a vendor_snapshot
or recovery_snapshot module type that depends on all the modules in
the snapshot, and then have modules that should use the snaphsot
depend on it to query for the set of modules that should be replaced.

Bug: 177098205
Test: vendor_snapshot_test.go
Change-Id: I2826adacfb473e9139b5ea93ba83b8a54cc1a56b
2021-02-01 20:02:39 +09:00
Paul Duffin
aded43c808 Merge "Fix some minor issues with boot_image" 2021-02-01 10:21:34 +00:00
Paul Duffin
4a838dfb3f Merge "Add boot_images to apex" 2021-02-01 10:21:21 +00:00
Ulyana Trafimovich
a4fce3b488 Merge "Write module dexpreopt.config for Make." 2021-02-01 10:16:57 +00:00
Paul Duffin
523bb85995 Merge "Add documentation for the different files created by hiddenapi" 2021-02-01 10:16:50 +00:00
Treehugger Robot
ac175a2900 Merge "bp2build: fix running from clean checkout." 2021-02-01 07:28:12 +00:00
Jingwen Chen
041b184c92 bp2build: flatten *_defaults properties.
This CL brings the defaults mutators into bp2build, reusing the
implementation of flattening defaults from *_defaults module deps into
the modules themselves.

This is an approach to converge defaults semantics with Bazel, which
doesn't have existing equivalent abstractions, other than macros, which
require more infrastructure to be built.

Test: TH
Test: build_conversion_test.go
Change-Id: Ia1443f8e6c3eb277fa861bb96625425a22cfc6d7
2021-02-01 00:33:30 -05:00
Paul Duffin
5bbfef8718 Fix some minor issues with boot_image
Mistakenly used HostAndDeviceDefault (which builds host and device
variants by default) instead of HostAndDeviceSupported which only
builds a device variant by default.

Moved the test definitions of art and framework boot images from being
defined in all Java related tests into the test where they belong. This
is needed in order to improve the ART and framework boot image specific
testing.

Bug: 177892522
Test: m droid
Change-Id: I16771f09bd789033e18c58ae6dd4b6b9e865d831
2021-01-30 12:57:26 +00:00
Paul Duffin
a1d6025a49 Add boot_images to apex
Previously, the apex module had to hard code behavior specific to the
art apex module in order to include the art boot image. This change
adds support to the apex module to allow the boot images to be
specified per apex.

In combination with a change to add the "art-boot-image" to the ART
apex this allows the custom code for handling the art boot image in
apex to be removed.

That custom apex code also included the logic to ensure that the
GlobalSoongConfig was initialized for use by the dex_bootjars
singleton. That logic has been moved from the APEX to the boot_image
module. That ensures that it will be run if and only if a boot_image
module is present in the checked out repos. So, limited manifest
checkouts which do not contain the art or frameworks/base repos (which
is where the boot_image modules are defined) will not attempt to run
this logic, which would fail because dex2oat would not be present.

Bug: 177892522
Test: m droid
Change-Id: I02d25fbef6e864e31eb5e0f4eb50358c79486db0
2021-01-30 12:45:07 +00:00
Jingwen Chen
eb76c4319d bp2build: fix running from clean checkout.
bp2build is a Soong mode that returns as soon as the BUILD files are generated. This causes it not generate the build.ninja file, which the Ninja process executing soong_build itself expects to produce as an output. If there isn't an existing build.ninja file generated from a previous build, GENERATE_BAZEL_FILES=true m nothing will fail.

This CL generates the expected files as a workaround, and also makes GENERATE_BAZEL_FILES=true skip the Kati/Ninja steps in soong_ui since they aren't needed.

Test: rm -rf out/ && GENERATE_BAZEL_FILES=true m nothing && m libc

Fixes: 178683777

Change-Id: I2515ef7961682d2be5f096ed24831cc185165a67
2021-01-29 22:33:25 -05:00
Ivan Lozano
9da4aa8166 rust: Allow rust_tests to include data files.
Adds the ability to define data files that should be installed alongside
the test.

This also fixes a bug wherein rust_test properties were duplicated.

Bug: 171710847
Test: rust_test module with "data" property installs files to device.
Change-Id: I091489afaf7e76b751a33a28049590d9fb39fe5f
2021-01-29 14:31:32 -05:00
Pete Bentley
9436be4321 Merge "Revert "Delete build-aml-prebuilts.sh"" 2021-01-29 16:19:57 +00:00
Pete Bentley
237de41b38 Revert "Delete build-aml-prebuilts.sh"
Revert submission 1535006-bap

Reason for revert: Looks like it breaks the build as aapt2 depends on the build_number.txt this script was generating.  Error log below.
Reverted Changes:
I0f6b34310:Delete build-aml-prebuilts.sh
I4eae4153a:Replace use of build-aml-prebuilts

Change-Id: I7f5f1b3047f3d71eb8ac7bec95c5916425d5d8f2
FAILED: ninja: 'out/aml/soong/build_number.txt', needed by 'out/aml/soong/.intermediates/frameworks/base/tools/aapt2/aapt2/linux_glibc_x86_64/unstripped/aapt2', missing and no known rule to make it
2021-01-29 15:14:42 +00:00
Paul Duffin
34982f1096 Move creation of paths into hiddenAPIGenerateCSV
A minor refactoring to simplify the generation of the CSV files.

Test: m nothing
Bug: 178361284
Change-Id: If79d21c7cebc6643a404973d3e0e5f174d7b0bb1
2021-01-29 13:22:31 +00:00
Paul Duffin
ff774a04ad Add documentation for the different files created by hiddenapi
Test: m nothing
Bug: 178361284
Change-Id: Id55646b9d4b7bc1acdb4ed6a6dd4456b746eb54c
2021-01-29 13:19:51 +00:00
Martin Stjernholm
c4e17317d1 Merge "Fix boot jar handling when both source and prebuilt APEXes and modules are present." 2021-01-29 13:15:02 +00:00
Anton Hansson
30d6f68b1a Merge "Delete build-aml-prebuilts.sh" 2021-01-29 09:11:16 +00:00
Tobias Thierer
1b3e949d14 go/Android.bp: Clarify sdk_version documentation.
The documentation was unclear because there are at least three
different ways (codename, version, API level) to refer to each
version, see https://source.android.com/setup/start/build-numbers
It is further complicated by the fact that this value is taken
as a String even though the API level it refers to is normally
an integer. To disambiguate, this CL adds an example.

Test: Treehugger only.
Change-Id: I40c13104a87d16c84c2098f36f7f63447d3dda4d
2021-01-28 21:55:37 +00:00
Nikita Ioffe
82aab58aea Turn apex compression from opt-out into opt-in
Compression is useful only for big enough apexes. We can manually opt-in
them, instead of trying to find list of apexes that should be opted-out.

Test: m
Bug: 178713634
Change-Id: Ice86fabb7c1db4a1e21e4c983d595cfd3a1c0b7a
2021-01-28 20:25:23 +00:00
Martin Stjernholm
1dc0d6d7f2 Fix boot jar handling when both source and prebuilt APEXes and modules
are present.

1) The boot jar to APEX mapping is maintained by the base names for
both of them. When building with prebuilt modules and APEXes, that
means we need to take care to compare them without regard to any
"prebuilt_" prefixes.

2) VisitAllModules can visit disabled modules and both source and
prebuilt modules, so they need some conditions to skip modules that
aren't applicable for boot jars.

Test: `m droid`
Test: `m droid SOONG_CONFIG_art_module_source_build=false`
  with fresh ART Module prebuilts in place
Bug: 171061220
Change-Id: Iced269d29127bc8b8f9b3171adb60a97d115628b
2021-01-28 20:09:24 +00:00