Commit graph

2231 commits

Author SHA1 Message Date
Colin Cross
d27e7b8e45 Add providers support
Propagate the providers methods from
https://github.com/google/blueprint/pull/309 to Soong.

Test: m checkbuild
Change-Id: Iad7a9023df4421cd01dbb0518be0e85382097481
2020-09-17 18:57:03 -07:00
Victor Khimenko
f18c623c04 Merge "Add -D__ANDROID_NATIVE_BRIDGE__ to native_bridge targets" 2020-09-17 19:09:03 +00:00
Colin Cross
9f35c3d6dd Copy documentation from Blueprint interfaces into Soong interfaces
Copy documentation from Blueprint for interface methods that are
wrapped into Soong interfaces.

Test: m checkbuild
Change-Id: Ib58c9201b8e7dfbf900a252e709f0a3cfed73286
2020-09-16 21:06:00 -07:00
Colin Cross
4f1dcb0e40 Return new dependencies from BottomUpMutatorContext.Add*
Propagate new return values of the BottomUpMutatorContext.Add*
methods from https://github.com/google/blueprint/pull/316 to
Soong.

Test: m checkbuild
Change-Id: I5378db46adf2f31cc4222b4619cc39db53791610
2020-09-16 21:06:00 -07:00
Victor Khimenko
1a31f80b03 Add -D__ANDROID_NATIVE_BRIDGE__ to native_bridge targets
And remove dual meaning from arm_on_x86 target. It was set for x86
targets with arm support and for arm targets with x86 support - and that
2nd one was abused for native_bridge version of RenderScript.

It's much safer and cleaner to rely on __ANDROID_NATIVE_BRIDGE__ there
while leaving arm_on_x86 to mean "x86 binary built in the image with arm
support".

It's only used by bcc compiler which is in canadian-cross situation here:
it's pure x86-64 binary, but it needs to know about ALL supported
architectures on device because it needs to include appropriate codegen
module.

Bug: http://b/153609531

Test: cts-tradefed run cts --abi armeabi-v7a -m CtsRsCppTestCases
Test: cts-tradefed run cts --abi arm64-v8a -m CtsRsCppTestCases

Change-Id: I869212e0b82eeaa30361a4e183d5c862ab40ef12
2020-09-17 01:42:50 +00:00
Jiyong Park
f78531bb24 Don't emit make vars from disabled modules
Previously, disabled modules were able to emit make vars and this could
cause duplicated make var definitions when a prebuilt_build_tools is
enabled for both linux_glibc and linux_bionic.

Bug: 159685774
Test: m
Change-Id: I8570ae5aabb8199e7c3901921886bcfa849037fe
2020-09-15 13:17:08 +09:00
Treehugger Robot
5a1a88ee93 Merge "LinuxBionic supports arm64" 2020-09-14 15:59:16 +00:00
Liz Kammer
88d593d942 Merge "Add hidden_api for java_import" 2020-09-14 13:57:09 +00:00
Treehugger Robot
f793d7deb4 Merge "Create os and arch variants for bootstrap Go modules" 2020-09-10 21:08:57 +00:00
Liz Kammer
5ca3a6293e Add hidden_api for java_import
Test: go java tests
Test: m
Bug: 160455085
Change-Id: Ib6e826e32ca73ceea0799b26145ad06b1e62a1bf
2020-09-10 07:56:03 -07:00
Colin Cross
617b88a288 Create os and arch variants for bootstrap Go modules
AddFarVariationDependencies was broken, which allowed modules to add
dependencies on bootstrap Go modules using os and arch variations
even though boostrap Go modules did not have any variations.  Mutate
bootstrap Go modules in the os and arch mutators so that they have the
expected os and arch variations.

This relands Ida7bc75a51ab1d2d38a6be11f574399097380cc9 with fixes
to also mutate *bootstrap.goPackage modules so that they can find a
matching *bootstrap.goBinary module when creating their pluginFor
dependency, and to create a variation for linux_bionic when it is
enabled so that linux_bionic builds can package Go binaries.

Also requries https://github.com/google/blueprint/pull/320 to
support multiple variants of bootstrap Go modules.

Test: all soong tests
Change-Id: Ibc627aa262c298a076d171a4c21b0b9c2a7b0ada
2020-09-09 14:44:57 -07:00
Jiyong Park
4afa2e2682 LinuxBionic supports arm64
LinuxBionic now supports arm64 architecture in addition to the existing
x86_64 arch. This is to make it possible to build host tools like adb,
fastboot, crosvm, etc. for Linux/ARM on regular Linux/x86 machines.

The arm64 target can be selected in various ways in Android.bp files:

   - target.host (because this is still considered as a host target)
   - target.linux (provided that the module is also enabled for host)
   - target.linux_bionic (use the OS name directly)
   - target.linux_bionic_arm64 (OS name + arch combo)
   - target.linux_arm64 (provided that the module is also for host)
   - target.not_windows
   - arch.arm64

The toolchain for the new target is almost the same as the toolchain
config for Android/ARM64. One notable difference is that the clang
triple is aarch64-linux instead of aarch64-linux-android, so that
__ANDROID__ is not defined for the new OS type.

Bug: 134795810
Test: HOST_CROSS_OS=linux_bionic HOST_CROSS_ARCH=arm64 m nothing

Change-Id: If4300583edfb6d75bd4d984b38f73b6a406b4447
2020-09-09 21:57:10 +09:00
Treehugger Robot
9ef1f7d96a Merge "Don't assume host arch is always x86" am: daf735287b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1415953

Change-Id: I049556891890833c1e7db6483e5ee6446714583e
2020-09-09 00:32:18 +00:00
Jiyong Park
87788b5247 Don't assume host arch is always x86
This change fixes some places where host arch is assumed to be x86 to
form a path element like linux-x86. In preparation for non-x86 host
targets, the host arch part is derived from the context.

In addition, InstallForceOS() is refactored so that it can override not
only OsType, but also ArchType. Without this, the paths for the
robolectic modules will be changed from linux-x86 to linux-common, which
breaks several other places where the old paths are expected.

Bug: 134795810
Test: m
Change-Id: Ib38c715948ae546e55021ece82bac1d82e9e5da0
2020-09-08 15:12:10 +09:00
Paul Duffin
891e77641d Remove unnecessary methods/fields of DefaultsModule/Base am: 3f98d148df
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418390

Change-Id: Ib44fe28b451daa19ef9b7fec83fc549924ba5024
2020-09-03 15:41:27 +00:00
Paul Duffin
f2dc411692 Extract dist properties from commonProperties am: ed87513b0b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1418389

Change-Id: I9a59d1a4154409a6a3d1efa590cccd2064b6c389
2020-09-03 15:18:46 +00:00
Paul Duffin
3f98d148df Remove unnecessary methods/fields of DefaultsModule/Base
The commonProperties and defaultsVisibilityProperties fields are only
used as containers for default values for properties and only within
the InitDefaultsModule() and so can be removed and replaced with an
empty structure instead.

Test: m checkbuild and TH
Change-Id: Ic5038d6b84b33afdf4859ced08e59871b9cde4a2
2020-09-03 10:12:10 +01:00
Paul Duffin
ed87513b0b Extract dist properties from commonProperties
Common properties are automatically inherited from a parent module
(i.e. one that calls CreateModule()) to the child module that it
creates. This makes no sense for dist/dists properties so this change
extracts them into their own structure separate to the
commonProperties.

