Commit graph

1230 commits

Author SHA1 Message Date
Hsin-Yi Chen
d5c7188d45 Merge "Add tags to the list of lsdump paths"
am: eef3366ab3

Change-Id: Ia08611a0c926ccebfcdbfade31b09878712b82e9
2019-08-14 19:44:45 -07:00
Hsin-Yi Chen
eef3366ab3 Merge "Add tags to the list of lsdump paths" 2019-08-15 02:20:30 +00:00
Jiyong Park
046a62833c Merge "java_import can be included in apex"
am: f02f30952d

Change-Id: Ia8fb126cd81b6108d3d2b213cecf0cb38acd06d2
2019-08-12 21:50:11 -07:00
Treehugger Robot
f02f30952d Merge "java_import can be included in apex" 2019-08-13 04:18:29 +00:00
Jiyong Park
9e6c242856 java_import can be included in apex
java_import can be included in apex via 'java_libs' property.

Bug: 139175488
Test: m (apex_test.go updated)
Change-Id: I3680a47cdac93b0cb2d41da8df3f8defa2bbe670
2019-08-13 09:36:39 +09:00
Inseob Kim
4cfa0dffeb Merge "Include headers and props to VNDK snapshot"
am: 337698988a

Change-Id: Ie21ee147be804d07d7089f9bc59ce658f6d3c21e
2019-08-11 16:21:14 -07:00
Treehugger Robot
337698988a Merge "Include headers and props to VNDK snapshot" 2019-08-11 23:04:49 +00:00
Jiyong Park
72969547dc Merge "Fix sanitizer dep"
am: e49256e564

Change-Id: I2199bff441c53410030ccf7f48fc386a7e123c4f
2019-08-11 10:45:55 -07:00
Treehugger Robot
e49256e564 Merge "Fix sanitizer dep" 2019-08-11 17:12:47 +00:00
Paul Duffin
b5af6204d3 Support multiple expected errors in neverallow_test.go
Extracted some common code used by visibility_test.go and
neverallow_test.go into a new function CheckErrorsAgainstExpectations
in testing.go.

(cherry picked from commit 8e47e8bc41)
Bug: 138428610
Test: m nothing
Change-Id: Iafbadf12c6ffdc4d9128fcfe7f15792df5cfd020
2019-08-09 09:31:41 +00:00
Colin Cross
f3d807778d Merge changes I918b4878,I85238d93,Iefee8a91
am: a48f8c8070

Change-Id: Icaea636b21c37c1017d11f104b100805c77459ab
2019-08-08 17:50:47 -07:00
Treehugger Robot
a48f8c8070 Merge changes I918b4878,I85238d93,Iefee8a91
* changes:
  Add an output file tag for proguard dictionaries
  Add InstallBypassMake
  Document wokaround for yama ptrace restrictions
2019-08-09 00:12:27 +00:00
Inseob Kim
ae55303f36 Include headers and props to VNDK snapshot
For all vndk snapshot libraries, header files exported by the libraries
will be included to the snapshot. Android.bp will contain necessary
information to link against/install vndk snapshot libraires:
export_include_dirs, export_system_include_dirs, export_flags, and
relative_install_path.

Bug: 132818174
Test: 1) m nothing && mv out/soong/build.ninja /tmp && m nothing &&
         diff -u -u out/soong/build.ninja /tmp/build.ninja
Test: 2) VNDK_SNAPSHOT_BUILD_ARTIFACTS=true \
           development/vndk/snapshot/build.sh
Test: 3) development/vndk/snasphot/update.py
Test: 4) see contents of Android.bp and include directories
Change-Id: I791ab181545eb483242b04446afd40958bbb2b17
2019-08-08 18:45:59 +09:00
Jiyong Park
1d1119f4bd Fix sanitizer dep
This change fixes a problem in sanitizerMutator where a module is linked
with of non-sanitized variant of a lib at build-time, but is linked with
the sanitized variant of the lib at run-time.

This happened because, for each sanitizer type, every shared libs are
split into non-sanitized and sanitized variants, and then either of the
variants are suppressed from Make so that it isn't installed to the
device.

This change fixes the problem by NOT splitting for shared libs; only the
sanitized variant is created if needed. Header libs, static libs and
shared libs for a few sanitizer types (asan/fuzzer) are however split
into two. This is because the static and headers libs become part of the
depending module, and asan/fuzzer require that the depending module and
the dependant module should be compiled for the same sanitizer.

Bug: 138103882
Bug: 138426065
Test: m com.android.runtime.debug
Check that libziparchive exists under both
/system/apex/com.android.runtime/[lib|lib64]

