Commit graph

844 commits

Author SHA1 Message Date
Jaewoong Jung
e9665723da Merge "Add override_android_app module type." 2019-03-22 14:36:04 +00:00
Jaewoong Jung
525443aa22 Add override_android_app module type.
This is a new implementation of overriding module types that makes use
of local variants. With this, product owners can use PRODUCT_PACKAGES to
decide which override module to include in their products.

Bug: 122957760
Bug: 123640028
Test: app_test.go
Change-Id: Ie65e97f615d006b6e9475193b6017ea9d97e8e97
2019-03-21 13:26:20 -07:00
Dan Willemsen
3db041948b Tell make that sh_test is a NATIVE_TEST
So that it ends up in VTS's DATA/nativetest like a cc_test, and
otherwise acts like a test.

Test: convert external/linux-kselftest to sh_test
Change-Id: I44b7cfca45f8fe5d7fbb6eaa845a79bd70f155ef
2019-03-21 12:44:57 -07:00
Anton Hansson
53c88448fd Separate device and product overlays
This change adds book-keeping of whether an overlay came from
DEVICE_PACKAGE_OVERLAYS or PRODUCT_PACKAGE_OVERLAYS. This is
later used when writing the output to soong_app_prebuilt.mk, to
use either LOCAL_SOONG_[DEVICE|PRODUCT]_RRO_PACKAGES depending
on the original source.

This change is intended to be a noop on its own, but allows a
follow-up make change to customize the location of the auto-generated
RRO packages.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: Ib24fe1d05be132c360dd6966f7c83968c9939f77
2019-03-21 11:25:46 +00:00
Treehugger Robot
21c81326ff Merge "Notice support for APEX" 2019-03-21 06:04:14 +00:00
Vic Yang
efd249e62a Add support for no-vendor-variant VNDK
When no-vendor-variant VNDK is enabled, the vendor variant of VNDK
libraries are not installed.  Since not all VNDK libraries will be
ready for this, we keep a list of library names in cc/vndk.go to
indicate which libraries must have their vendor variants always
installed regardless of whether no-vendor-variant VNDK is enabled.

Also add --remove-build-id option to the strip script to facilitate
the check of functional identity of the two variants.

Bug: 119423884
Test: Add a dummy VNDK library and build with
      TARGET_VNDK_USE_CORE_VARIANT := true, with the corresponding
      build/make change.

Change-Id: Ieb1589488690e1cef1e310669a8b47a8b8759dac
2019-03-21 04:29:24 +00:00
Jiyong Park
52818fcde8 Notice support for APEX
Notice file for an APEX is created by merging notice files for the
modules included in it (plus the notice file for the APEX itself if
specified).

Notice files having the same content are not duplicated; it is emitted
only once.

