Commit graph

17362 commits

Author SHA1 Message Date
Colin Cross
2b10ba0ee2 Add product_variables.native_coverage.src
Test: m checkbuild
Fixes: 148088129
Change-Id: I38fb22b28de1176ed880708733f7e7f76bee2e50
2020-02-06 17:46:26 -08:00
Colin Cross
eabaedd520 Fix product variables in defaults modules
Product variables structs are generated at runtime to contain only
the properties that apply to the current module.  Defaults modules
always contained all product variable properties. Defaults modules
apply their properties to the target module using
proptools.PrependProperties, which prepends structs that have
matching types.  Filtered property structs had a different type
and were dropped.

Even after adding filtering to the defaults product variable
properties, defaults modules may contain more property structs
than the target module they are applied to, so the product
variables struct for the defaults module could contain more
fields than the product variables struct for the target module.
Use proptools.PrependMatchingProperties when applying defaults
of product variables instead, which will apply matching properties
across types.

Test: defaults_test.go
Test: variable_test.go
Change-Id: I281bdefef92053457a3b7b65383493a4e7d999df
2020-02-06 17:43:29 -08:00
Colin Cross
6961a491a5 Fix product variable zero value check
The zero value check was being done by using reflect.DeepEqual on a
field from the default product variables, but this results in
comparison against a random type when the product variables struct
for the module has been filtered down.  Luckily this will always
fail false, which just removed and optimization but left the
behavior correct.

Use reflect.IsZero instead, which is both faster and correct.

Test: variable_test.go
Change-Id: Ieaaa590c2788ca39230e6695397e8ba8d1c6c103
2020-02-06 17:41:19 -08:00
Jaewoong Jung
387ad5c576 Merge "Add rules to handle asset resources." 2020-02-05 22:24:39 +00:00
Anna Trostanetski
86a5dc5575 Merge "Add support for compat config in APEX." 2020-02-05 19:24:12 +00:00
Treehugger Robot
e89f7354f8 Merge "Minor cleanup in soong_config_modules documentation." 2020-02-05 18:41:53 +00:00
atrost
6e12625c0f Add support for compat config in APEX.
apex module accepts PlatformCompatConfigIntf as prebuilt,
and places it in the etc folder of the apex.

Test: m
Test: flash device with dummy config in mediaprovider APEX -
the config is present
Change-Id: Ifc62cd262f6c6571c1bf6c2943879aa20877ecad
2020-02-05 13:33:50 +00:00
Paul Duffin
50fea3b6a7 Merge "java_sdk_library use prebuilt jars for numeric sdk_version" 2020-02-05 08:06:52 +00:00
Treehugger Robot
26a6eb7971 Merge "Dedup adding of arch/common properties to cc library snapshot" 2020-02-04 22:57:45 +00:00
Kyriakos Ispoglou
08cc141860 Merge "Add support for LINE_COVERAGE (1/2)" 2020-02-04 22:37:41 +00:00
Bill Peckham
c93258bfec Minor cleanup in soong_config_modules documentation.
Test: build
Change-Id: Ia5a43a024203ca4b714926bcc89f7ec12523b8ad
2020-02-04 13:17:24 -08:00
Paul Duffin
74fc190d90 Dedup adding of arch/common properties to cc library snapshot
Some additional, possibly arch specific, properties need adding to
cc library (e.g. recovery_available). This dedups and cleans up the
code involved to simply the addition of those new properties.

Bug: 142918168
Test: m nothing
Change-Id: I0963aa02e9504af1ae9b427ff1016e7c481465f4
2020-02-04 18:48:31 +00:00
Anna Trostanetski
026ffecb9d Merge "Build rules for compat config docs generation." 2020-02-04 16:28:40 +00:00
Mathew Inwood
abd49ab4df Build rules for compat config docs generation.
We add a compat config build rule to extract the merged config, and
then update the droiddoc build rule to consume that.