Change-Id: Ia447785c485c0d049e19477b32bc638bfe6f1608
2019-08-08 01:51:26 +09:00
Paul Duffin
c9c0f52ea5 Merge changes from topic "restrict-libandroidicu-usages"
am: d5a57d8fc5

Change-Id: I5c6fa0a1806bbbb502564d96a8f28a110162c6e8
2019-08-07 04:10:21 -07:00
Hsin-Yi Chen
5348964723 Add tags to the list of lsdump paths
This commit adds tags, such as NDK, VNDK-core, and PLATFORM, to
LSDUMP_PATHS. The script updating the reference ABI dumps uses the tags
to determine the directories where the dumps should be created.

Test: make findlsdumps
Bug: 133176785
Change-Id: I8540286238cf0ec55c65e1c4f60cb9c12e5e57a1
2019-08-07 13:40:11 +08:00
Colin Cross
607d8587e4 Add InstallBypassMake
Allow modules to mark themselves as InstallBypassMake, which will
cause android.PathForModuleInstall to return a path in $OUT_DIR
instead of $OUT_DIR/soong.  This can be used for modules that
can handle installation to the final location on their own.  The
main blocker for most modules is support for the "required" property,
which requires adding dependencies on the installed location of
other modules.

Bug: 122332855
Test: m checkbuild
Change-Id: I85238d937ff30335167d4b3fec79bbefc734b5e1
2019-08-06 09:45:04 -07:00
Paul Duffin
f1c9bbee88 Support restrictions based on a module's OsClass
Bug: 137543088
Test: m nothing
Change-Id: Ibb05f222594d8180746b612c04ab1538a1cf3c0b
2019-08-06 11:09:09 +01:00
Paul Duffin
3578188fac Support restrictions based on a module's dependencies
Adds a neverallow InDirectDeps(deps) verb that will allow a neverallow
rule to restrict access to a specific dependency, irrespective of how
it is specified.

Bug: 137543088
Test: m nothing
Change-Id: I0c6bb702d55175e9b78b79e86e96924c5dd83efa
2019-08-06 11:09:02 +01:00
Jooyung Han
3c6423ef1a Put dependency in apex_manifest.json
am: e16330393a

Change-Id: I1090b2cc5154e7fefb1a16655ac874799fab740f
2019-08-05 17:33:57 -07:00
Treehugger Robot
d62b4af8b7 Merge changes from topic "put-dep-in-apex"
* changes:
  Add jsonmodify tool
  Put dependency in apex_manifest.json
2019-08-06 00:21:11 +00:00
Elliott Hughes
4177df9567 Merge "Reland "Remove product_is_iot.""
am: 80e071d1da

Change-Id: I875289d3b5f88034b4e1256054b41fb9e05dfdd1
2019-08-01 11:59:54 -07:00
Elliott Hughes
80e071d1da Merge "Reland "Remove product_is_iot."" 2019-08-01 18:24:26 +00:00
Jooyung Han
e16330393a Put dependency in apex_manifest.json
To generate ld.config.txt dynamically(b/123722631), each APEX should
provide some dependency information:
a) list of libraries which other APEXes(or system) can use from this apex
b) list of libraries which this apex uses from other APEXes(or system)

This change puts dependency information in apex_manifest.json at
build-time with two additional keys:
a) provideNativeLibs
b) requireNativeLibs

Bug: 138695532
Test: m (runs soong tests)
Test: find $OUT/apex -name apex_manifest.json  -exec cat {} \;
 (shows contents of apex_manifest.json files)

Change-Id: Iaad12c8c35454222ad177ce923cce76ef12a8a5a
2019-08-01 23:45:37 +09:00
Elliott Hughes
1f3a239953 Reland "Remove product_is_iot."
This reverts commit 5089c11b1e.

Change-Id: Iaedc22e63560a01ab01859982dc627569a421025
Test: treehugger
2019-08-01 14:42:12 +00:00
Nelson Li
742677d7b6 Merge "Revert "Remove product_is_iot.""
am: 604374742d

Change-Id: I85167277df48f3887d17a2670167b6aba6c5519d
2019-08-01 03:37:17 -07:00
Treehugger Robot
604374742d Merge "Revert "Remove product_is_iot."" 2019-08-01 10:16:24 +00:00
Nelson Li
5089c11b1e Revert "Remove product_is_iot."
This reverts commit 14fa562fbb.

Reason for revert: Broken build on 5772180

error: frameworks/av/media/utils/Android.bp:49:23: unrecognized property "product_variables.product_is_iot"

Bug: 138764596
Change-Id: I37944dfb974e4180a683361f514b404f92b943e5
2019-08-01 06:28:05 +00:00
Elliott Hughes
7bb10aa40d Merge "Remove product_is_iot."
am: 75b3788d6c