Test: m checkbuild and TreeHugger
Bug: 160448975
Change-Id: Icceb20455e13394dd3b3bce464fb9bb34882d6c3
2020-09-03 10:12:10 +01:00
Colin Cross
6deda0a39a Merge "Revert "Create os and arch variants for GoBinaryTool modules"" am: 02789ab327
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1419428

Change-Id: I3d563ce07c76ae3d0200be599f7576d4253b3bcd
2020-09-03 04:31:55 +00:00
Colin Cross
02789ab327 Merge "Revert "Create os and arch variants for GoBinaryTool modules"" 2020-09-03 03:46:26 +00:00
Colin Cross
d4bdabcfad Revert "Create os and arch variants for GoBinaryTool modules"
This reverts commit 1ec1255476.

Reason for revert: b/167632665, broke linux_bionic builds.

Change-Id: I544fb5fd8aab06efa5618f076af3032271d4020f
2020-09-03 03:45:42 +00:00
Colin Cross
90d0500699 Merge changes I59b7a32a,Ida7bc75a am: 0329f2398c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1406259

Change-Id: I9b2b709c59630394aa528c64b4fbe60b52d50be5
2020-09-03 00:21:49 +00:00
Colin Cross
0329f2398c Merge changes I59b7a32a,Ida7bc75a
* changes:
  Only request image and version variations for device SDK dependencies
  Create os and arch variants for GoBinaryTool modules
2020-09-02 23:51:53 +00:00
Xin Li
65cb5c69ea Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Ifca7b65f4e27bf14cdc30f72f790b0de90130bae
Change-Id: I3a39be5f0b8736de4822c6a14072c78d4e4ad89d
2020-08-29 01:17:45 -07:00
Thiébaud Weksteen
3600b80e6f Return all rules when TestingModule.Rule fails
Similarly to Output, we return the list of Rules that have been
generated for TestingModule. This helps debugging failing tests.

Test: m nothing
Change-Id: I3542f4e4632f94fb84208c2e48e629271a373fd4
2020-08-28 08:15:09 +00:00
Jeongik Cha
219141c6bb Introduce BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES
If BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES has a numeric value,
it replaces "current" or "system_current" with the version which
the flag indicates.

Bug: 163009188
Test: BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES=29 m, and then check if every vendor
java module's sdk_version is 29 if its sdk_version was current.

Change-Id: I17b49b8e02caf2d1bc57b91648d4420f3ad9fcb9
2020-08-27 23:09:54 +09:00
Ulyana Trafimovich
03333d0e2f Merge "Export error reporting function to allow using it in other packages." 2020-08-27 09:07:51 +00:00
Raphael Gault
70b96b0d64 Introduce new Arm64 arch variant with dot product features
In order to rely on `-march`/`-mcpu` compiler flags for feature
detection, we introduce a new arch variant based on armv8.2 with the
addition of dot product features.

Test: test-art-target on Pixel 4.

Change-Id: I4d97db6129e2cd718a2b21008d36ec767739f925
2020-08-26 15:52:22 +00:00
Colin Cross
1ec1255476 Create os and arch variants for GoBinaryTool modules
AddFarVariationDependencies was broken, which allowed modules to add
dependencies on GoBinaryTool modules using os and arch variations
even though GoBinaryTool modules did not have any variations.  Mutate
GoBinaryTool modules in the os and arch mutators so that they have the
expected os and arch variations.

Test: all soong tests
Change-Id: Ida7bc75a51ab1d2d38a6be11f574399097380cc9
2020-08-25 13:53:35 -07:00
Ulya Trafimovich
5ab276ad1d Export error reporting function to allow using it in other packages.
Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: I3a1d936ac57966b2f47cb1d9a56e0f96f47b807d
2020-08-25 12:45:15 +01:00
Treehugger Robot
4c2e4f381a Merge "Support ninja rsp files in soong_zip" 2020-08-24 18:40:56 +00:00
Ulyana Trafimovich
49b1e9b6ce Merge "Use common helper functions for getting sorted map keys." 2020-08-21 09:36:30 +00:00
Treehugger Robot
68bfe074c6 Merge "Reland: Deduplicate APEX variants that would build identically" 2020-08-21 06:46:51 +00:00
Treehugger Robot
c23d6031b0 Merge "Capture list of unused methods when shrinking in R8" 2020-08-21 00:28:24 +00:00
Ulya Trafimovich
b8063c6a86 Use common helper functions for getting sorted map keys.
Add a new helper SortedIntKeys similar to SortedStringKeys.

Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: I08a43ec2cae7d1a82531295aca1a0658e3a0dd6f
2020-08-20 12:37:03 +01:00
Colin Cross
053fca10c9 Support ninja rsp files in soong_zip
Add a -r argument to soong_zip that reads a list of files from a file
like the -l argument but treats it as a Ninja rsp file with escaping.
Replace the -l arguments in Soong that are using rsp files with -r.

Fixes: 162435077
Test: TestReadRespFile, TestZip
Change-Id: I4605312e99406ab1bd0c37af9c5ad212393f0403
2020-08-19 21:18:56 +00:00
Colin Cross
cb6143a142 Capture list of unused methods when shrinking in R8
Use the -printusage flag in R8 to output a list of the unused
methods.  Some of the files can be large (2MB for DocumentsUI,
87MB for all of AOSP), so immediately zip them and remove the
originals.  The zipped files will be merged and disted.

Bug: 151857441
Test: m TARGET_BUILD_APPS=DocumentsUI dist
Change-Id: I780e84e80eba7fe4d4fa15fec0f461890afd900b
2020-08-19 11:19:14 -07:00
Colin Cross
aede88c1c7 Reland: Deduplicate APEX variants that would build identically
APEX variants that share the same SDK version and updatability
almost always use identical command line arguments to build but
with different intermediates directories.  This causes unnecessary
build time and disk space for duplicated work.

Deduplicate APEX variants that would build identically.  Create
aliases from the per-APEX variations to the new shared variations
so that the APEX modules can continue to depend on them via the
APEX name as the variation.

This has one significant change in behavior.  Before this change,
if an APEX had two libraries in its direct dependencies and one
of those libraries depended on the other, and the second library
had stubs, then the first library would depend on the implementation
of the second library and not the stubs.  After this change, if
the first library is also present in a second APEX but the second
library is not, then the common variant shared between the two
APEXes would use the stubs, not the implementation.

In a correctly configured set of build rules this change will
be irrelevant, because if the compilation worked for the second
APEX using stubs then it will work for the common variant using
stubs.  However, if an incorrect change to the build rules is
made this could lead to confusing errors, as a previously-working
common variant could suddenly stop building when a module is added
to a new APEX without its dependencies that require implementation
APIs to compile.

This change reduces the number of modules in an AOSP arm64-userdebug
build by 3% (52242 to 50586), reduces the number of variants of the
libcutils module from 74 to 53, and reduces the number of variants
of the massive libart[d] modules from 44 to 32.

This relands I0529837476a253c32b3dfb98dcccf107427c742c with a fix
to always mark permissions XML files of java_sdk_library modules as
unique per apex since they contain the APEX filename, and a fix
to UpdateUniqueApexVariationsForDeps to check ApexInfo.InApexes
instead of DepIsInSameApex to check if two modules are in the same
apex to account for a module that depends on another in a way that
doesn't normally include the dependency in the APEX (e.g. a libs
property), but the dependency is directly included in the APEX.

Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I2ae170601f764e5b88d0be2e0e6adc84e3a4d9cc
2020-08-19 10:21:17 -07:00
Pete Bentley
0c7b26e0e2 Revert "Deduplicate APEX variants that would build identically"
This reverts commit d6b2525b00.

