Commit graph

14283 commits

Author SHA1 Message Date
Tom Cherry
172a17ffb3 Merge "system-clang-format: Add Standard: Cpp11"
am: ae11318633

Change-Id: Ia70dffd41aa752b8b3e65fabdb20fea4265abca2
2019-07-10 18:29:46 -07:00
Jiyong Park
6374a89990 Merge "Use ctx.Target().NativeBridge to detect if the arch is translated or not"
am: f378a85523

Change-Id: I1d2fb8391f9339e0f27dce606b67ca0c192c8e5e
2019-07-10 18:24:05 -07:00
Treehugger Robot
ae11318633 Merge "system-clang-format: Add Standard: Cpp11" 2019-07-11 01:10:04 +00:00
Treehugger Robot
f378a85523 Merge "Use ctx.Target().NativeBridge to detect if the arch is translated or not" 2019-07-11 00:49:42 +00:00
Tom Cherry
0dd3ab5387 system-clang-format: Add Standard: Cpp11
clang-format tries to automatically detect the Cpp standard used,
particularly when determining to put spaces in template definitions:

Cpp03: std::vector<std::pair<bool, bool> >
vs
Cpp11: std::vector<std::pair<bool, bool>>

It doesn't always get this correct as seen in
https://android-review.googlesource.com/c/platform/system/core/+/973463/8
but since we know that all code within Android is C++17, we can safely
assume it should be formatted with the newer standard.

Test: clang-format doesn't break the above change.
Change-Id: I7d1d709690b7bca6da3863cc9a58e53eaec751b0
2019-07-10 15:04:04 -07:00
Sasha Smundak
e26ae3f2bf Merge "Tune invocations and print full diagnostics on crash for d8 and r8."
am: a89cf59a4f

Change-Id: I9afd4b5af3119e57bbd21ed1e42c340ca35d1962
2019-07-10 13:45:01 -07:00
Treehugger Robot
a89cf59a4f Merge "Tune invocations and print full diagnostics on crash for d8 and r8." 2019-07-10 19:59:11 +00:00
Jaewoong Jung
c40949db97 Merge "Improve android_app_import.dpi_variants handling."
am: 3af8661af7

Change-Id: Iafb8f55dac9caaa3acb3d6fc46f0ad8452147660
2019-07-10 09:57:24 -07:00
Jaewoong Jung
3af8661af7 Merge "Improve android_app_import.dpi_variants handling." 2019-07-10 16:39:53 +00:00
Jiyong Park
acbf6c76c6 Use ctx.Target().NativeBridge to detect if the arch is translated or not
Bug: 137015854
Test: m
Test: build cf_x86_phone and ensure there is no dangling symlink
/system/lib/arm/libm.so

Change-Id: I0f5efdb9e1f5e4e213ca4ebaa28ace0a130b36a6
2019-07-10 18:07:38 +09:00
Jooyung Han
6a6f19e724 Merge "Add "provide_cpp_shared_libs/uses" props to "apex""
am: db7a770509

Change-Id: I262c97a83611beceb1094534e0b5c808cc34ae0b
2019-07-09 18:33:55 -07:00
Treehugger Robot
db7a770509 Merge "Add "provide_cpp_shared_libs/uses" props to "apex"" 2019-07-10 01:12:31 +00:00
Jaewoong Jung
3e18b19442 Improve android_app_import.dpi_variants handling.
Instead of circumventing the limitation of Prebuilt implementation by
picking a source path itself, it now uses the same mechanism as
archMutator and replaces the source path in advance so that Prebuilt
always sees the corrent source path.

Because this requires the Apk field to be a string pointer, the single
source prebuilt implementation is being updated to be reflection-based.

Test: Soong unit tests, m soong_docs, TreeHugger
Change-Id: I2304f15e32d632f74f95f0d9e9bf1f75ff3e2225
2019-07-09 15:00:15 -07:00
Jaewoong Jung
54a8a8ce0c Merge "Add sh_test_host."
am: 94e90c696e

