Commit graph

1678 commits

Author SHA1 Message Date
Ivan Lozano
7c3358dd60 Merge "Add gcov coverage support to Rust modules." am: 6c4e5c05c3 am: acdf2ac701
Change-Id: Id236afb83e583a93020803302a61dbf46904c295
2020-05-07 18:41:29 +00:00
Ivan Lozano
6c4e5c05c3 Merge "Add gcov coverage support to Rust modules." 2020-05-07 17:56:43 +00:00
Paul Duffin
6b0635adf1 Merge changes If673d482,I98b575b8 am: 38e2fbdc90 am: 6b178d6f7b
Change-Id: I19d639148a482fc950bd9f877359164822047128
2020-05-07 16:15:10 +00:00
Paul Duffin
38e2fbdc90 Merge changes If673d482,I98b575b8
* changes:
  Remove reference to obsolete BuildSnapshot()
  Correct order of parameters to AssertDeepEquals
2020-05-07 15:50:06 +00:00
Paul Duffin
509bb9b7ff Merge changes I13df3115,I825c6df0 am: 955ade6475 am: 4bfed659d9
Change-Id: I62fc47243b57a0423815f74cd94340f66b897e1d
2020-05-07 09:51:20 +00:00
Paul Duffin
425b0eacaa Remove reference to obsolete BuildSnapshot()
Bug: 155628860
Test: m nothing
Change-Id: If673d482e8318b5fbb86780236123b0bd59eb5d3
2020-05-06 18:40:41 +01:00
Paul Duffin
afa9fa104d Add hook to be called after defaults have been applied
Previously, the only way for a module type to create modules (other
than defining its own mutator) was to register a LoadHook. However,
that is called before defaults are applied so any properties used in
that hook cannot take advantage of defaults, e.g. java_sdk_library
cannot use defaults to set its sdk_version property and have that
affect its child modules.

This change adds a new SetDefaultableHook() to DefaultableModule to
register a hook that is called after any defaults have been applied.

Also adds some tests to ensure that errors in the visibility property
introduced in a DefaultableHook are reported in the gather phase of
visibility processing.

A follow up change will switch java_sdk_library to use that instead
of the AddLoadHook() mechanism.

Bug: 155295806
Test: m checkapi
Change-Id: I13df3115f9e225f7324b6725eaeb16a78cc2538a
2020-05-06 08:55:19 +01:00
Paul Duffin
c988c8e202 Move prebuilts mutators after defaults have been applied
A follow up change will add a mechanism for a module to register a hook
that is called after any defaults have been applied. That is intended
for use by modules like java_sdk_library that create child modules that
are dependent upon properties that could be supplied by defaults.

Creating those child modules after prebuilts mutators are run will
cause problems if those child modules clash with prebuilts modules.
Moving the prebuilts mutators after the defaults mutators will fix
that.

Tests are currently being run with the mutators in different orders so
this change also cleans that up so they are consistent with the actual
code that is being run.

Bug: 155295806
Test: m checkbuild
Change-Id: I825c6df09058fb3a45db196661959eb332aca2f3
2020-05-06 08:55:16 +01:00
Treehugger Robot
f1d26b7d78 Merge "Simplify package by using LoadHook instead of mutators" am: 00789cc58b am: c11d79fe52
Change-Id: I6e6a45b00b8f3cbc8967d2474958ae555adf8dc1
2020-05-06 02:53:57 +00:00
Paul Duffin
cdfcec98bb Simplify package by using LoadHook instead of mutators
This was not previously possible due to LoadHooks being run after the
module was registered.

Bug: 155462403
Test: m nothing
Change-Id: Ia8383b9d1272bb12c8a83948753a0e4b0d98a650
2020-05-05 20:47:04 +01:00
Paul Duffin
910e564c08 Merge "Document preArch mutators" am: d0666441b5 am: 300c238638
Change-Id: Ib65a5f8e15812637a68aa6c5e2802ce5e8713f6c
2020-05-05 15:49:45 +00:00
Paul Duffin
d0666441b5 Merge "Document preArch mutators" 2020-05-05 15:24:16 +00:00
Ivan Lozano
a0cd8f9acb Add gcov coverage support to Rust modules.
This adds gcov coverage support for Rust device library and binary
modules (including test modules). Support is provided to pass Rust
static library gcno files to CC modules and visa versa.

Additional changes:
 * Begin mutator added for Rust modules.
 * SuffixInList added to android package.
 * CoverageEnabled added to Coverage interface.
 * CoverageFiles added to LinkableLibrary interface.
 * Fix in coverage mutator for non-CC modules which marked the wrong
   variant as the coverage variant.
 * Added coverage libraries to the cc.GatherRequiredDepsForTest.