Reason for revert: <Breaks tests - confirmed by Forrest: b/165188843>

Change-Id: I7cb68cb87522415004390c0672dc774e0067b122
2020-08-18 13:44:59 +00:00
Colin Cross
d6b2525b00 Deduplicate APEX variants that would build identically
APEX variants that share the same SDK version and updatability
almost always use identical command line arguments to build but
with different intermediates directories.  This causes unnecessary
build time and disk space for duplicated work.

Deduplicate APEX variants that would build identically.  Create
aliases from the per-APEX variations to the new shared variations
so that the APEX modules can continue to depend on them via the
APEX name as the variation.

This has one significant change in behavior.  Before this change,
if an APEX had two libraries in its direct dependencies and one
of those libraries depended on the other, and the second library
had stubs, then the first library would depend on the implementation
of the second library and not the stubs.  After this change, if
the first library is also present in a second APEX but the second
library is not, then the common variant shared between the two
APEXes would use the stubs, not the implementation.

In a correctly configured set of build rules this change will
be irrelevant, because if the compilation worked for the second
APEX using stubs then it will work for the common variant using
stubs.  However, if an incorrect change to the build rules is
made this could lead to confusing errors, as a previously-working
common variant could suddenly stop building when a module is added
to a new APEX without its dependencies that require implementation
APIs to compile.

This change reduces the number of modules in an AOSP arm64-userdebug
build by 3% (52242 to 50586), reduces the number of variants of the
libcutils module from 74 to 53, and reduces the number of variants
of the massive libart[d] modules from 44 to 32.

Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I0529837476a253c32b3dfb98dcccf107427c742c
2020-08-17 15:18:31 -07:00
Treehugger Robot
8cb67e4358 Merge "Override EarlyModuleContext.Namespace" 2020-08-17 19:37:39 +00:00
Colin Cross
133ebefb8d Override EarlyModuleContext.Namespace
Make android.EarlyModuleContext return a *Namespace.

Test: m checkbuild
Change-Id: I4c29d5e69e90eb9b7afbefc1355f63991a3e3331
2020-08-14 17:38:45 -07:00
Colin Cross
e07f2316b7 Rename ApexName to ApexVariationName
In preparation for reusing the same variation for multiple apexes,
rename ApexName to ApexVariationName.

Bug: 164216768
Test: all soong tests
Change-Id: I88f2c5b192ffa27acd38e01952d0cefd413222a0
2020-08-13 17:50:29 -07:00
Colin Cross
1b9604b463 Add CreateAliasVariation to BottomUpMutatorContext
Propagate CreateAliasVariation from Blueprint to Soong.

Bug: 164216768
Test: m checkbuild
Change-Id: I635bf67481092b83a8d26ef1cb06e2e3e21a595f
2020-08-13 17:50:05 -07:00
Colin Cross
beae6ecbd4 Shorten missing module panic message
Only print the list of variants of the matching module when
ctx.ModuleForTesting finds the module but not the variant.

Test: all soong tests
Change-Id: I51ffdde4645db39ec1d37ec018e0dea11d74280e
2020-08-13 11:52:21 -07:00
Anton Hansson
3d02e1f3c5 Merge "Update neverallows path for sdkextensions" 2020-08-11 11:55:39 +00:00
Anton Hansson
4b8e64b1ce Update neverallows path for sdkextensions
The modules sources have been moved, update the sdk variant whitelist.

Bug: 156286599
Test: m
Exempt-From-Owner-Approval: cherry-pick from internal
Change-Id: Idbd02b17b1c741f1dc20a3742ff57e8469a846c0
Merged-In: Idbd02b17b1c741f1dc20a3742ff57e8469a846c0
2020-08-11 10:32:21 +01:00
Dan Willemsen
9f43597ff7 Remove obsolete PDK build functionality
This hasn't worked for a couple years, and continues to bitrot. Just
remove it.

Adds a bpfix rule so that we can eventually remove the
product_variables.pdk definition, which is now always a no-op.

Test: treehugger
Change-Id: I830b54d419b59f6db1d4617b45e61a78234f57a7
Merged-In: I830b54d419b59f6db1d4617b45e61a78234f57a7
2020-08-11 01:11:44 +00:00
Jingwen Chen
fc16b6684e Merge "Fix droiddoc disting when WITHOUT_CHECK_API is true." 2020-08-10 05:22:24 +00:00
Jeongik Cha
6df337255c Merge "Introduce AlwaysUsePrebuiltSdks" 2020-08-10 00:51:56 +00:00
Dan Willemsen
a047f0120c Merge "Reland "Add prebuilt_build_tool to allow genrules to use prebuilt tools"" 2020-08-07 20:27:40 +00:00
Treehugger Robot
f3ab72936b Merge "Add BoardKernelModuleInterfaceVersions." 2020-08-07 18:37:36 +00:00
Martin Stjernholm
9f381d5ce3 Merge "Only output make targets for uninstallable static libs in the APEX unavailable-to-platform case." 2020-08-07 11:30:29 +00:00
Jeongik Cha
816a23a50d Introduce AlwaysUsePrebuiltSdks
Instead of UnbundledBuild, use AlwaysUsePrebuiltSdks
to determine if java modules needs to be built against prebuilt sdks.
And rename UnbundledBuildUsePrebuiltSdks to AlwaysUsePrebuiltSdks to
express its behavior more correctly.(It can be orthgonal to "Unbundled")

Bug: 160390776
Test: TARGET_BUILD_UNBUNDLED_IMAGE=true m vendorimage

Change-Id: I0be7265c1959d8774c295372cd7a9250169f6df9
2020-08-07 12:15:52 +09:00
Treehugger Robot
8b073fc7f1 Merge "Reland "Support per-module MakeVars"" 2020-08-07 00:50:24 +00:00
Jingwen Chen
2106bf8458 Merge "Create a AOSP Bazel overlay workspace with Soong" 2020-08-06 23:56:54 +00:00
Dan Willemsen
751ae87ed2 Reland "Add prebuilt_build_tool to allow genrules to use prebuilt tools"
Includes fixes for out dirs at absolute paths, and symlinks to absolute
paths. Also squashes support for exporting make vars, which previously
happened in a later patch (which got moved first, since it's mostly
infrastructure changes).

Original message:

cc_prebuilt_binary doesn't work well for host tools because they'll
often be using their own versions of shared libraries that may not be
compatible with what we build.

So add a module type that allows genrules to use one of these prebuilts
as a tool. Like other prebuilts, we'll use the source module if we have
it, or the prebuilt otherwise.

It supports adding extra dependencies for shared libraries or other data
files that are necessary to run the tool. Any genrules using the tool
will be rerun if any of the dependencies change.

Bug: 128690776
Test: treehugger
Test: build one-true-awk using genrule with bison
Test: with OUT_DIR=$PWD/out
Test: with OUT_DIR pointing to an absolute symlink
Change-Id: I662296cb55503b6a10ec5e5465b138e9edeb71f3
2020-08-06 15:56:38 -07:00
Dan Willemsen
6a6478d49e Reland "Support per-module MakeVars"
This allows setting per-module make variables earlier in the build,
particularly for prebuilt_build_tool users like LEX/M4/BISON (which will
come in a later CL). I moved filegroup over because it's a simpler
common interface, but it doesn't strictly need it.

