Commit Graph

16673 Commits

Author SHA1 Message Date
Jooyung Han a463f720aa delete redundant code
no need to use separate test-only key for config.Once().

Test: m
Change-Id: I9e05d413504114df8f8ea8d9ef521db1d5da5d01
2019-11-01 09:00:11 +09:00
Jooyung Han 0302a84ddc Soong generates vndk-related .libraries.txt files
This is a follow-up CL of I9a24f6975bd4b226a94f61a13d43857dcdce6b88

Generated files are passed to make via MakeVars:
- SOONG_LLNDK_LIBRARIES_FILE
- SOONG_VNDKCORE_LIBRARIES_FILE
- SOONG_VNDKSP_LIBRARIES_FILE
- SOONG_VNDKPRIVATE_LIBRARIES_FILE
- SOONG_VNDKCOREVARIANT_LIBRARIES_FILE
- SOONG_VNDK_LIBRARIES_FILE

Previously filenames were "guessed" from module names. Now VndkMutator
stores filenames as well and generate those files with them.

Bug: 142963962
Bug: 141450808
Test: m && device boots && TH
Change-Id: I0c248b707188f904df60ead50059fefe90bfd17f
2019-11-01 04:35:21 +09:00
Jooyung Han dc782449b8 apex: Restrict usage of "use_vendor"
When use_vendor is used, native modules are built with
__ANDROID_VNDK__ and __ANDROID_APEX__, which may cause
compatibility issues. (e.g. libbinder)

Even though libbinder restricts its availability via
'apex_available' property and relies on yet another macro
__ANDROID_APEX_<NAME>__, we restrict usage of "use_vendor:" from
other APEX modules to avoid similar problems.

Bug: 142684427
Test: m -j
Change-Id: Ibc781de2efcd20cb6688a183b08e908a8a6e2593
2019-11-01 03:15:38 +09:00
Sundong Ahn abb6443895 Create variants for each image type
Create variant of image, zip or flattened according to
TARGET_FLATTEN_APEX and payload type.
If payload type is zip, only zip variant is created because flattened
apex is not supported. And if payload type is image, image and flattened
variants are created.

Bug: 139053989
Test: m -j
Change-Id: Ibde18490d23ec602c4cca97cf97db90a562e014e
2019-10-31 22:14:46 +09:00
Jiyong Park 0b2387551b stem property of java modules are propagated to Make
62c7829595c0df53e96addcd347c11ac01012eee introduced the new stem
property to java modules, but it wasn't propagated to Make. Fixing the
problem.

This change also fixes a problem that (module name) == (file name) is
assumed in dexpreopt_config.go, which no longer is the case. A mutator
runs to build a map from module name to its stem. The map is then used
when filling up the file paths in the bootImageConfig struct.

Bug: 139391334
Bug: 143494499
Test: m
Test: BootImageProfileTest
Change-Id: Idbc894f877692401471130de6cbfe5e0dd129da9
2019-10-31 22:13:05 +09:00
Jiyong Park 9495b76fbd Remove api_srcs property from java_sdk_library
The property is no longer used.

Bug: 141149570
Test: m
Change-Id: I3136c7b03138296dc59127f596f7e96502edf608
2019-10-31 20:38:14 +09:00
Kris Alder edf33a3253 Merge "change output file extension (config.txt -> config.json)"
am: 5d0b3b7195

Change-Id: I78b645ef6826b3cd767246c6aad8468b4f6da6c0
2019-10-30 22:15:21 -07:00
Kris Alder 5d0b3b7195 Merge "change output file extension (config.txt -> config.json)" 2019-10-31 04:59:55 +00:00
Jooyung Han 15e234ef49 Merge "apex: __ANDROID_APEX__ defined with no value"
am: bdad6c378f

Change-Id: I71874576abede7a6695dec226be331fd33bd60ab
2019-10-30 17:08:56 -07:00
Jooyung Han bdad6c378f Merge "apex: __ANDROID_APEX__ defined with no value" 2019-10-30 23:50:58 +00:00
Kris Alder db97af4a4b change output file extension (config.txt -> config.json)
This is causing some build errors because the config.json file isn't
associated with a rule (because the rule looks for .txt).

Test: ran locally, checked output directory
Bug: 142551000
Change-Id: Idcdb226fa2d23055a8850b2a0545202921edc3b1
2019-10-30 20:58:54 +00:00
Mitch Phillips 7be457b958 Merge "Use unstripped binaries in fuzz target packaging."
am: 9f221955f4