Change-Id: Ic639b5f1ac256be3369c6fe789bbef428aeac353
2019-07-31 22:07:05 -07:00
Treehugger Robot
75b3788d6c Merge "Remove product_is_iot." 2019-08-01 04:42:40 +00:00
Steven Moreland
e3ff85b968 Merge "Automatically inherit common properties."
am: d28f688e69

Change-Id: I2608257a595ade933d291ef5c4fb1f2c633c292b
2019-07-31 09:10:41 -07:00
Steven Moreland
d28f688e69 Merge "Automatically inherit common properties." 2019-07-31 15:47:51 +00:00
Jiyong Park
fb45ee3d1e Merge "Delete prebuilt APEXes when installing source-built APEXes"
am: a822256e15

Change-Id: I576969455e028010da6631f06010fd6369c4b589
2019-07-31 00:40:06 -07:00
Treehugger Robot
a822256e15 Merge "Delete prebuilt APEXes when installing source-built APEXes" 2019-07-31 07:03:49 +00:00
Steven Moreland
12f23e0883 Automatically inherit common properties.
Before, the values were often simply ignored. If bad values are provided
now, we should be able to catch them.

Bug: 119771576
Test: relying on this for AIDL/HIDL
Change-Id: I8d2ff26da0b2d01ebe7f78c26d69c7b618a65367
2019-07-30 22:42:19 +00:00
Elliott Hughes
14fa562fbb Remove product_is_iot.
Test: treehugger
Change-Id: I0935f463138e1d2a364cd2a5bc8b6e977da1ec47
2019-07-30 08:43:50 -07:00
Jiyong Park
03b68ddd10 Delete prebuilt APEXes when installing source-built APEXes
To build the platform for ASAN, we do

`m && SANITIZE_TARGET='addresss' m`

However, at the end of the second build, the system partition could have
conflicting APEXes; prebuilt APEXes from the first build and
source-built APEXes from the second build. Since the file names for the
prebuilt and the source-built are different (e.g.
com.google.android.media.apex v.s. com.android.media.apex), we end up
having two files for the same APEX. This is confusing apexd at runtime
and the device fails to boot.

To fix this, when building a non-prebuilt APEX, the prebuilt APEX might
have been installed by the previous build is deleted.

Bug: 138146044
Test: lunch aosp_cf_x86_pasan; m && SANITIZE_TARGET='address' m
check that out/target/product/vsoc_x86/system/apex has
com.android.*.apex only.

Change-Id: Ib5a021a297cf0173ea5a3b50e9398b1cf295c558
2019-07-30 13:52:15 +09:00
Sasha Smundak
61272795a7 Merge "Support source code cross-referencing for C++ and Java"
am: 247de68b89

Change-Id: I5284d9be9865e95671ce8ec1927f74059f7fdf44
2019-07-29 18:13:05 -07:00
Treehugger Robot
247de68b89 Merge "Support source code cross-referencing for C++ and Java" 2019-07-30 00:13:12 +00:00
Sasha Smundak
2a4549ec98 Support source code cross-referencing for C++ and Java
Use Kythe (https://kythe.io) to build cross reference for the Android
source code. ~generate the input for it during the build. This is done
on demand: if XREF_CORPUS environment variable is set, build emits a
Ninja rule to generate Kythe input for each compilation rule. It
also emits two consolidation rules (`xref_cxx` and `xref_java`),
that depend on all Kythe input generation rules for C++ and Java.

The value of the XREF_CORPUS environment variable is recorded in the
generated files and thus passed to Kythe. For the AOSP master branch it is
`android.googlesource.com/platform/superproject`, so the command to build
all input for Kythe on that branch is:
```
XREF_CORPUS=android.googlesource.com/platform/superproject m xref_cxx xref_java
```

Each Kythe input generation rule generates a single file with .kzip
extension. Individual .kzip files have a lot of common information, so
there will be a post-build consolidation step run to combine them.
The consolidated .kzip file is then passed to Kythe backend.

The tools to generate .kzip files are provided by Kythe (it calls them
'extractors'). We are going to build them in toolbuilding branches
(clang-tools and build-tools) and check them in as binaries into master
and other PDK branches:
For C++,  `prebuilts/clang-tools/linux-x86/bin/cxx_extractor`
for Java, `prebuilts/build-tools/common/framework/javac_extractor.jar`

Bug: 121267023
Test: 1) When XREF_CORPUS is set, build generates Ninja rules to create
.kzip files; 2) When XREF_CORPUS is set, building
`xref_cxx`/`xref_java` creates .kzip files; 3) Unless XREF_CORPUS is
set, build generates the same Ninja rules as before