Test: Inspect out/soong/make_vars-*.mk, out/soong/late-*.mk
Test: treehugger
Change-Id: I38631129d82b0aad2438e83610bb6a97568bf932
2020-08-06 15:56:09 -07:00
Yifan Hong
42bef8d0cc Add BoardKernelModuleInterfaceVersions.
This is a list of KMI versions for this board. Only gki_apex modules
with matching kmi_version field is enabled.

Test: build GKI apexes
Bug: 162888350
Change-Id: Ieb2116b79e3985ba15155a3cb8a2c340b46473c7
2020-08-06 15:47:58 -07:00
Martin Stjernholm
9e9bb7f223 Only output make targets for uninstallable static libs in the APEX
unavailable-to-platform case.

This removes the special case added in https://r.android.com/1274763
from SkipInstall(), so that it doesn't cause conflicting AndroidMk
entries when a cc_prebuilt_library_static module has prefer:true and
the corresponding source module exists.

Test: `m` in a tree with a snapshot created from art-module-sdk where
  the libartimagevalues module has prefer:true
Bug: 151303681
Change-Id: I651ae325753b707296892adb4cae80daaddb6af2
2020-08-06 22:52:58 +01:00
Ulyana Trafimovich
910eb70891 Merge "Add structured representation for colon-separated jar lists." 2020-08-06 15:07:27 +00:00
Jingwen Chen
5ba7e479d1 Create a AOSP Bazel overlay workspace with Soong
The Bazel overlay is a directory at out/soong/bazel_overlay that
replicates the layout of the AOSP Soong module tree, but as a Bazel
workspace. Each Soong module variant is represented as a BUILD target
created with the `soong_module` rule.

To create this overlay, run `m bazel_overlay`.

A `soong_module` target can depend on other `soong_module` targets.
These dependencies replicate each module's `directDeps` in the Blueprint
graph, just before `PrepareBuildActions`.

This enables users to use bazel query as a way to introspect the Soong
module graph. For example,

- Direct reverse dependencies of //bionic/libc:generated_android_ids in
//bionic/libc/...:

$ bazel query 'rdeps(//bionic/libc/...,
//bionic/libc:generated_android_ids, 1)'
//bionic/libc:libc_bionic_ndk--android_recovery_arm_armv7-a-neon_static
//bionic/libc:libc_bionic_ndk--android_ramdisk_arm_armv7-a-neon_static
//bionic/libc:libc_bionic_ndk--android_arm_armv7-a-neon_static_com.android.runtime
//bionic/libc:libc_bionic_ndk--android_arm_armv7-a-neon_static
//bionic/libc:generated_android_ids

- Why does com.android.runtime depend on lzma?

$ bazel query
'somepath(//bionic/apex:com.android.runtime--android_common_com.android.runtime_image,
//external/lzma/...)'
//bionic/apex:com.android.runtime--android_common_com.android.runtime_image
//bionic/libc/malloc_debug:libc_malloc_debug--android_arm_armv7-a-neon_shared_com.android.runtime
//system/core/libunwindstack:libunwindstack--android_arm_armv7-a-neon_shared_com.android.runtime
//external/lzma/C:liblzma--android_arm_armv7-a-neon_shared_com.android.runtime

- What does the dep graph of //bionic/libc:crtbegin_so look like?

$ bazel query
'deps(//bionic/libc:crtbegin_so--android_arm_armv7-a-neon)'
--output=graph > graph.in && dot -Tpng < graph.in > graph.png

https://photos.app.goo.gl/DfsdoFRNsRjGwTmy8

Test:  croot && m bazel_overlay && cd out/soong/bazel_overlay && bazel
query //... && bazel query 'rdeps(//bionic/libc/...,
//bionic/libc:generated_android_ids, 1)'

Signed-off-by: Jingwen Chen <jingwen@google.com>
Change-Id: I3bf40309bfb2d963bb8a688706385a57ee304c37#
2020-08-06 10:24:21 +00:00
Colin Cross
2eddd06879 Merge "Add libraryDependencyTag to track dependencies on static and shared libraries" 2020-08-06 00:06:28 +00:00
Martin Stjernholm
42e6dabe81 Merge "Disable all host OS variants except those explicitly included." 2020-08-05 14:50:48 +00:00
Ulya Trafimovich
249386ad69 Add structured representation for colon-separated jar lists.
With the addition of apexes and /system_ext some of the bootclasspath
and system server jars have moved from /system to the new locations.
This has been implemented by using lists of colon-separated strings
called "apex-jar pairs" (although "apex" was misleading as it could
refer to "platform" or "system_ext", not necessarily a real apex).

Using the colon-separated string representation is inconvenient, as it
requires splitting and reassembling the list components many times,
which harms performance and makes error handling difficult. Therefore
this patch refactors the colon-separated lists into a struct that
hides the implementation details.

Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: Id248ce639a267076294f4d4d73971da2f2f77208
2020-08-05 09:59:30 +01:00
Yifan Hong
ea3574b5fa Merge "Support com.android.gki.* in apex_available." 2020-08-04 19:06:08 +00:00
Martin Stjernholm
caa47d7eed Disable all host OS variants except those explicitly included.
Necessary to avoid problems with implicitly enabled host OS'es, e.g.
linux_glibc getting enabled when we only supply a linux_bionic linker
in runtime-module-host-exports. That will then cause a non-functional
prebuilt to take precedence over source if the prebuilt is preferred.

We don't do this for device since we so far only support a single
device OS (android).

This introduces the notion that SDK member types can be host OS
dependent or not. That way java members with host prebuilts don't get
restricted to a specific host OS.

Test: m nothing
Test: build/soong/scripts/build-aml-prebuilts.sh runtime-module-host-exports
  Check that the generated Android.bp correctly disables the bionic
  linker prebuilt for linux_glibc.
Test: art/build/apex/runtests.sh
  on master-art with an updated runtime SDK snapshot
Test: art/tools/buildbot-build.sh {--host,--target}
  on master-art with an updated runtime SDK snapshot
Bug: 160349757
Change-Id: Idad7ef138cdbcbd209d390bf6c10ca8365d4619f
2020-08-03 21:06:50 +01:00
Treehugger Robot
6aed6a385e Merge "Disable() must not be enabled unexpectedly" 2020-08-01 08:40:06 +00:00
Yifan Hong
60a3e7e7ca Merge "Introduce BOARD_KERNEL_BINARIES to soong" 2020-07-31 19:13:44 +00:00
Justin Yun
32f053b97e Disable() must not be enabled unexpectedly
When a module is disabled by calling Disable(), it could be
unexpectedly enabled by the archMutator. For example, a module has
```
enabled : false,
arch : {
    arm64 : {
        enabled : true,
    },
}
```
When this modules is disabled by calling Disable() before the
archMutator, it became enabled again ignoring Disable() command.
By defining the `ForcedDisabled` property, we can disable a module
regardless of `Enabled` property.

Bug: 161565086
Test: m
Change-Id: I443720715edbac25cb6d7c3d9eb1bc9806719161
2020-07-31 23:07:17 +09:00
Yifan Hong
d22a84a88b Support com.android.gki.* in apex_available.
com.android.gki.* matches any APEX with the prefix com.android.gki.,
like com.android.gki.bar.