Change-Id: I1e2ee8c60dbaa34c12380a919ab6d383df9613a6
2019-10-30 13:56:32 -07:00
Treehugger Robot 9f221955f4 Merge "Use unstripped binaries in fuzz target packaging." 2019-10-30 20:48:14 +00:00
Xin Li c5ac9cb1ef DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master
Bug: 142003500
Change-Id: Ib0edd4fcbe2b2b260811ea3f8a66bd6a7a713a3d
2019-10-30 11:46:30 -07:00
Nicolas Geoffray bad55f821f Merge "Revert "Package dexpreopt artifacts for libcore jars in the ART apex.""
am: 8a947aeefc

Change-Id: I774fbaeba08c4b8f65bb61104ce1c10951881392
2019-10-30 04:39:27 -07:00
Nicolas Geoffray 8a947aeefc Merge "Revert "Package dexpreopt artifacts for libcore jars in the ART apex."" 2019-10-30 11:28:12 +00:00
Nicolas Geoffray 24babe3a66 Revert "Package dexpreopt artifacts for libcore jars in the ART apex."
This reverts commit d5df949385.

Bug: 143594594
Bug: 143593500
Reason for revert: Some builds are failing.

Change-Id: I69986b472bce39266095e526fcd7ef5f48ece85e
Exempt-From-Owner-Approval: Going back to green.
2019-10-30 11:27:58 +00:00
Ulyana Trafimovich a804df13ea Merge "Package dexpreopt artifacts for libcore jars in the ART apex."
am: b30d91cbc5

Change-Id: I87fb00609c489546946074f0a4780c1bd90cd32e
2019-10-30 03:26:33 -07:00
Ulyana Trafimovich b30d91cbc5 Merge "Package dexpreopt artifacts for libcore jars in the ART apex." 2019-10-30 10:13:32 +00:00
Chih-hung Hsieh 462e944d4d Merge "Add rust_test and rust_test_host."
am: bb3e6c3c35

Change-Id: I2bc641d67abb06a736a7ea27da96c020918807d6
2019-10-30 00:40:00 -07:00
Chih-hung Hsieh bb3e6c3c35 Merge "Add rust_test and rust_test_host." 2019-10-30 07:22:53 +00:00
Jooyung Han d178df9c20 Merge changes from topic "fix-vndk-core-variant"
am: 61eb8aaea4

Change-Id: If9b5bc238965c0adf4df9b51932025076bb37396
2019-10-29 21:37:29 -07:00
Treehugger Robot 61eb8aaea4 Merge changes from topic "fix-vndk-core-variant"
* changes:
  Do not install VNDK lib in favor of VNDK APEX
  Fix apex_vndk with TARGET_VNDK_USE_CORE_VARIANT
  Do not follow deps for apex_vndk
2019-10-30 04:29:37 +00:00
Colin Cross 3b24d1221a Merge "smart_status: move channel write outside lock to avoid deadlock"
am: 4bce23b139

Change-Id: I6c47df3c30d88a31fd6d435d2c4e9e3f44073e7a
2019-10-29 21:12:37 -07:00
Treehugger Robot 4bce23b139 Merge "smart_status: move channel write outside lock to avoid deadlock" 2019-10-30 03:57:23 +00:00
Chih-Hung Hsieh a5f22ed6b0 Add rust_test and rust_test_host.
* Rust tests are like binary files compiled with --test.
  New test.go follows binary.go code patterns and reuses
  some code in binary.go.
* Generate one test per source file as testPerSrc in cc/test.go.
  The "all tests" variation feature of cc/test.go is not copied yet.
  Fix some Stem and SubName settings to make testPerSrc work.
* Move cc.CheckDuplicate to android.CheckDuplicate,
  which is now shared by cc and rust.
* Refactor tests in binary_test.go and add new test_test.go.

Bug: 140938178
Test: mm in rust projects, added rust_test and rust_test_host
Change-Id: Ia6fec8b4cf2572fd352ab1938a1f3c7b5cca2212
2019-10-29 17:19:03 -07:00
Jooyung Han b01c114d27 Do not install VNDK lib in favor of VNDK APEX
Since VNDK APEX replaces VNDK lib /system/lib/vndk{-sp}, VNDK libs are
not installed.

Bug: 141451661
Test: m && boot device
Change-Id: I14686927a56ded5176839c89f29a2fd7e0fca658
2019-10-30 00:07:25 +00:00
Mitch Phillips d5bd5773e3 Use unstripped binaries in fuzz target packaging.
Unstripped binaries allow for online symbolization, and offline
symbolization using the debug info in the binary. Debug information
isn't stripped for host binaries, but is for target. Target should also
contain debugging info.

Bug: N/A
Test: m fuzz && # Check that fuzz targets in the fuzz-*.zip package have
debug info.