Test: m -j offline-sdk-docs
Bug: 144927670
Change-Id: Ib1e85f97895c89227882e665572bda9bfc2a8cba
Exempt-From-Owner-Approval: ag/10097965 approved internally, Colin requested to patch to aosp
2020-02-04 16:28:22 +00:00
Paul Duffin
a2db18fb1e java_sdk_library use prebuilt jars for numeric sdk_version
Previously, when a library that used a numeric sdk version also
referenced a java_sdk_library it would use the current version of its
API. That was dangerous as there is an expectation that an app building
against a numbered version will also be targeted at that version and
so building against a later version of the API could hide runtime
incompatibilities.

This change will use prebuilt versions of the java_sdk_library's api
when being built for a numbered sdk version.

Bug: 148080325
Test: m droid
Change-Id: I3fd416553950785a443c1702e495a96debc33331
2020-02-04 14:47:04 +00:00
Paul Duffin
1b57531573 Merge changes from topic "expose-system-test"
* changes:
  Remove legacy properties from java_sdk_library_import
  java_sdk_library_import - expose system and test stubs
2020-02-04 08:26:30 +00:00
Vic Yang
6cee077b0b Merge "Disable no-vendor-variant VNDK for CFI modules" 2020-02-03 21:09:47 +00:00
Treehugger Robot
dcbc329713 Merge "Update NDK ABIs config away from armv5." 2020-02-03 20:28:41 +00:00
Stephen Hines
ab2053ffab Merge "Switch to r370808b." 2020-02-03 18:06:41 +00:00
Jaewoong Jung
411a98a917 Merge "Export the cert path for runtime_resource_overlay." 2020-02-03 17:43:46 +00:00
Paul Duffin
fcfd79166c Remove legacy properties from java_sdk_library_import
The legacy usages have all been updated so the legacy properties
can be safely removed. The Libs property is kept so it can be used to
specify properties common to all scopes.

Bug: 148080325
Test: m droid
      TARGET_BUILD_APPS=Camera2 m

Change-Id: I252ebbedbb463db3c7346e86d86b5880eea76fe9
2020-02-03 15:58:08 +00:00
Paul Duffin
56d4490d59 java_sdk_library_import - expose system and test stubs
Previously, the java_sdk_library_import only exposed the public stubs.
This change adds support for exposing system and test stubs too by adding
separate structures for public, system and test scopes. The existing
properties are kept for legacy reasons (and because libs can be common
across the differents scopes).

It extracts some code that is common to both sdk library and sdk
library import.

The legacy support will be removed in a future change once all existing
usages have been switched over.

Bug: 148080325
Test: m droid
      TARGET_BUILD_APPS=Camera2 m
Change-Id: I0b26cc8af9ee044437ff3b80c1eca611816b9386
2020-02-03 15:58:08 +00:00
Treehugger Robot
db84575f84 Merge "Script to set up android build directory" 2020-02-01 23:08:27 +00:00
Treehugger Robot
b708108b60 Merge "Improve java_sdk_library handling of test_current" 2020-02-01 08:42:27 +00:00
Treehugger Robot
4136c9b9ea Merge "Fix writing module_bp_cc_deps.json" 2020-02-01 06:14:28 +00:00
Stephen Hines
2b2df22ca5 Switch to r370808b.
Bug: http://b/147628579
Test: m and run CTS subset
Change-Id: I9eb1b33385b939001bfcc50c807829068a35744c
2020-01-31 15:24:22 -08:00
Kyriakos Ispoglou
db03c22e54 Add support for LINE_COVERAGE (1/2)
This is the 1st part of the CL. It adds support to enable compilation
of line coverage instrumented binaries. For more details please refer
to the design doc: go/android-line-coverage-doc

Bug: b/147604881
Test: Code works successfully on Taimen devices
Change-Id: I07745c1438b611041ed032dd4b7788cb50130845
2020-01-31 14:47:12 -08:00
Treehugger Robot
d35fcae5dc Merge "Default to pattern initialization for uninitialized variables (try 2)." 2020-01-31 21:52:44 +00:00
Vic Yang
1a5812a262 Disable no-vendor-variant VNDK for CFI modules
If CFI is enabled for a module, no-vendor-variant VNDK will fail
because CFI is not used for the vendor variant.