Test: use it
Bug: 162267963
Change-Id: Ie46fcb08b031611d26b2b6cde157253f51ba9bfc
2020-07-30 18:20:37 -07:00
Yifan Hong
97365ee425 Introduce BOARD_KERNEL_BINARIES to soong
Bug: 161563386
Test: use it

Change-Id: I8ff429a329a9aa2a8ab6c8b4501356a84a7aead6
2020-07-29 14:52:11 -07:00
Colin Cross
6e511a9a9f Add libraryDependencyTag to track dependencies on static and shared libraries
dependencyTag uses a set of predefined tags to identify different types
of dependencies.  There are already multiple bits of metadata stored
in the dependency tag (Library, Shared, ReexportFlags), and supporting
them all requires a combinatorial explosion of predefined tags and
causes issues when using equality comparisons if a new bit of metadata
is added.

Add a new libraryDependencyTag type that will contain the metadata
bits, and replace the quality comparisons with checks on the metadata
bits.

There are 5 TODOs where modifying the checks identified problems with
the existing checks.  These were left in place to produce identical
build output and will be fixed separately.

Bug: 162437057
Test: no change to build.ninja or {Android,make_vars,late}-${TARGET_PRODUCT}.mk
Change-Id: I72d4207dcf381c07c92e00e5a03968ebb5ed8d30
2020-07-29 13:22:30 -07:00
Treehugger Robot
0ebab772f5 Merge "Update language to comply with inclusive guidance" 2020-07-29 03:41:51 +00:00
Yifan Hong
17d369709c Merge "Add makefile_goal." 2020-07-29 01:58:36 +00:00
Liz Kammer
7941b30c67 Update language to comply with inclusive guidance
See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 161896447
Test: m nothing
Change-Id: I13f42b680c6b819a2708c973e7718267c121f862
2020-07-28 13:27:34 -07:00
Yifan Hong
696ed4d54c Add makefile_goal.
Only for boot images.

Test: add one makefile_goal
Bug: 158537840
Change-Id: I88a006a1c7bfbf79f10f5360aae27a9bc267e42d
2020-07-28 09:51:15 -07:00
Jingwen Chen
7b27ca7dad Fix droiddoc disting when WITHOUT_CHECK_API is true.
When WITHOUT_CHECK_API=true, the droidstubs apiFile can be nil. Fix this
by defensively checking for nil paths when making the TaggedDistFiles,
and also in android.MakeDefaultDistFiles.

The error message reported in r.android.com/1335521 was:

"internal error: panic in GenerateBuildActions for singleton androidmk
  Dist file should not be nil for the default tag in
  android.net.ipsec.ike.stubs.source in translateAndroidMkModule for
  module android.net.ipsec.ike.stubs.source variant android_common"

Test: WITHOUT_CHECK_API=true m droid dist

Bug: 152834186
Signed-off-by: Jingwen Chen <jingwen@google.com>
Change-Id: I1b1f7c0b7a0e1c0ed5e15957d0162c47fd3ec197
2020-07-28 11:53:57 +00:00
Colin Cross
96d4f4550a Merge changes from topic "revert-1366377-prebuilt_build_tool_make-RMDAHCHNNX"
* changes:
  Revert "Add prebuilt_build_tool to allow genrules to use prebuil..."
  Revert "Switch cc's use of bison and flex to prebuilt_build_tool"
  Revert "Fix builds with absolute OUT_DIR"
2020-07-28 01:52:25 +00:00
Kiyoung Kim
1b478e57a0 Merge "Deprecate VNDK-Lite" 2020-07-28 00:36:11 +00:00
David Su
bec7f53e4f Revert "Add prebuilt_build_tool to allow genrules to use prebuil..."
Revert submission 1366377-prebuilt_build_tool_make

Reason for revert: breaks build
Reverted Changes:
I20bf062bb:Export prebuilt tools to Make
I4bb526492:Move some prebuilt build tool configs to Soong
I195b68813:Support per-module MakeVars
Ibcb257e7b:Fix dependency loop with flex
I6150f0f39:Switch cc's use of bison and flex to prebuilt_buil...
I6939451b8:Reland "Use genrules to build a consistent awk."
Idee60640f:Add prebuilt_build_tool modules for genrule use
I00893172b:Rename bison to bison_bin
I82c26be1c:Add prebuilt_build_tool to allow genrules to use p...

Change-Id: I6b3acf306d355f3e0463564c9ebe9482fa0f609e
2020-07-24 21:25:13 +00:00
Colin Cross
fae4d517fc Revert "Fix builds with absolute OUT_DIR"
This reverts commit b1d1e0e6bd.

Reason for revert: b/162063775

Change-Id: Ifcdba9d918d2bd0b5ab7ab02ccdc727a844a5556
2020-07-24 20:47:24 +00:00
Treehugger Robot
13aa44fc15 Merge "Build transitive lint reports for apex modules" 2020-07-24 11:50:39 +00:00
Treehugger Robot
e8bc288702 Merge "apexDepsMutator uses WalkDeps" 2020-07-24 09:25:57 +00:00
Dan Willemsen
b1d1e0e6bd Fix builds with absolute OUT_DIR
Test: OUT_DIR=$PWD/out m
Change-Id: I23887110a6ee1228162f9e1a9fc89a97f45ac781
2020-07-23 17:39:12 -07:00
Dan Willemsen
1a4ab20c1a Merge "Revert "Support per-module MakeVars"" 2020-07-23 21:43:04 +00:00
Dan Willemsen
613564eed4 Revert "Support per-module MakeVars"
This reverts commit 2019658b86.

Reason for revert: broke builds where makefiles were using M4 without depending upon it

Change-Id: I18304246e7a8a8f8c2620dd2c65ed77acd256be2
2020-07-23 21:37:35 +00:00
Dan Willemsen
4ec839a251 Merge changes from topics "prebuilt_build_tool", "prebuilt_build_tool_make"
* changes:
  Support per-module MakeVars
  Switch cc's use of bison and flex to prebuilt_build_tool
  Add prebuilt_build_tool to allow genrules to use prebuilt tools
2020-07-23 21:10:04 +00:00
satayev
71c96d1e1d Merge "Revert "Track allowed transitive deps in any updatable module."" 2020-07-23 15:20:18 +00:00
satayev
53bbc085e4 Revert "Track allowed transitive deps in any updatable module."
Revert submission 1312796-apex-allowed-deps

Reason for revert: b/161974327
Reverted Changes:
I52a4be72e:Add a check for apex/allowed_deps.txt to droidcore...
I56771ba3f:Track allowed transitive deps in any updatable mod...

Change-Id: I3be0a1b0dd824dafeadb485daca8e58b81a3ec5c
2020-07-23 15:15:54 +00:00
satayev
a71cf86853 Merge "Track allowed transitive deps in any updatable module." 2020-07-23 12:41:11 +00:00
Jooyung Han
698dd9f007 apexDepsMutator uses WalkDeps
apexDepsMutator marks all dependencies of apex modules. Previously, it
was converted from WalkDeps() to Top-down mutator to avoid the pitfall
of WalkDeps() bug. (It did't handle multiple visits via different
paths.)

Because WalkDeps() problem solved in aosp/1277516, apexDepsMutator can
be reverted to use WalkDeps().