Change-Id: Ibd3002674d519e927340a50dfdfbf44f2d809d58
2019-10-29 17:04:22 -07:00
Jooyung Han 87a7f3064f Fix apex_vndk with TARGET_VNDK_USE_CORE_VARIANT
When TARGET_VNDK_USE_CORE_VARIANT is set, vndk apex should have only
- vndk sp libraries
- vndk core libraries which are marked as "must use vendor variant"

Previously, vndk sp libs are discarded when TARGET_VNDK_USE_CORE_VARIANT
is set.

Bug: 143374795
Bug: 139772411
Test: TARGET_VNDK_USE_CORE_VARIANT=true m com.android.vndk.current
      see if vndk sp lib(e.g. libunwindstakc) is included.

Change-Id: Iae218fff5c354eb874839a1f71be30633fb8a9ab
2019-10-30 09:04:13 +09:00
Jooyung Han 8aee204cb2 Do not follow deps for apex_vndk
Since apex_vndk deals with its own dependencies, it should not follow
dependencies while packaging.

Bug: 139772411
Test: TARGET_VNDK_USE_CORE_VARIANT=true m com.android.vndk.current
      see if there are unexpected libs in the apex
      for example, android.hardware.audio.common@2.0.so should not be
      included in the apex since it is not listed as "must use vendor
      variant".

Change-Id: Ibada600b3099fb19630d1e327a2e09cd26b2deb0
2019-10-30 00:03:22 +00:00
Jooyung Han 6b8459be4f apex: __ANDROID_APEX__ defined with no value
__ANDROID_APEX__ was defined with the name of apex module.
-D__ANDROID_APEX__=com.android.foo