Bug: 148638729
Test: Remove libstagefright_bufferpool@2.0 from the whitelist. Build on
      crosshatch is successful. Build on a ARM32 device with
      TARGET_VNDK_USE_CORE_VARIANT set and check no-vendor-variant VNDK
      is still enabled for libstagefright_bufferpool@2.0.

Change-Id: Ib0a411d7ea769097186afa802751b0796527ec76
2020-01-31 10:41:27 -08:00
Jaewoong Jung
78ec5d8d6c Export the cert path for runtime_resource_overlay.
Fixes: 119811120
Test: app_test.go
Test: Converted and built IconPackFilledSystemUIOverlay
Change-Id: I3f7eae3127996773c5abf9f9bdb9d57a198ddaa3
2020-01-31 10:39:40 -08:00
Colin Cross
37c5cda47c Fix writing module_bp_cc_deps.json
module_bp_cc_deps.json was not written through
android.WriteFileToOuptutDir, so it didn't get the absolute path
prepended when sandboxing was turned on.  Reuse the implementation
from module_bp_java_deps.json.

Bug: 147409906
Test: m SOONG_COLLECT_CC_DEPS=1 nothing
Change-Id: I3b255bdfd3b4c442db06fe185765414905531410
2020-01-31 18:12:41 +00:00
Yi Kong
56bcaa6dc1 Merge "Add -fprofile-sample-accurate flag for sampling PGO" 2020-01-31 14:51:14 +00:00
Paul Duffin
726d23c26a Improve java_sdk_library handling of test_current
When building a library against sdk_version: system_current it uses the
system stubs of any java_sdk_library that it references. Previously,
when building against sdk_version: test_current this used the public
stubs of any java_sdk_library. This change causes it to use the
test stubs instead to be consistent with the handling of system and
public.

Bug: 148080325
Test: updated the test
      ran m nothing which failed as expected
	  fixed the code
	  ran m nothing again which succeeded
Change-Id: I58ec5bd243701c5a5c75664e2bb615ce7b2f2441
2020-01-31 13:42:41 +00:00
Paul Duffin
67edce7adb Merge "Make sdkMemberDependencyTag usable outside sdk package" 2020-01-31 10:11:16 +00:00
Treehugger Robot
b8e5c68fef Merge "Parameterize java_sdk_library by api scope" 2020-01-31 06:54:47 +00:00
Yi Kong
b6ec66a173 Add -fprofile-sample-accurate flag for sampling PGO
This flag indicates that the sample profile data matches the source
and can be fully trusted. The compiler will make aggressive
assumption that functions without any samples are cold functions,
and will optimize for size for them.

Test: binary size reduces to match instr PGO
Bug: 79161490
Change-Id: I53d6d05be70c39e5eb28b2f5b0549d9eb6b5cc62
2020-01-31 12:36:38 +08:00
Yi Kong
50dab0e45f Merge "Add -fdebug-info-for-profiling flag to emit more debug info for sampling pgo" 2020-01-31 03:49:13 +00:00
Sasha Smundak
9dd454b3ac Script to set up android build directory
Test: manual
Change-Id: I93aa3aa9745330ec21385ce12cc586aeaa803e12
2020-01-30 19:18:54 -08:00
Treehugger Robot
86ef38cfbf Merge "Add native_coverage to product variables" 2020-01-31 03:12:22 +00:00
Dan Albert
6bba644205 Update NDK ABIs config away from armv5.
Test: treehugger
Bug: None
Change-Id: I0e4909e8a394814edbcc3e9f80d3a6e4a273127b
2020-01-30 16:26:41 -08:00
Treehugger Robot
29fd971526 Merge changes I99cdff4b,Ia6b5cff8,I0f438509
* changes:
  Allow an arbitrary tag to be associated with a bp property
  Rewrite code for creating versioned modules as a transformation
  Add support for transforming a module