Even though there's no observable difference between them, I revert this
for the up-coming change, which requires different pruning strategies
per apexes.

Bug: 159195575
Test: m
Change-Id: Ib09cbc7a3dfd143dd37b660b1aea6c71392ce2e3
2020-07-23 13:54:50 +09:00
Colin Cross
08dca38eb0 Build transitive lint reports for apex modules
Build and export transitive lint report zips for apex modules.

Bug: 153485543
Test: m TARGET_BUILD_APPS=com.google.android.wifi lint-check dist
Change-Id: I5a1805440452301a7e2c4ca91482b989638b54fb
2020-07-22 20:16:14 -07:00
Paul Duffin
50f0da4205 Improve IDE navigation to SdkBase methods
Previously, it was not possible to navigate directly from the interface
methods in SdkAware to the implementations in SdkBase as the former
embeds android.Module but the latter did not implement those methods
and so did not implement SdkAware. Finding the implementation of those
methods required explicitly searching for them.

This change extracts sdkAwareWithoutModule interface to allow use of
the IDE capability to navigate directly to implementations of an
interface method.

Test: m nothing
Change-Id: I0cd25180ea0081a54681b58e3202ff9491563131
2020-07-22 23:36:11 +01:00
Christopher Parsons
fef9d4b601 Merge "Install data_libs using relative_install_path property" 2020-07-21 17:26:57 +00:00
Jingwen Chen
8481186d56 Fix dist(s)-with-tag and add tests to prevent regression.
While AndroidMkEntries' DistFiles were populated from java_library
properly, there was a bug in the conditionals that dropped the tagged
DistFiles.

Fixes b/152834186
Fixes b/161339864

Test: soong tests, m sdk dist (creates out/dist/test.jar with
aosp/1363578)

Signed-off-by: Jingwen Chen <jingwen@google.com>
Change-Id: Id895282256fd367b2f46dcb7a643465fa66c9456
2020-07-21 12:30:39 +00:00
Colin Cross
cf0e4220eb Add dist target for robolectric-tests.zip
Also remove stray fmt.Println.

Test: m robolectric-tests
Change-Id: Ia463c2b395fadd6ab33b2ce8364f2119b2a2be1e
2020-07-20 17:19:02 -07:00
Colin Cross
f0ba57bf33 Merge "Package robolectric tests for tradefed" 2020-07-20 18:27:17 +00:00
Chris Parsons
216e10a0f6 Install data_libs using relative_install_path property
Test: Added to data_libs tests
Test: Manually verified with bionic-unit-tests
Test: Treehugger
Change-Id: I28a8e08e3409f1e7c7bb72f4351310b57f35f513
2020-07-20 13:59:24 -04:00
Treehugger Robot
5df3439377 Merge "Add compile_multilib properties to all native prebuilts (reland)." 2020-07-20 15:19:33 +00:00
Artur Satayev
453555083b Track allowed transitive deps in any updatable module.
Instead of tracking per module and per module variant, track allowed
list of dependecies for all modules combined. This avoids issues with
different products and different downstream branches having different
build graphs.

To compare allowed_deps.txt vs head, run:
:; m -j out/soong/apex/depsinfo/new-allowed-deps.txt.check

To update source allowed_deps.txt, run:
:; build/soong/scripts/update-apex-allowed-deps.sh

Bug: 149622332
Test: m
Change-Id: I56771ba3fea748de8e9c58c80758670572f7af53
Merged-In: Ic518fbd9ebfe1b46aaf9a58df731780a7e5a676b
2020-07-20 12:22:26 +01:00
Kiyoung Kim
b0aa8515b9 Deprecate VNDK-Lite
Android S would not support upgrade from O-MR1 devices, so VNDK Lite
configuration is no more valid. This change removes all VNDK-lite
variables from soong.

Bug: 158719241
Test: m -j passed
Change-Id: I54093fd4ee37ceddfc33a0b216b7069372040a0c
Merged-In: I54093fd4ee37ceddfc33a0b216b7069372040a0c
2020-07-20 05:46:11 +00:00
Colin Cross
8eebb135b3 Package robolectric tests for tradefed
Package a slightly modified copy of the robolectric tests with
the dependencies statically included into the testcases directory
and into a robolectric-tests.zip.

Test: m robolectric-tests
Change-Id: I73f51727695136d2a849d36af1683e93f7e156a3
2020-07-19 19:33:40 -07:00
Dan Willemsen
2019658b86 Support per-module MakeVars
This allows setting per-module make variables earlier in the build,
particularly for prebuilt_build_tool users like LEX/M4/BISON. I moved
filegroup over because it's a simpler common interface, but it doesn't
strictly need it.

With this, the last user of the hardcoded cc.m4Cmd variable is gone.

Test: Inspect out/soong/make_vars-*.mk, out/soong/late-*.mk
Test: treehugger
Change-Id: I195b688131feac0c100c338a0749368aa5d50f4f
2020-07-17 20:07:33 -07:00
Dan Willemsen
13af8140bc Add prebuilt_build_tool to allow genrules to use prebuilt tools
cc_prebuilt_binary doesn't work well for host tools because they'll
often be using their own versions of shared libraries that may not be
compatible with what we build.

So add a module type that allows genrules to use one of these prebuilts
as a tool. Like other prebuilts, we'll use the source module if we have
it, or the prebuilt otherwise.

It supports adding extra dependencies for shared libraries or other data
files that are necessary to run the tool. Any genrules using the tool
will be rerun if any of the dependencies change.

Bug: 128690776
Test: treehugger (builds one-true-awk with bison)
Change-Id: I82c26be1c3c9fe6cab42892ddea339c301c0b316
2020-07-17 19:34:12 -07:00
Treehugger Robot
7d1576540b Merge changes Ide9c7a6a,I706c1433 am: f8b85dedde am: a02a0d012c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1365337

Change-Id: I5fb0dafda5d1547c96b6196cfe6eecf4618a16be
2020-07-17 20:32:42 +00:00
Treehugger Robot
f8b85dedde Merge changes Ide9c7a6a,I706c1433
* changes:
  Add Validations to android.BuildParams
  Use validations for blueprint tests
2020-07-17 19:54:49 +00:00
Martin Stjernholm
89238f4703 Add compile_multilib properties to all native prebuilts (reland).
There was a special case in cc_prebuilt_binary only, which resulted in
prebuilt libraries getting both 32 and 64 bit variants even when their
sources only had one of them, and the other variant would be defunct
since it wouldn't get any prebuilt artefact.

This moves the handling of compile_multilib completely to the common
update code, so that SDK members don't need to deal with it. It doesn't
take SDK member defaults into account, which means a bit more
boilerplate in the snapshots, but it's simpler and less error prone
(different SDK member types have different defaults).

This relands https://r.android.com/1359962 after disabling the SDK
tests on mac once and for all.

Bug: 151303681
Test: `go test -v ./sdk` in build/soong on mac and linux
Change-Id: I05f6603b2ac9b8676b25c3e297165ca23284e9cc
2020-07-17 14:32:15 +01:00
Colin Cross
f5ada2c731 Merge changes from topic "lint-unbundled-apps" am: 70f0b53000 am: 8d984239e1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1360941