Change-Id: If957b35d7abc82dbfbb3665980e7c34afe7c789e
2019-07-26 09:16:47 -07:00
Paul Duffin
cdfa3fb705 Merge changes I7b9462d3,Icadd470a,I1d459da1,I01d8f518
am: 4b03cb46a5

Change-Id: I6a5fc7321e80333390189a1adb7a1ffb3553bd7c
2019-07-26 01:59:32 -07:00
Paul Duffin
4b03cb46a5 Merge changes I7b9462d3,Icadd470a,I1d459da1,I01d8f518
* changes:
  Add defaults_visibility support
  Refactor visibility to support visibility on defaults modules
  Add DefaultsModule interface
  Improve documentation of defaults mechanism
2019-07-26 08:35:15 +00:00
Jooyung Han
4739405a0e Merge "fix: prebuilt_etc_xml"
am: 04b2a82b77

Change-Id: I581999dc553a745d49f05a0954d965ca0fa28213
2019-07-25 22:24:39 -07:00
Treehugger Robot
04b2a82b77 Merge "fix: prebuilt_etc_xml" 2019-07-26 04:57:29 +00:00
Paul Duffin
f5df899687 Merge "Fixed minor typo"
am: e515886a8b

Change-Id: I5d99efb2e18c02eacb5946320fd7d3504e1e32b5
2019-07-25 10:51:11 -07:00
Paul Duffin
036cacee51 Fixed minor typo
Bug: 138207002
Test: m nothing
Change-Id: Idc6bc6ae9d7e4052da0c0bde6247bff47eab60be
2019-07-25 14:44:56 +01:00
Paul Duffin
95d53b584f Add defaults_visibility support
Bug: 130796911
Test: m nothing
Change-Id: I7b9462d3360be2bbeaf6ff38c5328f45ff5b5ebb
2019-07-25 11:48:21 +01:00
Paul Duffin
63c6e183d5 Refactor visibility to support visibility on defaults modules
Existing modules, either general one or package ones have a single
visibility property, called visibility in general, and
default_visibility on package, that controls access to that module, or
in the case of package sets the default visibility of all modules in
that package. The property is checked and gathered during the similarly
named phases of visibility processing.

The defaults module will be different as it will have two properties.
The first, visibility, will not affect the visibility of the module, it
only affects the visibility of modules that 'extend' the defaults. So,
it will need checking but not parsing. The second property,
defaults_visibility, will affect the visibility of the module and so
will need both checking and parsing.

The current implementation does not handle those cases because:
1) It does not differentiate between the property that affects the
   module and those that do not. It checks and gathers all of them with
   the last property gathered overriding the rules for the previous
   properties.

2) It relies on overriding methods in MethodBase in order to change the
   default behavior for the package module. That works because
   packageModule embeds ModuleBase but will not work for
   DefaultsModuleBase as it does not embed ModuleBase and instead is
   embedded alongside it so attempting to override a method in
   MethodBase leads to ambiguity.

This change addresses the issues as follows:
1) It adds a new visibility() []string method to get access to the
   primary visibility rules, i.e. the ones that affect the module.

2) It adds two fields, 'visibilityPropertyInfo []visibilityProperty'
   to provide information about all the properties that need checking,
   and 'primaryVisibilityProperty visibilityProperty' to specify the
   property that affects the module.

The PackageFactory() and InitAndroidModule(Module) functions are
modified to initialize the fields. The override of the
visibilityProperties() method for packageModule is removed and the
default implementations of visibilityProperties() and visibility()
on ModuleBase return information from the two new fields.

The InitDefaultsModule is updated to also initialize the two new
fields. It uses nil for primaryVisibilityProperty for now but that
will be changed to return defaults_visibility. It also uses the
commonProperties structure created for the defaults directly instead
of having to search for it through properties().

Changed the visibilityProperty to take a pointer to the property that
can be used to retrieve the value rather than a lambda function.

Bug: 130796911
Test: m nothing
Change-Id: Icadd470a5f692a48ec61de02bf3dfde3e2eea2ef
2019-07-25 11:31:42 +01:00
Paul Duffin
e62432feee Add DefaultsModule interface
Changes the InitDefaultsModule method from taking a DefaultableModule
to taking a DefaultsModule in preparation for adding visibility support
to defaults modules.

Bug: 130796911
Test: m nothing
Change-Id: I1d459da1017ae7f2654e7eb275cb424e52d85730
2019-07-25 10:51:27 +01:00
Paul Duffin
7df7fb0dff Improve documentation of defaults mechanism
Also, removes unnecessary cast from DefaultableModule to Defaultable.

Bug: 130796911
Test: m nothing
Change-Id: I01d8f5186927215a1aa6b7431558041f427d7381
2019-07-25 10:50:57 +01:00