2020-01-30 23:12:39 +00:00
Stephen Hines
0e1d5d8ab3 Default to pattern initialization for uninitialized variables (try 2).
Pattern initialization helps us make C++ safer, while not altering the
semantics/usage of C++ (as zero init does).

Bug: 131390872
Test: Local testing. Parts of CTS.
Change-Id: Ic4af9260a48c10cbd70315fa56d6b01c5ca61768
2020-01-30 15:06:00 -08:00
Paul Duffin
d1b3a92f05 Parameterize java_sdk_library by api scope
The java_sdk_library duplicated a lot of code related to api scopes and
also did a lot of switching on apiScope. This change eliminates that
duplication and switching by converting apiScope from an enum to a
structure containing api scope specific information.

It associates dependencies with corresponding scope by using a
scopeDependencyTag that contains a reference to the associated
apiScope.

Tested by:
1) Running the command below without the changes.
2) 'mv out/dist/apistubs $ANDROID_BUILD_TOP'
3) Applying these changes.
4) Running the command again.
5) Verifying that the out/dist/apistubs was identical to before the
   change using 'meld out/dist/apistubs $ANDROID_BUILD_TOP/apistubs'

Bug: 148080325
Test: m TARGET_PRODUCT=sdk TARGET_BUILD_VARIANT=userdebug dist sdk
      m droid
Change-Id: I0de3268b12254122e94ca83d09309b06ca2f9dbe
2020-01-30 17:26:18 +00:00
Treehugger Robot
44fc5d201f Merge "Use merge_csv python_binary." 2020-01-30 15:18:58 +00:00
Yi Kong
61a1b988fd Add -fdebug-info-for-profiling flag to emit more debug info for sampling pgo
Test: m
Bug: 79161490
Change-Id: I25cfbf78b27d653286dc7f956743f8855b852b35
2020-01-30 21:15:12 +08:00
Paul Duffin
f8539922d4 Make sdkMemberDependencyTag usable outside sdk package
Moves the struct to android/sdk.go and abstracts it behind a factory
method and interface. That allows it to be used outside the sdk
package.

This change is in preparation for adding support for module types that
have transitive sdk members.

Bug: 142940300
Test: m nothing
Change-Id: I71e5e0adf839b28a3a0952f82637637887f02688
2020-01-30 11:45:47 +00:00
Paul Duffin
5b511a200e Allow an arbitrary tag to be associated with a bp property
This is preparation for enhancing the versioning tranformer to support
applying per property transformations. Specifically, to allow
properties to reference other libraries within the sdk.

Bug: 142940300
Test: m nothing
Change-Id: I99cdff4b407763ed395ff358d8110a63c6cf5589
2020-01-30 11:45:47 +00:00
Paul Duffin
e6c0d845fd Rewrite code for creating versioned modules as a transformation
Moves the code for transforming an unversioned module into a
versioned module into a transformer.

This is preparation for enhancing the versioning tranformer to support
applying per property transformations. Specifically, to allow
properties to reference other libraries within the sdk.

Bug: 142940300
Test: m nothing
Change-Id: Ia6b5cff8e1b5cd7232e031769d9fc0019e815fcb
2020-01-30 11:45:47 +00:00
Paul Duffin
b4d9c1f0ef Add support for transforming a module
Adds support for transforming a bpModule using a bpTransformer
instance. Rewrites the deepCopy code as a transformer.

This is preparation for allowing the update process to perform
per property transformations when transforming an unversioned
prebuilt module to a versioned prebuilt module for use by a
versioned snapshot.

Bug: 142940300
Test: m nothing
Change-Id: I0f438509df23bbb8a5862541b6fbfb1d5fbc06f6
2020-01-30 11:45:47 +00:00
Colin Cross
041ac6f2ce Merge "Allocate OutputPath.String in PathForOutput" 2020-01-30 05:06:35 +00:00