Change-Id: Ic1b7ec667b2f4ba2a3205ca372bf3afccffff1f3
2020-07-16 23:19:43 +00:00
Colin Cross
70f0b53000 Merge changes from topic "lint-unbundled-apps"
* changes:
  Build a zip of transitive lint reports for apps
  Add DepSets
2020-07-16 23:06:22 +00:00
Colin Cross
824f11614e Add Validations to android.BuildParams
Pass Validations through to blueprint.

Test: m checkbuild
Change-Id: Ide9c7a6afe627277df09a9e594849a971916f044
2020-07-16 13:10:57 -07:00
Colin Cross
c0efd1db13 Build a zip of transitive lint reports for apps
Add a rule to build a zip containing the lint reports from transitive
dependencies for apps, and pass it to Make.

Bug: 153485543
Test: m TARGET_BUILD_APPS=Gallery2 lint-check
Change-Id: I523c09016251377ff89d76084769be7401b95425
2020-07-16 12:51:42 -07:00
Colin Cross
9e44e21e91 Add DepSets
Add DepSets to efficiently support tracking transitive Paths without
copying, based on Bazel's depsets:
https://docs.bazel.build/versions/master/skylark/depsets.html

Test: depset_test.go
Change-Id: If744affdf1ed850113166ba611a79a891262040c
2020-07-16 12:50:11 -07:00
Treehugger Robot
01f9e22643 Merge "Do not consider disabled prebuilt variants." am: 7e32313ef2 am: 332977754d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1363557

Change-Id: Ia3b3c7cbaeafb2bbff90cf77120112d204f55c17
2020-07-15 17:52:54 +00:00
Martin Stjernholm
f467732447 Do not consider disabled prebuilt variants.
This relands https://r.android.com/1356826 without changes. It got
reverted as part of b/161315642 but is not related to that issue.

Test: m nothing
Test: `m` with prebuilt SDKs in the manifest
Bug: 151303681
Bug: 161315642
Change-Id: I7af892ae28a8208113e0801b1b8a8204edb61ec8
2020-07-15 14:27:13 +01:00
Jakub Pawlowski
98af17b286 Merge "Revert "Do not consider disabled prebuilt variants."" am: 75b1005f77 am: 56c1857eb1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1363476

Change-Id: I734209e925dad0c27e24ffa7b60647b594edf957
2020-07-15 10:54:51 +00:00
Jakub Pawlowski
d1a49ebe46 Merge "Revert "Add compile_multilib properties to all native prebuilts."" am: ca7b2c3eb7 am: eaa37aec1e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1362483

Change-Id: I32774a84f4891c4c950e00931076f3fc71d9fd7b
2020-07-15 10:54:48 +00:00
Charles Chen
6ffbe57270 Revert "Do not consider disabled prebuilt variants."
This reverts commit 235e2fdbd3.

Reason for revert: <build break>

Bug: 161315642
Change-Id: Ie741252dc1d0749591f141c71c3d59ce45f0234f
2020-07-15 08:56:22 +00:00
Charles Chen
29936ae5a7 Revert "Add compile_multilib properties to all native prebuilts."
This reverts commit 1e9c2677fd.

Reason for revert: Break build

Bug: 161315642
Change-Id: Ibf3d5e88412327e8f08d08272b75cd3df34a71e5
2020-07-15 04:01:45 +00:00
Treehugger Robot
ba64405d5e Merge "Add compile_multilib properties to all native prebuilts." am: 6da69732e4 am: f0d3591c9d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1359962

Change-Id: Ifd2e68477e4be452ea7362952ea2bd7f001f623d
2020-07-15 03:19:19 +00:00
Treehugger Robot
401b8ec527 Merge "Do not consider disabled prebuilt variants." am: 775c8e1af7 am: 17c7e4ad72
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1356826

Change-Id: Ie24a8ef484fc33e15dcd78cb9c92dd474746f2da
2020-07-13 14:23:52 +00:00
Martin Stjernholm
1e9c2677fd Add compile_multilib properties to all native prebuilts.
There was a special case in cc_prebuilt_binary only, which resulted in
prebuilt libraries getting both 32 and 64 bit variants even when their
sources only had one of them, and the other variant would be defunct
since it wouldn't get any prebuilt artefact.

This moves the handling of compile_multilib completely to the common
update code, so that SDK members don't need to deal with it. It doesn't
take SDK member defaults into account, which means a bit more
boilerplate in the snapshots, but it's simpler and less error prone
(different SDK member types have different defaults).

Bug: 151303681
Test: m nothing
Test: build/soong/scripts/build-aml-prebuilts.sh art-module-host-exports
  Check that the generated Android.bp passes Soong.
Change-Id: Ib73444c6788ee1c78480bdb103aa2b8ae8f2c63c
2020-07-11 00:38:24 +01:00
Martin Stjernholm
235e2fdbd3 Do not consider disabled prebuilt variants.
Test: m nothing
Test: `m` with prebuilt SDKs in the manifest
Bug: 151303681
Change-Id: I44d3a3cc4d7c1e02cc0ec61827646801f804b168
2020-07-10 17:12:10 +01:00
Roland Levillain
a0871f4181 Merge "Handle empty / undefined slice-type product variables uniformly." am: 8f91f7d802 am: 78498eb983
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1359443

Change-Id: I786c26f0faccd6195637708c4380f7eceb042657
2020-07-10 08:36:59 +00:00
Roland Levillain
8f91f7d802 Merge "Handle empty / undefined slice-type product variables uniformly." 2020-07-10 08:06:20 +00:00
Paul Duffin
d295daa19a Ensure that sdk/module_exports depends on source members am: cee7e66b07 am: e371a18acc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1359444

Change-Id: If241aea3d4997adfa1edea5e17c35b02f6bc0eb6
2020-07-09 21:58:57 +00:00
Paul Duffin
cee7e66b07 Ensure that sdk/module_exports depends on source members
Previously, preferring a prebuilt of an sdk/module_exports's member
would cause the sdk/module_exports to depend on the prebuilt instead
of the source and cause problems with the build.

This chance prevents the dependency from an sdk/module_exports to its
members from being replaced with prebuilts.

Bug: 160785918
Test: m nothing
Change-Id: Iee4bcd438c11929e30fb5766701b05a0e89956d9
2020-07-09 17:51:06 +01:00
Roland Levillain
f6cc261733 Handle empty / undefined slice-type product variables uniformly.
When checking for the emptiness / non-existence of a product variable
having the type of a slice, check the length of this variable against
zero, instead of checking the variable itself against `nil`, as
empty / undefined list product variables may appear as nil or empty
lists -- the former approach works with both nil and empty lists,
while the latter only works with nil lists.

Test: m nothing
Bug: 159241638
Change-Id: Id436a13f8633bf698b64e6901662f67657034486
2020-07-09 17:22:31 +01:00
Paul Duffin
7bd62bef11 Restrict replacements of source dependencies with prebuilts am: 80342d72d0 am: 403b15074f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1351596

Change-Id: I738152767fe955ec448471c60f246d58a96d4d7a
2020-07-08 18:33:57 +00:00
Paul Duffin
3b984b7d23 Stop java_sdk_library_import from depending on source modules am: 44f1d8404b am: ad18b5c676
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1351595

Change-Id: I98193c398be14e639aae36983ce3cb30c81a7b6e
2020-07-08 18:33:54 +00:00
Paul Duffin
80342d72d0 Restrict replacements of source dependencies with prebuilts
Previously, when java_sdk_library_import was preferred over a
java_sdk_library the latter ends up depending on the prebuilt child
modules created by the java_sdk_library_import instead of the source
child modules that it created itself. That was because all dependencies
on those source child modules were replaced with the corresponding
prebuilt child modules.