But in this way, conditional compilation is not easy since comparing
macro's string value is not supported in C/C++.
(There's no usages of this value in source tree.)

In most cases, modules can check if __ANDROID_APEX__ is defined to see
if they are compiled for apex.
For modules which should behave differently according to which apex they
are included, they can check __ANDROID_APEX_<NAME>__.

Bug: 142582178
Test: m (soong tests run) && boot device && TH
Change-Id: I0f5e3e9463ccd96cbba333a8bdd648470c5c912d
2019-10-29 23:47:59 +00:00
Dario Freni c7c9f04141 Merge "Add support for including app prebuilts in APEX."
am: 520367cbd3

Change-Id: I679f629f9145e22e7f79acbd85bbe296c2ff5f58
2019-10-29 16:14:41 -07:00
Treehugger Robot 520367cbd3 Merge "Add support for including app prebuilts in APEX." 2019-10-29 23:02:38 +00:00
Colin Cross 8cc19911b1 smart_status: move channel write outside lock to avoid deadlock
The smartStatusOutput.done channel is read from a goroutine that
locks smartStatusOutput.lock.  If the goroutine that writes to
smartStatusOutput.done is holding smartStatusOutput.lock it can
lead to an AB-BA deadlock.  Call stopActionTableTick from outside
the lock.

Fixes: 143558785
Test: none
Change-Id: I93a10ef9ff16c3953a1c5ccb102b024158358fe4
2019-10-29 15:27:32 -07:00
Ivan Lozano 5e94b2dd4b Merge changes Ia7deed13,I7378a46f
am: 765fe7a501

Change-Id: I1fef1dca7928949e3f4004a68a2f99687da01187
2019-10-29 15:27:27 -07:00
Colin Cross 2513a6efd6 Merge changes Icfd32d0a,Icc9ff4d4,Ieee07502,I559eeb1f,Iaf2a6f6d, ...
am: ec90e44ce7

Change-Id: Id04d926cfc57afc73433420815f4705b7b53bf96
2019-10-29 15:21:04 -07:00
Ivan Lozano 765fe7a501 Merge changes Ia7deed13,I7378a46f
* changes:
  Add support for Rust C libraries.
  Add a common interface for cc linkable libraries.
2019-10-29 21:47:14 +00:00
Colin Cross ec90e44ce7 Merge changes Icfd32d0a,Icc9ff4d4,Ieee07502,I559eeb1f,Iaf2a6f6d, ...
* changes:
  Use java language 1.9 for sdk_version: "current"
  Remove special case for sdk_version: "none"
  Use system modules for turbine
  Make javaVersion an enum
  Move TestConfig sdk versions forward
  Split java 8 and 9 classpaths in TestClasspath
2019-10-29 21:08:33 +00:00
Colin Cross 6cef481ee7 Use java language 1.9 for sdk_version: "current"
Java language was set for 1.8 for anything building against the
current SDK because the stubs were not built in Soong, so the
system modules could not be built.  The stubs have been built
in Soong since Iabd32b30954b3f4a6d9a779fde52a032b684807e, but
I5e870c34dd0ebc8ae3f888ec627da590c846a76f missed updating
this TODO.

Use 1.9 when building against the stubs, but continue using
1.8 for unbundled builds until we have prebuilt system modules.

Always use the core-current-stubs-system-modules to avoid
splitting android.* packages between the system modules and
the classpath, which would cause new classes in android.*
packages in classpath jars to be ignored.  Add a new
java9Classpath field to sdkDep that will contain the stubs jar
when targeting Java language level 1.9, and plumb it through
to javac and turbine.  Rename the modules field to bootclasspath.

Bug: 142896162
Test: m checkbuild
Change-Id: Icfd32d0a863b2303a997c7cf03cb3708aade4724
2019-10-29 13:35:39 -07:00
Colin Cross 6d8d8c6a91 Remove special case for sdk_version: "none"
The dependency handling for sdk_version: "none" (which propagated to
!sdkDep.hasStandardLibs()) was very similar to the normal useModule
case.  Combine the cases by making decodeSdkDep set useModule: true
and put the system modules in modules for the sdk_version: "none"
case.

Test: TestClasspath
Change-Id: Icc9ff4d43a38da25cc0e3628be95951d61773ad5
2019-10-29 13:35:39 -07:00
Colin Cross bf3119ee35 Use system modules for turbine
turbine supports taking system modules on the command line,
now that we target Java language level 1.9 and use system modules
by default switch turbine to match javac.

Test: m javac-check
Change-Id: Ieee07502151da0d5693bb8929213d495c039106b
2019-10-29 13:35:39 -07:00
Alexander Smundak 344d57e1da Merge "Add dont_merge_manifests attribute to android_test"
am: 657615e0d6

Change-Id: I95da8cbaed5040356bfa20ee0903152dac3ac8b6
2019-10-29 09:21:55 -07:00
Alexander Smundak 657615e0d6 Merge "Add dont_merge_manifests attribute to android_test" 2019-10-29 15:59:19 +00:00
Ivan Lozano 52767be335 Add support for Rust C libraries.
Adds the ability for rust modules to be compiled as C libraries, and
allows cc modules to depend on these rust-generated modules. This also
means that soong-rust should not have any dependencies on soong-cc aside
from what's required for testing.

There's a couple small fixes included as well:

 - A bug in libNameFromFilePath that caused issues when library's had
 "lib" in their name.
 - VariantName is removed from rust library MutatedProperties since this
 was unused.

Bug: 140726209
Test: Soong tests pass.
Test: Example cc_binary can include a rust shared library as a dep.
Test: m crosvm.experimental
Change-Id: Ia7deed1345d2423001089014cc65ce7934123da4
2019-10-28 22:09:01 -07:00
Jiyong Park 73c54ee7fe native shared libs in an SDK can be snapshotted
The snapshot script can now handle native shared libs in an SDK.

Bug: 138182343
Test: create following sdk module:
sdk {
    name: "mysdk",
    native_shared_libs: ["libc", "libdl"],
}
, then execute `m mysdk` and execute the update_prebuilt-1.sh as
prompted. Following directories are generated under the directory where
mysdk is defined at:

1
├── aidl
├── Android.bp
├── arm64
│   ├── include
│   ├── include_gen
│   └── lib
│       ├── libc.so
│       └── libdl.so
├── include
│   └── bionic
│       └── libc
│           └── include
│               ├── alloca.h
│               ├── android
│               │   ├── api-level.h
<omitted>

Change-Id: Ia1dcc5564c1cd17c6ccf441d06d5995af55db9ee
2019-10-29 12:27:35 +09:00
Dario Freni 280b61b850 Merge "Sort the file with image content."
am: 4f45daf9ed

Change-Id: Ibe8cd8e6d42dc9e14f454e79b57718d72716e677
2019-10-28 16:45:43 -07:00
Kris Alder 0bb1b218a9 add additional fields to cc_fuzz build types
am: f979ee3873

Change-Id: I7099fcf09dd9d936a05c1f2141640e57899bbe68
2019-10-28 16:45:08 -07:00
Treehugger Robot 4f45daf9ed Merge "Sort the file with image content." 2019-10-28 23:29:58 +00:00
Kris Alder f979ee3873 add additional fields to cc_fuzz build types
Specifically, this adds:
* Owner
* Disable (stop fuzzer from running in Haiku)
* Bug Component
* Bug Hotlist

The fields are all inside a new 'options' struct.

The values from these fields (if any) are written into a config file as
json.

Bug: 142551000
Test: ran locally with a modified build file and verified output in .zip
Change-Id: I86edf74c2cebe9912ac0ad203f99028be4062c8b
2019-10-28 16:15:50 -07:00
Sasha Smundak 541056c3fa Add dont_merge_manifests attribute to android_test
Bug: 122332514
Test: treehugger, convert cts/tests/tests/content
Change-Id: Ib66fcafd7c31913402cd390dfecce292b1817729
2019-10-28 15:55:58 -07:00