Change-Id: Ib49dfd6120a2c4ef0ee11c0c5cd773f9702dad76
2019-07-09 11:39:31 -07:00
Sasha Smundak
ee5c60384f Tune invocations and print full diagnostics on crash for d8 and r8.
Bug: 132766811
Test: treehugger
Change-Id: Id6943008e65b9dc3479e8758445e8d679529a8cb
2019-07-09 11:26:20 -07:00
Jaewoong Jung
94e90c696e Merge "Add sh_test_host." 2019-07-09 18:04:49 +00:00
Pirama Arumuga Nainar
ce09846256 Merge changes from topic "gcov-prefix-permissions-fix"
am: bc53fefd6a

Change-Id: I9c4a91abd6e114abedbfb6e0916678cab2da2d6c
2019-07-09 08:57:21 -07:00
Pirama Arumuga Nainar
e3493d33a7 Refactor libprofile-extras to be added as a whole static library
am: 82fe59b656

Change-Id: Idfa4b3fdbf4f7ffa461652464c557aa5dc44e523
2019-07-09 08:57:15 -07:00
Pirama Arumuga Nainar
bc53fefd6a Merge changes from topic "gcov-prefix-permissions-fix"
* changes:
  Wrap getenv when linking a coverage-enabled binary
  Refactor libprofile-extras to be added as a whole static library
2019-07-09 15:32:48 +00:00
Jooyung Han
5c998b9ff8 Add "provide_cpp_shared_libs/uses" props to "apex"
For APEXes to share C++ native libraries, we need a new kind of depedency
between APEXes: "providing" APEXes and "using" APEXes. To reflect this
dependency two new properties are added.

provide_cpp_shared_libs: bool
  this indicates that the current APEX module provides the native C++ shared
  libs to other APEXes.

uses: []string
  this indicates that the current APEX module uses the native C++ shared
  libraries from APEXes listed.

With these two, "using" APEXes can omit shared libraries in its APEX
bundle and use them from the "providing" APEXes.

Note that without corresponding changes in ld.config.txt, this won't
work.(The linker namespaces should be configured so that user APEX can
access provided libs.)