Bug: 146448203
Test: NATIVE_COVERAGE=true COVERAGE_PATHS='*' m -j <rust_module>
Change-Id: If20728bdde42a1dd544a35a40f0d981b80a5835f
2020-05-05 10:30:15 -04:00
satayev
49ad72d4ef Merge changes Ie6568cb8,Ibd521c96 am: 292e7c0721 am: a07f9df5d7
Change-Id: I4dcd1f47b080a71a97db0b10c1ebfc45b8d59bdb
2020-05-05 13:14:14 +00:00
satayev
292e7c0721 Merge changes Ie6568cb8,Ibd521c96
* changes:
  Introduce min_sdk_version to deps info.
  Introduce flat deps info list.
2020-05-05 12:47:48 +00:00
Paul Duffin
aa4162e71e Document preArch mutators
Bug: 155295806
Test: m checkbuild
Change-Id: I4cd6647a8707f49363d297a3b3082ef19ba93868
2020-05-05 11:35:43 +01:00
satayev
d82f528fa3 Merge "Export depsInfo into android package." am: 57769e469b am: ed11483aa6
Change-Id: I103c2e1f0eada4b1cd516cc1a24625d680627824
2020-05-05 10:30:28 +00:00
satayev
57769e469b Merge "Export depsInfo into android package." 2020-05-05 10:00:41 +00:00
Artur Satayev
480e25b74f Introduce min_sdk_version to deps info.
Bug: 149622332
Test: m
Change-Id: Ie6568cb8a82d5cca9a3dc91b5a068abf4b0632dc
2020-05-04 19:44:28 +01:00
Treehugger Robot
5b001c96dd Merge "Report visibility errors in both check and gather phases" am: e661212b76 am: deaf0b2d07
Change-Id: Ib6f0f04e565bb1d1920ddba5e4b38b2b0b7feb94
2020-05-04 17:58:23 +00:00
Treehugger Robot
4ed2f14dbc Merge "Reduce duplication in visibility property management" am: b6b0ca1d87 am: 5879210577
Change-Id: I63fcee81adbd2a0c6b2a86d69fbf6e633f9e1914
2020-05-04 17:58:06 +00:00
Treehugger Robot
e661212b76 Merge "Report visibility errors in both check and gather phases" 2020-05-04 17:25:45 +00:00
Treehugger Robot
b6b0ca1d87 Merge "Reduce duplication in visibility property management" 2020-05-04 17:25:29 +00:00
Artur Satayev
a8bd113a69 Introduce flat deps info list.
Compared to full list, flat list drops dependency edges and simply
lists all transitive dependencies for a top-level apex bundle.

Bug: 149622332
Test: m, manually build flatlist

Change-Id: Ibd521c96b7aeab90b95965c1b524e0a0152aaf5a
2020-05-04 18:01:11 +01:00
Artur Satayev
872a144dca Export depsInfo into android package.
Move depsInfo into android for easier sharing with APK code.

Bug: 149622332
Test: m, diff'ing outputs for conscrypt module.
Change-Id: If0ee967d37425540e69b4ce9304229d9f2cd86bd
2020-05-04 18:01:09 +01:00
Ulyana Trafimovich
f1e207c738 Merge "Use two-column format for PRODUCT_BOOT_JARS components." am: 2aa8e0be11 am: 728f0c5dae
Change-Id: I0ac57804b7c9f3bc5a4f3433e7e2e6d7011cc935
2020-05-04 09:08:11 +00:00
Ulyana Trafimovich
2aa8e0be11 Merge "Use two-column format for PRODUCT_BOOT_JARS components." 2020-05-04 08:57:47 +00:00
Svet Ganov
3b0b84b8a7 Updating platform SDK version for R
* Update SDK versions

Test: build + boot

 bug:150281259

Exempt-From-Owner-Approval: merge conflict resolution

Change-Id: I30d7cda3c95327c4080e279e876129eb9e6a8091
Merged-In: I30d7cda3c95327c4080e279e876129eb9e6a8091
2020-05-02 14:39:14 -07:00
Paul Duffin
0c83aba28e Report visibility errors in both check and gather phases
Previously, errors that were found when splitting visibility rules were
only reported in the check phase and simply ignored during the gather
phase. That was because every visibility property that was processed in
the gather phase had already been checked in the check phase. However,
that is not strictly true as it has always been possible to add a
mutator between the check and gather phases that creates a module with
invalid visibility properties that will just be ignored. Fortunately,
that has not happened.