Bug: 128701495
Test: m (apex_test is amended)
Test: m and inspect $(PRODUCT_OUT)/obj/NOTICE.txt to check there are
license entries for /system/apex/*.apex files

Change-Id: I169d91038291a6c71615de97cf5b03174afab5d4
2019-03-21 08:05:50 +09:00
Colin Cross
8a49795df1 Replace ctx.ExpandSources with android.PathsForModuleSrc
Move the logic from ctx.ExpandSources into android.PathsForModuleSrc
and ctx.ExpandSource into android.PathForModuleSrc, and deprecate
them.  When combined with the pathDepsMutator this will let all
properties that take source paths also take filegroups or genrule
outputs, as long as they are tagged with `android:"path"`.

Test: All soong tests
Change-Id: I01625e76b5da19240e9649bf26a014eeeafcab8f
2019-03-20 19:36:13 +00:00
Colin Cross
07e51619a2 Remove ModuleSrcPath
ModuleSrcPath was designed as a type that ensured that modules only
referenced sources inside the directory that contained the Android.bp
file.  In practice they don't work very well, because allowing
filegroups and genrules as inputs to any module that takes a source
path means that the path might end up being to a file in another
source directory or to a generated file in the output directory.

Remove ModuleSrcPath, replacing it with SourcePath in the places
that need to explicitly refer to a path in the source tree, or
Path where it may be a source path or a generated path.

Make PathForModuleSrc return a Path instead of a SourcePath in
preparation for consolidation with ctx.ExpandSources, which will
make it possibly return paths to generated files.

Test: All soong tests
Change-Id: I973a78470ed14307eea5f6d0cc93942775a65715
2019-03-20 19:36:03 +00:00
Colin Cross
2fafa3ec49 Remove ExpandSourcesSubDir and ModuleSrcPath.WithSubDir
Replace ExpandSourcesSubDir with ExpandSources plus
PathsWithModuleSrcSubDir, which loops over the paths and uses
Join to create paths relative to subdir on any results that
are ModuleSrcPaths.

Test: All soong tests
Change-Id: I11a7face88641e2c26ccdca0a3117d5c38ab588e
2019-03-20 19:35:52 +00:00
Colin Cross
3020fee889 Support go 1.12
go 1.12 changed the stack trace of a function call during global
variable initialization to contain a function called
"PKG.init.ializers".  Fix callerName to split the package path
and function name on the first "." after the last "/", and look
for functions called "init.ializers" or functions with the
prefix "init."

Test: Soong tests with go 1.12
Change-Id: I25f1ba989ef2d65ca85cb7c9d84454cca230ff86
2019-03-19 23:47:22 +00:00
Julien Desprez
8c84e60f38 Merge "Support test_suite and test_config with sh_test" 2019-03-19 21:05:13 +00:00
Julien Desprez
9e7fc1407d Support test_suite and test_config with sh_test
Start basic suite support for sh_test so we can
include them in suites.

Test: make adb-remount-sh
Bug: 127959519
Change-Id: If73541d614a2d809e4f94e4fee4c660840631cc1
2019-03-18 14:35:21 -07:00
Colin Cross
a3a97415d3 Don't add dependencies on modules referenced in unused arch variants
When extracting dependencies from properties tagged with
`android:"path"`, only look at the general property structs
and not the arch-specific ones.  The necessary arch-specific
values will be appended into the general property structs.

Fixes: 128377112
Test: path_properties_test.go
Change-Id: I35e35555d5b15473229a7458fcfc2c7dacaec889
2019-03-18 12:49:14 -07:00
Benjamin Gordon
87e7f2f685 Add stoney ridge x86 variant
Bug: 124445930
Test: compile and deploy to grunt
Change-Id: Ie63217c7c68f5688bf070cbabf9ea5a1b82d3acc
2019-03-15 11:04:48 -06:00
Treehugger Robot
7487fb54fe Merge "Create symlink for bionic files" 2019-03-15 09:02:18 +00:00
Treehugger Robot
6f933e5528 Merge "Soong: update the synopsis of vts_config module." 2019-03-15 01:22:27 +00:00
Stephen Hines
5971f50a22 Merge "Add AVX/AVX2 supported archs in build system" 2019-03-15 00:55:04 +00:00
Patrice Arruda
3cec272c94 Soong: update the synopsis of vts_config module.
Added more details on the vts_config synopsis.

Bug: b/128337482
Test: Ran the doc generation command and verified that the synopsis
was updated in vts_config module.

Change-Id: I1d29a7f800b5dd4e6f1719af5d0d3b723202f33d
2019-03-14 12:05:02 -07:00
Jiyong Park
f11943527d Create symlink for bionic files
This change creates following symlinks for bionic files.

/system/lib/libc.so -> /apex/com.android.runtime/lib/bionic/libc.so
/system/lib/libm.so -> /apex/com.android.runtime/lib/bionic/libm.so
/system/lib/libdl.so -> /apex/com.android.runtime/lib/bionic/libdl.so
/system/bin/linker -> /apex/com.android.runtime/bin/linker
...

This allows us to not have mountpoints under /bionic.

Bug: 125549215
Test: m and inspect the symlinks in the system partition.
Change-Id: I3a58bf4f88c967862dbf06065a1af8fc4700dda3
2019-03-15 03:04:52 +09:00
Patrice Arruda
8958a942d1 Soong: Update the filegroup's synopsis documentation.
Cleaned up the synopsis of filegroups module under android package.

Bug: b/128337482
Test: built the documentation manually and verified that the changes
took place.

Change-Id: Ib5544125e5462fca7c7aebc4bed4647bba11d56b
2019-03-13 10:53:36 -07:00
Shalini Salomi Bodapati
4a0459dd03 Add AVX/AVX2 supported archs in build system
This patch adds new arch features avx2 and avx512 and
their supported archictectures for x86 and x86_64

Bug: 123376719
Test: m checkbuild

Change-Id: I3c079741815b39d7dbb4072e12ef7c9c2c15f5fe
Signed-off-by: Shalini Salomi Bodapati <shalini.salomi.bodapati@intel.com>
2019-03-13 03:48:45 +00:00
Patrice Arruda
66184450d5 Merge "Soong: Add documentation to sh_binary[_host] module." 2019-03-12 16:21:36 +00:00
Patrice Arruda
9e14b96f29 Soong: Update documentation on prebuilt* modules.
The prebuilt_etc_host is missing synopsis. Also, cleaned up the
synopsis of the remaining prebuilt* module to be clearer.

Bug: b/128337482
Test: Built the documentation and verified that the output is correct.
Change-Id: I64593970a44b548ac841de79aa0e4aa1699c6c9b
2019-03-11 16:14:07 -07:00
Patrice Arruda
e103419483 Soong: Add documentation to sh_binary[_host] module.
Synopsis was missing to the sh_binary[_host] module.

Bug: b/128337482
Test: Ran m soong_docs and verified that sh_binary[_host] module
had a synopsis.

Change-Id: I0bb702ab2d8e4168664e7bba397e0e26af7f03ab
2019-03-11 14:26:47 -07:00
Colin Cross
1255a561e6 Fix ALLOW_MISSING_DEPENDENCIES=true builds
Don't error out immediately if a SourceDepTag dependency is missing
if ALLOW_MISSING_DEPENDENCIES=true is set.

Test: forrest on unbundled build
Change-Id: I9077013e09e3ad0e90ae5163b26aace5b263e63a
2019-03-07 21:43:10 +00:00
Colin Cross
937664a50a Add test for ctx.ExpandSources
Test: TestExpandSources
Change-Id: Ib2168b00618a45b2a36c4b158c6c02c4727a960b
2019-03-07 18:36:46 +00:00
Colin Cross
27b922f53e Annotate paths and deprecate ExtractSource(s)Deps
Add `android:"path"` to all properties that take paths to source
files, and remove the calls to ExtractSource(s)Deps, the
pathsDepsMutator will add the necessary SourceDepTag dependency.

Test: All soong tests
Change-Id: I488ba1a5d680aaa50b04fc38acf693e23c6d4d6d
2019-03-07 18:36:35 +00:00
Colin Cross
1b48842a4b Add path properties mutator
Add a mutator pass after DepsMutator that visits every property
struct in every module looking for properties that have a tag
`android:"path"`, and automatically add a SourceDepTag dependency
on any module references (":module-name") found.  Uses a cache to
store the mapping of property struct type to locations of
properties with the tag.

Test: android/path_properties_test.go
Change-Id: I38c0497843dde4890e9342c3a6f0b402c0720742
2019-03-07 18:36:24 +00:00
Treehugger Robot
1361449710 Merge "Add neverallow rules for java_device_for_host" 2019-03-07 16:14:45 +00:00
Colin Cross
c35c5f9824 Add neverallow rules for java_device_for_host
java_device_for_host and java_host_for_device should rarely be
used and could cause problems if used incorrectly, so restrict them
to only the necessary projects through a neverallow whitelist.

Bug: 117920228
Test: neverallow_test.go
Change-Id: I37dce489c2fb8bca71bd46dbabaaa514bf6f7eee
Merged-In: I37dce489c2fb8bca71bd46dbabaaa514bf6f7eee
2019-03-07 15:23:21 +00:00
Treehugger Robot
f14277fc3a Merge "Add checks for double_loadable dependencies" 2019-03-06 03:29:20 +00:00
Jooyung Han
a70f067899 Add checks for double_loadable dependencies
Vendor-available libs can be double-loaded if LLNDK libs depend
on them. Currently soong checks only 'direct' dependency bewteen
LLNDK and VNDK lib. With this change, soong checks if every dependencies
from LLNDK is also LLNDK or VNDK-SP or marked as 'double_loadable:true'.
This change causes many libs to be marked as 'double_loadable'.

Bug: 121280180
Test: m -j
Change-Id: Ibc1879b6fd465a3141520abe0150018c3051c0a7
2019-03-06 11:18:21 +09:00
Colin Cross
3d7c9827d5 Add modules for converting java modules between host and device
java_device_for_host and java_host_for_device allow treating a
device module as a host module and vice versa.  They will be useful
for converting layoutlib and robolectric to Soong, as these modules
run device java code on the host.

Bug: 117920228
Test: device_host_converter_test.go
Change-Id: Ia9a371fb41a97bc16338097f3ce8b40099744167
2019-03-05 23:09:45 +00:00
Colin Cross
baa676f671 Fix RuleBuilder.Restat
RuleBuilder.Restat wasn't being propagated to the rule.

Test: rule_builder_test.go
Change-Id: Ie64c8076692ea10a0c47ed5a8832e3f553bea0fc
2019-03-05 03:17:33 +00:00
Colin Cross
4c83e5ccd4 Support testing Rules in Modules and Rules and Builds in Singletons
Add support for TestingModule to return RuleParams for rules created
by the module.

Refactor TestingModule to use helpers, and use the helpers to
implement a similar TestingSingleton.

Use the new functionality to test RuleBuilder's module and singleton
rules.

Test: none
Change-Id: I8348c56ff5086d0c49401f5a00faf7c864e6b6f3
2019-03-05 03:17:26 +00:00
Colin Cross
0b9f31fb08 Replace *Escape with *EscapeList
Follow the change to blueprint to make *Escape take and return a string
and add *EscapeList that take and return slices of strings.  Fix up
a few places that were unnecessarily converting a string to a slice
and back to a string.

Test: m nothing
Change-Id: I3fa87de175522205f36544ef76aa2f04aef1b936
2019-03-04 18:11:53 +00:00
Pirama Arumuga Nainar
7abf560cb0 Merge "Enable coverage universally if COVERAGE_PATHS includes "*"" 2019-03-04 16:31:51 +00:00
Pirama Arumuga Nainar
4e128282f2 Enable coverage universally if COVERAGE_PATHS includes "*"
http://b/116873221

This will be used in a target in the build server to build all native
code with coverage.

Test: 'm NATIVE_COVERAGE=true COVERAGE_PATHS=* nothing' works as
expected.

Change-Id: I55d644ed9212c4ab0f1e4a00aac3a467fcf2a463
2019-03-01 16:17:53 -08:00
Mark Salyzyn
aaf53538bb Add required: to debuggable
Permit product_varables: { debuggable: { required: ["remount"], }, },
so that we can add debug dependencies between build objects.

Test: compile
Bug: 122602260
Change-Id: Ibb4c5bf368f90fdb007d30b6c1da63cb9d4c6467
2019-03-01 15:14:52 -08:00
Alex Light
778127a041 Add support for including py_binary and *_go_binary in apexs
These additional binary types are useful for some apexs. Add the
ability to include them. Due to the nature of the resulting artifacts
only py binaries with embedded launchers and host go binaries are
supported.

Test: m com.android.support.apexer
Bug: 119332365
Bug: 119332362
Change-Id: I27c253d3647cf7bbe15896610d7a74a5f93e8bec
2019-03-01 01:56:14 +00:00
Treehugger Robot
ef36053829 Merge "Revert "Add override_module."" 2019-02-28 23:10:33 +00:00
Jaewoong Jung
acb6db331b Revert "Add override_module."
This reverts commit aa65e17016.

Reason for revert: Not compatible with PRODUCT_PACKAGES, and so has very limited use.

Change-Id: Ib141d3984a6f12bb50989e66037494c466b066f1
2019-02-28 16:22:30 +00:00
Roland Levillain
2833d984fb Merge "Fix soong.android.RuleBuilderCommand.FlagWithList's comment." 2019-02-28 10:58:52 +00:00
Treehugger Robot
b709575a75 Merge "Add override_module." 2019-02-28 03:46:23 +00:00
Jaewoong Jung
aa65e17016 Add override_module.
This new module type replaces the inherit-package function in make by
allowing developers to override the name, the certificate, and the
manifest package name of an android_app module.

Bug: 122957760
Fixes: 123640028
Test: app_test.go + BrowserGoogle
Change-Id: Iefe447e7078b25039233221361ef95c83a29973a
2019-02-27 14:35:39 -08:00
Patrice Arruda
368a97286b Merge "Add a host prebuilt module type for usr/share." 2019-02-27 22:10:31 +00:00
Colin Cross
2cdd5df7cc Fix Rel() after ReplaceExtension or InSameDir
Copying p.rel doesn't work, as rel needs to match the end of the
value in path.  Apply the same transformation to p.rel as p.path.

Test: paths_test.go
Change-Id: I42d676c6c4fc18d9852c1a73f25e5a791d7553d0
2019-02-27 20:23:25 +00:00
Roland Levillain
2da5d9a5fe Fix soong.android.RuleBuilderCommand.FlagWithList's comment.
Test: n/a
Change-Id: I96158244feaaaa25ada02275e20418ac30218004
2019-02-27 16:56:41 +00:00
Patrice Arruda
300cef9856 Add a host prebuilt module type for usr/share.
This is almost the same as prebuild_etc except the base path.

Bug: 122616578
Test: prebuilt_etc_test.go
Change-Id: I512b17a88062403225ae6ec248f857c88fccf47a
2019-02-26 09:18:35 -08:00