Bug: 136975105
Test: m nothing (this will trigger soong's test)
Change-Id: Iec6f9f67bcbde01145acc383f862ba21c8197536
2019-07-09 21:30:45 +09:00
Justin Yun
9321804a11 Rename product_services to system_ext
am: d5f6c8261a

Change-Id: Ifd77d7d729addae59b2b26a8cbdd2ebefffcabae
2019-07-09 02:14:59 -07:00
Justin Yun
d5f6c8261a Rename product_services to system_ext
Bug: 134359158
Test: build and check if system_ext.img is created
Change-Id: Ice3229baf97a94c24a6eea22e7d4571941d7f843
2019-07-09 08:57:05 +00:00
Colin Cross
781511c606 Move RuleBuilder on top of strings.Builder
am: cfec40c41b

Change-Id: Ib72df28ae54e5889b0b01c66f8b5bd9914df20cf
2019-07-08 22:05:07 -07:00
Colin Cross
cfec40c41b Move RuleBuilder on top of strings.Builder
strings.Builder avoids copying the final byte array to a string by
using unsafe to point the string to the backing array of the byte
slice.

Test: rule_builder_test.go
Change-Id: I3d9a70fb62f8542650cd9ebc65397297bba12585
2019-07-09 04:46:12 +00:00
Martin Stjernholm
3b2542d1db Merge "Document how properties work in defaults modules."
am: 188236ff23

Change-Id: Ie2f093dc2c16c024b81448e53e5d103b1932f02e
2019-07-08 20:02:51 -07:00
Treehugger Robot
188236ff23 Merge "Document how properties work in defaults modules." 2019-07-09 02:25:36 +00:00
Inseob Kim
f23a2bfa6f Merge "[trivial] Remove dead code"
am: fccc52f46b

Change-Id: Ieac00d1f29b5077836e68748f2e2e41df17315ec
2019-07-08 17:27:49 -07:00
Jaewoong Jung
f0cb835ebf Merge "Dist NOTICE outputs for app targets."
am: b1907ee587

Change-Id: I3f33053028a9564d42b9ce2b18fdfa5ff8a760c8
2019-07-08 17:12:15 -07:00
Treehugger Robot
fccc52f46b Merge "[trivial] Remove dead code" 2019-07-08 23:45:23 +00:00
Jaewoong Jung
b1907ee587 Merge "Dist NOTICE outputs for app targets." 2019-07-08 23:28:13 +00:00
Jaewoong Jung
61a83681c4 Add sh_test_host.
Fixes: 136272143
Test: sh_binary_test.go
Change-Id: I2e6580286fcdf43ab20020fcd147648a3009aa9f
2019-07-08 14:53:52 -07:00
Jaewoong Jung
9877279855 Dist NOTICE outputs for app targets.
Bug: 136501164
Test: m NetworkStack, TreeHugger
Change-Id: I2279eeb0e50b1b5685e23130a8da6ab090f37f56
2019-07-08 09:26:02 -07:00
Roland Levillain
1b0106341c Add support for tests in APEX test modules.
am: 630846d244

Change-Id: I2b5e52b5a5330409cd2c88160d86e8494a79d31d
2019-07-08 04:18:43 -07:00
Roland Levillain
630846d244 Add support for tests in APEX test modules.
Allow `tests` property in `apex_test` Soong modules.

Test: m (`apex/apex_test.go` amended)
Bug: 129534335
Change-Id: Ieeff7cf0980a7c394409632b6448102f59bceb3d
2019-07-05 19:01:18 +01:00
Colin Cross
cd48600321 Merge changes Icfc893c8,I40f03fc0
am: f67e1bee4a

Change-Id: I0b9cf1e3df4ef7ef46e73a5dc6d363fe918c29b7
2019-07-03 22:55:03 -07:00
Inseob Kim
0ce291ebee [trivial] Remove dead code
Bug: N/A
Test: m
Change-Id: Ia278008249f5fc1cf5fd7d29e55e2e54f1d6f3ca
2019-07-04 14:39:22 +09:00
Treehugger Robot
f67e1bee4a Merge changes Icfc893c8,I40f03fc0
* changes:
  Allow debugging with SOONG_DELVE=<listen addr>
  Print ninja stdout live during the build
2019-07-04 03:34:22 +00:00
Colin Cross
1af102a9f8 Merge "Add a String() method to android.Module"
am: eee5a41aa4

Change-Id: I15cc3b5dace326948c6a17d51d2d9a69a7302b9b
2019-07-03 20:07:49 -07:00
Treehugger Robot
eee5a41aa4 Merge "Add a String() method to android.Module" 2019-07-04 02:15:35 +00:00
Colin Cross
6e9bf6f1d7 Merge changes from topic "mutator_name"
am: 28d36cacc1

Change-Id: I5d4290229fd785f02d4a14c4c91329267f7a7283
2019-07-03 19:11:35 -07:00
Patrice Arruda
63469b3114 soong_ui: Build under a path that contains a symbolic link.
am: baba9a9be6

Change-Id: Id003f390a022cb229fb9f56fb30e83d8310d7ba6
2019-07-03 19:08:13 -07:00
Treehugger Robot
28d36cacc1 Merge changes from topic "mutator_name"
* changes:
  Add MutatorName to mutator contexts
  Remove ioutil.TempDir from each android/soong/android test
2019-07-04 01:44:23 +00:00
Colin Cross
aa812d122c Allow debugging with SOONG_DELVE=<listen addr>
Allow running Soong in a headless delve debugger by passing
SOONG_DELVE=<listen addr> in the environment.

Bug: 80165685
Test: SOONG_DELVE=:1234 m nothing
Change-Id: Icfc893c8a8354a9bbc99112d9c83259cb41906d1
2019-07-03 16:33:31 -07:00
Colin Cross
7b97ecd1f5 Print ninja stdout live during the build
When running ninja stream stdout to the status writer.  This improves
the ninja -d explain behavior, and will also allow Soong to be put
into the ninja console pool letting it print timely output to the
console.

Bug:  80165685
Test: NINJA_ARGS="-d explain" m
Change-Id: I40f03fc01d837ad91d400eae378007a7ce807705
2019-07-03 16:33:10 -07:00
Colin Cross
9a36223d59 Add a String() method to android.Module
Add a String() method to android.Module for use in debugging.  Store
the name and variations of the module as they are mutated.

Test: TestModuleString
Bug: 136473661
Change-Id: I74e393703dcfc96ed4e21ac4a4419a7858b59216
2019-07-03 15:37:11 -07:00
Pirama Arumuga Nainar
100bbdc8f3 Wrap getenv when linking a coverage-enabled binary
The wrapper to getenv() appends the effective userid (euid) of the
current process to GCOV_PREFIX.  This avoids conflicts and permissions
issues when multiple processes try to create/access the same directories
and files under /data/misc/trace.

Test: Verify that coverage files are written to
/data/misc/trace/<euid>/proc/... instead of /data/misc/trace/proc/...

Change-Id: If58081a12b2b9bc40cfcbf64c99beafe198d07af
2019-07-03 15:28:54 -07:00
Pirama Arumuga Nainar
82fe59b656 Refactor libprofile-extras to be added as a whole static library
Bug: http://b/134177005
Bug: http://b/116873221

Previously, the libprofile-extras dependency was added as a
LateStaticLib and the constructor in this library was included during
linking with the '-uinit_profile_extras' linker flag.  This was done
because at the deps() stage, the exact binaries that need coverage are
not known (in fact the coverage-enabled variants are not created yet).

This meant that for a link command, if one of the shared libraries
already exported the constructor, the output of the link command did not
load/link libprofile-extras.

For other reasons, we now want to add more symbols to this library that
need to be linked into all libraries and executables.  To accomplish
that, refactor the dependency handling so libprofile-extras can be added
as a 'WholeStaticLib'.

This is done by creating a new dependency type (with a coverageDepTag
dependency tag) to add libprofile-extras as a dependency for all modules
that can potentially link with coverage.  During the flags() call, this
dependency is moved as a WholeStaticLib dependency iff coverage is
enabled in this link step.

There are a few NFC changes as well:
- deps() takes a DepsContext parameter.
- flags() has an extra PathDeps parameter and return value.
- add useSdk() helper to cc.Module.

Test: Build with coverage and check that we can generate coverage using
SIGUSR1 and the debug.coverage.flush sysprop.

Change-Id: I7e7d8201956a150febbda5bb1794f8ece016db8b
2019-07-03 15:28:50 -07:00
Colin Cross
cb55e089f0 Add MutatorName to mutator contexts
Follow https://github.com/google/blueprint/pull/255.

Bug: 136473661
Test: m checkbuild
Change-Id: Ia74d442c925689fa1e06a70c2acfed925063f844
2019-07-03 14:16:42 -07:00
Colin Cross
fa07821d88 Remove ioutil.TempDir from each android/soong/android test
android_test.go already sets up a global buildDir, no need to create
one in each test.

Test: All soong tests
Change-Id: Ib85cbf78c604ad3cef64aa00b6bd812a81496e9e
2019-07-03 20:27:11 +00:00
Patrice Arruda
baba9a9be6 soong_ui: Build under a path that contains a symbolic link.
The build directory passed in to soong_ui can contain a
symbolic link. soong_ui was not evaluating the build
directory to retrieve the true path, hence failing to
execute the internal soong.

Fixes: b/135995632
Test: Unit test case and executed the scenario in the bug
      description.

Change-Id: I5779c6aa3f3183810437dbe2b2d4e40acbafb205
2019-07-03 13:03:23 -07:00