A follow up commit will add the capability to create modules after the
defaults have been applied which means the chances of invalid visibility
properties being ignored will increase.

This change makes both phases report any errors they find. It will not
have any impact on existing code as if any errors are reported in the
check phase then the build will exit before the gather phase. It will
prevent any invalid visibility errors from being ignored.

Bug: 155295806
Test: m nothing
Change-Id: I101fa6b03d2530b16e4394a9e466fead48be0ff0
2020-05-01 18:35:07 +01:00
Paul Duffin
5ec73ecc08 Reduce duplication in visibility property management
Adds a couple of new methods to manage visibility property instances to
reduce duplication and encapsulate the implementation slightly better.

The AddVisibilityProperty method is exported as it will be needed by
other packages in follow up commits.

Bug: 155295806
Test: m nothing
Change-Id: Ic1a9bb1e151fc6ae65761344fd210b4e4ba74fbc
2020-05-01 18:35:05 +01:00
Ulya Trafimovich
50c4a4b19f Use two-column format for PRODUCT_BOOT_JARS components.
The first component is the apex name, or a special name "platform"
if the boot jar is a platform jar rather than a part of some apex.
This is a prerequisite change for moving core-icu4j to a separate
com.android.i18n apex.

Old one-column format is still supported, but all unqualified
components of PRODUCT_BOOT_JARS get "platform:" prepended to them
after reading the product makefiles.

Test: aosp_walleye-userdebug boots
Bug: 138994281
Change-Id: Ic229159fdcdaf6182210a53b63850a389dd786fc
2020-04-30 14:42:32 +01:00
Evgenii Stepanov
19ff3c9bb8 [soong] Zero and pattern initialization of heap memory.
Bug: 155227507
Test: build with and without MALLOC_PATTERN_FILL_CONTENTS, MALLOC_ZERO_CONTENTS
Change-Id: I79a675e1b20897e8f88e89b1b2d6758e8b91f0be
2020-04-29 15:33:07 -07:00
Ramy Medhat
1dcc27e47c Refactor RBE support for Javac/R8/D8 to use the remoteexec package.
Test: build with and without RBE_JAVAC/RBE_R8/RBE_D8 set.
Change-Id: I1607f8cfb4d2c3cbb3672152bbeb561d9968bc60
2020-04-28 11:37:20 -04:00
Treehugger Robot
01db260858 Merge "mark platform un-availability" 2020-04-27 12:37:45 +00:00
Jiyong Park
62304bbeec Add test_for property
This change adds 'test_for' property to cc_test_* types. The property is
used to mark a module as a test for one or more APEXes, in which case
the module has accecss to the private part of the listed APEXes. For
example, the module is linked with the actrual shared library in the
APEX instead of the stub of the shared library.

Exempt-From-Owner-Approval: already +2'ed by owner

Bug: 129539670
Bug: 153046163
Test: m
Change-Id: I45ed0d7a15540b0d69b2a3b8d9c4cb202adff6f2
2020-04-25 06:25:42 +00:00
Jooyung Han
28a49820e4 Merge "Apex: support codenames for min_sdk_version" 2020-04-25 04:41:44 +00:00
Jiyong Park
89e850ab84 mark platform un-availability
A module is marked unavailable for platform when 1) it does not have
"//apex_available:platform" in its apex_available property, or 2)
it depends on another module that is unavailable for platform.

In that case, LOCAL_NOT_AVAILABLE_FOR_PLATFORM is set to true for the
module in the Make world. Later, that flag is used to ensure that there
is no module with the flag is installed to the device.

The reason why this isn't entirely done in Soong is because Soong
doesn't know if a module will be installed to the device or not. To
explain this, let's have an example.

cc_test { name: "mytest", static_libs: ["libfoo"]}
cc_library_static { name: "libfoo", static_libs: ["libbar"]}
cc_library { name: "libbar", apex_available: ["com.android.xxx"]}

Here, libbar is not available for platform, but is used by libfoo which
is available for platform (apex_available defaults to
"//apex_available:platform"). libfoo is again depended on by mytest
which again is available for platform. The use of libbar should be
allowed in the context of test; we don't want to make libbar available
to platform just for the dependency from test because it will allow
non-test uses of the library as well.

Soong by itself can't tell whether libfoo and libbar are used only in the
context of a test. There could be another module depending them, e.g.,

cc_library_shared { name: "mylib", static_libs: ["libfoo"] }