This change prevents those dependencies from being replaced to preserve
the dependencies from java_sdk_library onto its source child modules by
making the replacement conditional depending on the tag used. It also
updates the affected test.

Bug: 159902351
Test: m nothing
Change-Id: I4441b901dedfd44b9769df1ac2e248b94834cf85
2020-07-08 16:46:16 +01:00
Paul Duffin
44f1d8404b Stop java_sdk_library_import from depending on source modules
Previously, java_sdk_library_import added the dependencies on its child
components in the deps mutator after prebuilts without a matching
source module are renamed to the source module name. That meant that
the java_sdk_library_import has to use the source module name and ended
up depending on the source module unless it was preferred.

This change adds a new component deps mutator that runs before the
PrebuiltRenameMutator so that the java_sdk_library_import can add
dependencies onto the prebuilt modules. It also updates an affected
test.

Bug: 159902351
Test: m nothing
Change-Id: I3576c4873302743e51aff547ea1497bef6d748ac
2020-07-08 16:46:16 +01:00
Jooyung Han
bf5b939437 Merge "Apply "excludes" for OutputFileProducer" am: ecc495fd09 am: af6aa6ae9f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1354451

Change-Id: I3112f29f1e8aa101dbd77ac1d9fd73f50342b742
2020-07-08 07:11:35 +00:00
Jooyung Han
ecc495fd09 Merge "Apply "excludes" for OutputFileProducer" 2020-07-08 06:40:08 +00:00
Christopher Parsons
653919780e Merge "Add missing soong_docs inputs" am: 0eeff82c98 am: 4dada6c581
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1347867

Change-Id: I2190bf0119fa20802a586ca651f4a20a8a34e414
2020-07-06 23:16:20 +00:00
Christopher Parsons
0eeff82c98 Merge "Add missing soong_docs inputs" 2020-07-06 22:34:51 +00:00
Jooyung Han
7607dd3564 Apply "excludes" for OutputFileProducer
"excludes" should be applied both SourceFileProducer and
OutputFileProducer. But we've been missing the latter.
(see android/paths_test.go)

There's one more to note. Previously, the exclusion was done by
modifying slice directly, which caused some problem(b/76179848).
The fix was returning a copy from Srcs() method. But there're still many
implementors which just return internal slices directly.

This change creates a new array when it needs to exclude something from
returned slice.

Bug: n/a
Test: m (soong test added)
Change-Id: I1ba91e490cb55fc243020681667278cdc75f59df
2020-07-05 10:23:14 +09:00
Treehugger Robot
82fe912d84 Merge "Fix out/soong/Android-<>.mk reproducibility" am: 2e93eb702d am: 5ba520122b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1353442

Change-Id: If2d5adb61a7218c5872b7c9d4d63aebe9ae4685a
2020-07-02 01:29:23 +00:00
Dan Willemsen
1a8c8565bd Fix out/soong/Android-<>.mk reproducibility
When there were multiple modules overriding a single module, sometimes
we would create the list in different orders, which would trigger some
of the later mutators to write the Android-<>.mk out in different
orders.

Bug: 160207422
Test: diff out/soong/Android-<>.mk between multiple runs on internal master
Change-Id: I321db706dd34aa20a0b1556fd282d54b826a4a97
2020-07-01 15:13:58 -07:00
Anton Hansson
62783652ac Merge "Propagate owner property for apex modules" into rvc-dev am: ff1531e13b
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/12034797

Change-Id: I478d0442eee9e1eee74a853d51f21f797f2aeec0
2020-06-30 19:26:13 +00:00
Anton Hansson
1ee62c03ba Propagate owner property for apex modules
Bug: 160165426
Test: lunch aosp_taimen && m nothing
Change-Id: I1d274ea376c58ff44d69ef5440c919b67079ae4a
2020-06-30 13:55:23 +00:00
Treehugger Robot
08c3d0cf7f Merge changes Ifd2858dd,I2585dd99,I65e7a456 am: 0c6f111d7b am: d6b1515935
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1348951

Change-Id: Idcc16a40f953019278ea34829ca297a353da0820
2020-06-29 02:47:14 +00:00
Treehugger Robot
0c6f111d7b Merge changes Ifd2858dd,I2585dd99,I65e7a456
* changes:
  apex: use SubName for requiredDeps
  apex: support "vendor: true"
  apex: AndroidMk writes common properties
2020-06-29 02:20:56 +00:00
Roland Levillain
b78fa9bbc3 Add "art/test" to the list of Core Library projects. am: aca944916a am: 553c413071
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1235128

Change-Id: I999fa8cd332b92b47a7dfb356357ff00da2f55e3
2020-06-28 11:38:18 +00:00
Roland Levillain
aca944916a Add "art/test" to the list of Core Library projects.
Allow modules under art/test to use `sdk_version: "none"`. This is so
that ART run-test module definitions can use the same settings as
Libcore tests:

  sdk_version: "none",
  system_modules: "core-all-system-modules",

Test: m nothing
Bug: 147814778
Change-Id: Ibb74d6a06a6609be511403c51ca7a02204bf606f
2020-06-27 16:20:00 +01:00
Chris Gross
5ea55cd054 Merge "Use a default exclude filter for JaCoCo in Soong." am: 8f3386e49b am: 8a203b5cd7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1349522

Change-Id: I9c99a709a0a930e4114682d00a38ddd7210a602b
2020-06-26 15:21:01 +00:00
Chris Gross
8f3386e49b Merge "Use a default exclude filter for JaCoCo in Soong." 2020-06-26 14:59:15 +00:00
Chris Parsons
8f232a2702 Add missing soong_docs inputs
Specifically, make Android.bp.list and soong.variables explicit inputs

While this is not a comprehensive list of all inputs
of this action (as the action depends on all blueprint
files in the source tree), this is closer to the truth.

This is a rollforward CL, which was originally rolled
back, as path validation failed for when OUT_DIR was
an absolute path. Validation has now been relaxed.

Test: Manually verified ninja output, checkbuild approved validation
  for aosp-crosshatch, and manually ran frameworks/rs/build_rs.py with
  patch fix
Change-Id: I4eb0d517f57336dd54eaa4bd31f46df9e93e6da2
2020-06-26 10:36:18 -04:00
Jingwen Chen
ce00ee318f Merge "Support multiple dists per Android.bp module, and dist output selection." am: d06f11ee71 am: 3779799731
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1335521

Change-Id: I2ca43562972b4d50f1e9fd4a801026aa9abb6816
2020-06-26 08:25:04 +00:00
Chris Gross
2f748692dd Use a default exclude filter for JaCoCo in Soong.
Instrumented builds should exclude certain classes from instrumenation
by default. (e.g. JaCoCo itself) Leverage the existing
DefaultJacocoExclusionFilter to do this.

Note: Two different default filters exist now (one for Make and one for
Soong), as they have different wildcard rules.

Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_STATIC=true m -j32
TeleService and inspected the resulting temporary jar that was
instrumented to confirm that anything from org/jacoco was excluded.
Bug: 159748844

Change-Id: I5466b0a03957edfbe53971d5d1a7729fdb8337db
2020-06-25 16:45:44 +00:00