can exist and it might be installed to the device, in which case
we really should trigger an error.

Since Make has the knowledge of what's installed and what's not,
the check should be done there.

Bug: 153073816
Test: m
Test: remove "//apex_available:platform" from libmdnssd (it is currently
installed to /system/lib), and check that `m system_image` fails

Change-Id: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
2020-04-24 21:40:13 +09:00
Ulya Trafimovich
7c140d828a Add "updatable" property to ApexModule interface.
For a given variant of a module that implements ApexModule interface,
the "updatable" property tests if this variant comes from an updatable
apex. For platform variants it is always false.

Test: lunch aosp_walleye-userdebug && m nothing
Bug: 138994281
Change-Id: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
2020-04-23 11:58:53 +01:00
Artur Satayev
c5570ac9b1 Allow defining neverallow in packages other than android.
This exposes test func on ValueMatcher and helpers relevant for testing neverallows.

Bug: 153333044
Test: m
Change-Id: Ied07cd33afa537f9d7aa3c33e59f4ac985901a0f
2020-04-15 12:06:13 +01:00
Jooyung Han
e5fce6cdbf Merge "Remove PLATFORM_VERSION_FUTURE_CODENAMES" 2020-04-14 04:00:03 +00:00
Jooyung Han
03302eee13 Remove PLATFORM_VERSION_FUTURE_CODENAMES
It has been wrong to split ALL_VERSIONS into exclusive two sets of
before/after TARGET_PLATFORM_VERSION.

And PLATFORM_VERSION_ALL_CODENAMES supports all *active* list of
non-finalized codenames.

Bug: 152960049
Test: m
Exempt-From-Owner-Approval: cp from master
Merged-In: I78ca88758998e440bea72ba2d56d90eea3ec99ae
Change-Id: I78ca88758998e440bea72ba2d56d90eea3ec99ae
(cherry picked from commit 424175d72a)
2020-04-14 02:06:57 +00:00
Anton Hansson
d0615e7019 Merge "Expand neverallow for sdk_version: none" 2020-04-10 14:00:16 +00:00
Treehugger Robot
1062943c8a Merge "soong config: add value_variable substitution" 2020-04-09 20:16:08 +00:00
Anton Hansson
453764070d Expand neverallow for sdk_version: none
Allow the platform stubs to specify sdk_version: none,
and add generic support for a regexp matcher.

Bug: 144149403
Test: m
Change-Id: Icaece0d9797bace8ae9741f7a029b9ea57fcbbb9
2020-04-09 14:59:16 +01:00
Jooyung Han
aed150d6ed Apex: support codenames for min_sdk_version
Apex can use codenames like "Q", "R" for its min_sdk_version property.
Also, cc_library can use codenames for its stubs.versions.

Bug: 152655956
Test: m
Merged-In: I077ad7b2ac5d90b4c8708921e43846206f05ba70
Change-Id: I077ad7b2ac5d90b4c8708921e43846206f05ba70
(cherry picked from commit 29e91d2121)
2020-04-09 16:04:17 +09:00
Colin Cross
ff550f3e13 Merge "Revert^2 "Add sdk mutator for native modules"" 2020-04-08 18:29:30 +00:00
Treehugger Robot
9e06bb64ca Merge "Make the names of 'soong_config_module_type_import' modules unique." 2020-04-08 17:39:42 +00:00
Paul Duffin
846e60dbc7 Merge "Ignore PrebuiltDepTag when processing APEX contents" 2020-04-08 14:28:47 +00:00
Ulyana Trafimovich
0d8f61640e Merge "Forbid generating boot image files for jars in updatable modules." 2020-04-08 12:15:47 +00:00
Paul Duffin
dddd5469ad Ignore PrebuiltDepTag when processing APEX contents
When a source and a prebuilt module are present in the same build a
dependency is added from the source module to the prebuilt module.
Previously, the code for generating the APEX did not recognize that
tag and in some cases (e.g. for cc_(prebuilt_)library_shared) will
fail the build.

This change:
1) Adds a test to reproduce the problem.
2) Improves the debug message by pretty printing the tag.
3) Adds a new ExcludeFromApexContents interface that can be implemented
   by a tag to declare that it should be excluded from the APEX
   contents.
4) Ignores tags that implement that interface when generating APEX
   contents.
5) Implements that interface on prebuiltDependencyTag to fix the
   test.

Bug: 153326844
Test: m nothing
Change-Id: I9dd4312c4f995c816c0a31d8d733eb5d7f56e1ea
2020-04-08 08:40:44 +01:00