Commit graph

11826 commits

Author SHA1 Message Date
Pirama Arumuga Nainar
50b382a9e3 Merge "Remove redundant -fexperimental-new-pass-manager" 2019-06-14 21:02:45 +00:00
Colin Cross
9a642dcde2 Support sharding robolectric tests
Explicitly pass the list of tests as LOCAL_ROBOTEST_FILES, and
support sharding the list of tests into multiple test runners.

Also filter out BaseRobolectricTest.java, which covers the only
use of LOCAL_ROBOTEST_FILES in Android.mk files.

Bug: 133878985
Test: m RunSettingsLibRoboTests runs the same number of tests before and after
Test: m RunSettingsLibRoboTests runs the same number of tests when sharded
Change-Id: Id85ffe03c98e722303eaa6def17812ed2244c6a6
Merged-In: Id85ffe03c98e722303eaa6def17812ed2244c6a6
2019-06-14 13:10:53 -07:00
Colin Cross
cd84b4e36b Give Blueprint modules access to all namespaces
Don't enforce namespaces on Blueprint modules like
bootstrap_go_package, their dependencies are handled before
namespaces are initialized in namespaceMutator.

Fixes: 135246048
Test: TestDependingOnBlueprintModuleInRootNamespace
Change-Id: I7cf1c26bb8512eed59d6b4eb42a49f7080ffa281
2019-06-14 11:26:09 -07:00
Dan Shi
37ee3b8f49 Support require_root in auto-gen test configs
require_root is added to allow auto-generated test config to include
RootTargetPreparer so the test runs with root permission.

Bug: 134509111
Test: add "require_root: true" to init_benchmarks and libpower_test
  build the modules, confirm the extra target preparer is added in the
  test configs.

Change-Id: Ia07503e338935d6aa92560e7cf7b18d2a4c51243
2019-06-14 11:10:13 -07:00
Pirama Arumuga Nainar
3a25405acc Remove redundant -fexperimental-new-pass-manager
This is now turned on by default (cc/config/clang.go).

Test: N/A
Change-Id: I61bcf2049448b4200ca303ebcad555cc24a43c18
2019-06-14 09:54:23 -07:00
Paul Duffin
b11c72b0b8 Merge "Add sdk_version:"none" to replace no_standard_libs:true" 2019-06-14 06:29:48 +00:00
Paul Duffin
60b393ce85 Merge "Make sdkDep/decodeSdkDep the source of truth about the sdk" 2019-06-14 06:26:02 +00:00
Treehugger Robot
49cd4954a0 Merge "soong_ui: Add build actions commands in soong_ui." 2019-06-13 23:14:56 +00:00
Patrice Arruda
1384822a63 soong_ui: Add build actions commands in soong_ui.
Add the following build actions {BUILD_MODULES_IN_A_DIRECTORY,
BUILD_MODULES_IN_DIRECTORIES} in soong_ui config so the bash code version of
build commands (m, mm, mma, mmm, mmma) in build/make/envsetup.sh can be deprecated.
This is to allow up to date bug fixes on the build commands.

Bug: b/130049705
Test: Unit test cases
Change-Id: I772db1d4e9c1da5273374d1994eb5e8f17cd52f2
2019-06-13 13:15:12 -07:00
Colin Cross
3dac80e519 Support an action table that shows longest running actions
If SOONG_UI_TABLE_HEIGHT is set, enable a new smart terminal display
that prints the normal scrolling build history in the top region of
the screen and an action table of the longest currently running
actions in the bottom region of the screen.  This provides better
visibility into which are the longest running actions and when the
build parallelism is very low.

Test: manual
Change-Id: I677d7b6b008699febd259110d7f9e0f98d80c535
2019-06-13 11:26:06 -07:00
Colin Cross
4355ee64a9 Use SIGWINCH to update terminal size
Instead of reading the terminal size on every status update, register
for SIGWINCH to read and store the size when it changes.

This reapplies I555ad21a31a2c924ab0ca681e0c8f00df42a370a with a fix
for a race condition in TestSmartStatusOutputWidthChange.

Test: status_test.go
Change-Id: If342cb4cc8e4ed57af9e3bb417758348c9c41247
2019-06-13 11:26:06 -07:00
Paul Duffin
52d398a841 Add sdk_version:"none" to replace no_standard_libs:true
Where possible this duplicates any tests that use no_standard_libs:true
with ones that use sdk_version:"none". If not possible (e.g. in the
default targets included in java/testing.go) it switches some to use
sdk_version:"none" to ensure that there is no regression in the
behavior of no_standard_libs:true.

Follow up changes will switch all usages of no_standard_libs:true over
to use sdk_version:"none" at which point no_standard_libs will be
removed.

Bug: 134566750
Test: m droid
Change-Id: I5f0fd3daa980f6b223abe454cba7f25a97a39d7a
2019-06-13 19:15:10 +01:00
Colin Cross
e77a57336f Merge "Revert "Use SIGWINCH to update terminal size"" 2019-06-13 18:11:40 +00:00
Colin Cross
4bc5e802db Revert "Use SIGWINCH to update terminal size"
This reverts commit 49036be407.

Reason for revert: TestSmartStatusOutputWidthChange is flaky

Change-Id: Ie5231dbbab2887ce4c4697f3fe6e52cfd6f4dd17
2019-06-13 18:10:45 +00:00
Treehugger Robot
606f946339 Merge "Fix typos in a comment." 2019-06-13 17:48:10 +00:00
Colin Cross
6ebe07def7 Merge changes I555ad21a,I9d46761e,I917bdeee,I5bc5476a,I59bbdae4, ...
* changes:
  Use SIGWINCH to update terminal size
  Make status line bold
  Move all output through StatusOutput
  Remove terminal.Writer
  Move smart and dumb terminals into separate implementations
  Add tests for status output
2019-06-13 17:46:20 +00:00
Treehugger Robot
42d33779cd Merge changes If25be604,I0a310229,I44155630
* changes:
  Add another jar used by kotlinc
  Actually depend on the headers from renderscript
  Fix a few missing dependencies in APEX building
2019-06-13 17:40:01 +00:00
Paul Duffin
250e6198d4 Make sdkDep/decodeSdkDep the source of truth about the sdk
Previously, different parts of the build used different sources of
information about the SDK (i.e. the default libraries) against which
a Java module aimed at the device was built. Some used the sdk_version
property, others used the no_standard_libs or no_framework_libs, some
used a combination of all three.

That lead to inconsistent handling in the code, e.g. some parts treated
no_standard_libs: true as implying no_framework_libs: true and others
did not, and also in the build files, e.g. some modules specified
no_framework_libs: true and sdk_version: "system_current" which makes
no sense, or no_standard_libs: true and sdk_version: "core_current"
which are inconsistent.

This is the first step in a refactoring to simplify the sdk selection
process by replacing the no_standard_libs/no_framework_libs properties
with some extra options for the sdk_version property. This change
consists of:
1) Extra functions sdkContext to access the no_standard_libs and
   no_framework_libs properties.
2) Extra field/functions in sdkDep to store and access the value of
   no_standard_libs/no_framework_libs.
3) Changes to decodeSdkDep(...) to pass the values of the no_...
   properties through to the returned sdkDep.
4) Change all code that accesses the no_... properties directly to
   call decodeSdkDep(...) to get an sdkDep object and then accessing
   the values of the no_... properties from there.

The accessor functions on sdkDep are called has...() rather than
no...() as most callers of the methods invert the value anyway and
!no...() is harder to reason about than has...().

The hasFrameworkLibs() function returns true if and only if
no_standard_libs and no_framework_libs are false. That is consistent
with all but one usage of the no_framework_libs property and that is
not affected by it.

Bug: 134566750
Test: m droid
Change-Id: I196e3304e8bd802fb154e897397b0dd337f868e2
Exempt-From-Owner-Approval: Colin has already given +2 modulo some
    minor nits and this blocking other changes.
2019-06-13 15:16:32 +01:00
Paul Duffin
1b033f5c4c Add hiddenapi_flags module type
The build generates a file out/soong/hiddenapi/hiddenapi-flags.csv
which is used by the hiddenapi-blacklist tests in cts/tests/signature.
The generation is done at the ninja level and so is not accessible from
the soong layer that runs on top. This change adds the hiddenapi-flags
module type which makes the file accessible from other soong modules.

Bug: 122332514
Test: atest -p cts/tests/signature
Change-Id: If38c8a8ffca110f2ae01f97f19a2740ca3fde1b7
Exempt-From-Owner-Approval: Colin has already reviewed and only had minor
    nits and this is blocking other changes.
2019-06-13 10:25:47 +01:00
Paul Duffin
393590d8a8 Merge "Never allow java_library_host with no_standard_libs: true" 2019-06-13 06:57:19 +00:00
Paul Duffin
45656aacab Merge "Allow java_test.go tests to use any Android.bp file" 2019-06-13 06:56:56 +00:00
Paul Duffin
5b775ae8b4 Merge "Add test for no_framework_libs:true" 2019-06-13 06:56:25 +00:00
Yi Kong
4821597065 Merge "Move darwin to llvm-ar" 2019-06-13 06:04:29 +00:00
Dan Willemsen
1cfbdbe1b2 Add another jar used by kotlinc
Bug: 130111713
Test: treehugger
Change-Id: If25be6047625cec4ed9802142876cfd8e9ccd3eb
2019-06-13 05:22:03 +00:00
Dan Willemsen
b085b9b907 Actually depend on the headers from renderscript
Instead of having all the object compilations depend on a stamp file,
instead depend on the headers, which are already available in the build
graph.

This allows my RBE builds to just find the headers, instead of having to
walk the graph to find the other outputs.

Test: treehugger
Test: build a system image with RBE
Change-Id: I0a310229be26d7bd399e074a4350d5be038f8661
2019-06-13 05:21:37 +00:00
Dan Willemsen
dd651faac3 Fix a few missing dependencies in APEX building
I found these while trying to build an aosp_arm system image with RBE,
which only makes the sources that you depend on available to every rule.

The hardcoded prebuilts/sdk path is a bit unfortunate, but that's
currently hardcoded as a default in the script as well.

Bug: 130111713
Test: treehugger
Test: build a system image with RBE
Change-Id: I4415563017e053749788b0a537a48d61a2161935
2019-06-13 05:21:09 +00:00
Colin Cross
49036be407 Use SIGWINCH to update terminal size
Instead of reading the terminal size on every status update, register
for SIGWINCH to read and store the size when it changes.

Test: status_test.go
Change-Id: I555ad21a31a2c924ab0ca681e0c8f00df42a370a
2019-06-12 21:30:56 -07:00
Colin Cross
00bdfd8476 Make status line bold
Bolding the status line provides differentiation between output
of each command.

Test: status_test.go
Change-Id: I9d46761e69c5af0a0aa86c7921e121cfd2a3fc82
2019-06-12 21:30:56 -07:00
Colin Cross
e0df1a36b2 Move all output through StatusOutput
Write log output through StatusOutput so that the status implementation
can synchronize it with its own output.

Test: status_test.go
Change-Id: I917bdeeea4759a12b6b4aa6d6d86ee18a2771723
2019-06-12 21:30:56 -07:00
Colin Cross
097ed2a37c Remove terminal.Writer
terminal.Writer is now just a wrapper around stdio.Stdout() without
any useful functionality.  Replace it with stdio.Stdout() as an
io.Writer.

Test: ui/terminal/status_test.go
Change-Id: I5bc5476afdca950b505642f0135a3af9d37fbe24
2019-06-12 21:30:56 -07:00
Colin Cross
ce525350f4 Move smart and dumb terminals into separate implementations
Support for smart and dumb terminals are implemented in writer.go,
which makes dumb terminals much more complicated than necessary.
Move smart and dumb terminals into two separate implementations
of StatusOutput, with common code moved into a shared formatter
class.

Test: not yet
Change-Id: I59bbdae479f138b46cd0f03092720a3303e8f0fe
2019-06-12 21:30:56 -07:00
Colin Cross
dde49cb687 Add tests for status output
Test: status_test.go
Change-Id: If3febd8fdacb0e70716d0520a41c982bd6474720
2019-06-12 21:30:56 -07:00
Colin Cross
e51e2feafd Merge changes I89ad92f3,Ife1604c0
* changes:
  Don't add dependencies on uses-library modules in unbundled builds
  Add implicit outputs to ErrorRule rules
2019-06-13 03:36:08 +00:00
Yi Kong
823532df31 Move darwin to llvm-ar
Test: build
Bug: 71618641
Change-Id: Ib45963bc9e295afe39752a270f7b5a1197335c69
2019-06-12 19:16:25 -07:00
Jaewoong Jung
02b2d4d6be Fix typos in a comment.
Test: TreeHugger
Change-Id: Ida7281e283c2cf6c20dce7afce97542b704f6149
2019-06-12 15:51:26 -07:00
Colin Cross
3245b2cb83 Don't add dependencies on uses-library modules in unbundled builds
Unbundled builds may not have definitions of shared libraries, and
they are not dexpreopted so the dependencies are not used anyways.

Test: manual
Change-Id: I89ad92f3b073422734f824ac3a8a3b9baf995ccb
2019-06-12 20:20:21 +00:00
Colin Cross
4b69c497da Add implicit outputs to ErrorRule rules
When building with ALLOW_MISSING_DEPENDENCIES=true, Soong replaces
rules in modules that have missing dependencies with ErrorRule
rules that print an error.  The ErrorRules were not listing
implicit outputs, which could lead to dangling dependencies.

Test: manual
Change-Id: Ife1604c0a9a1159087b12568fd4c2b69517d81a7
2019-06-12 20:20:13 +00:00
Colin Cross
72ea641dff Merge changes Ia17b2bcb,Ic71892c3,Id2b23b9e,I435ee7aa,I85112506, ...
* changes:
  Consolidate *MutatorContext and ModuleContext into BaseModuleContext
  Add test for missing defaults modules with AllowMissingDependencies
  Capture missing dependency error rules
  Share buildDir for android/soong/android tests
  Reimplement AddMissingDependencies
  Add GenerateAndroidBuildActions to DefaultsModuleBase
2019-06-12 20:19:55 +00:00
Dan Willemsen
733728b42c Merge "Convert cc aidl to rule builder" 2019-06-12 20:08:46 +00:00
Treehugger Robot
7b8afc798a Merge "Let genrule be mutatable by the apex mutator" 2019-06-12 18:39:28 +00:00
Alexander Smundak
90aa101152 Merge "Tune JVM, print full diagnostics on crash." 2019-06-12 15:33:06 +00:00
Paul Duffin
b815ada8c0 Never allow java_library_host with no_standard_libs: true
This combination makes no sense.

Bug: 134566750
Test: m droid
Change-Id: Ib37bbac165395c003d23225e0469ba60fa6a56ea
2019-06-12 14:08:13 +01:00
Paul Duffin
baccf7e122 Allow java_test.go tests to use any Android.bp file
Previously, the tests had to use the Android.bp file in the root
directory of the mock file system. That prevented adding tests that are
dependent on the location of the Android.bp file, e.g. ones that use
no_standard_libs. This change will process any Android.bp in the mock
filesystem.

Bug: 134566750
Test: m
Change-Id: I6fb057a473a18e87bd1a89507e78ceb3fd171eb5
2019-06-12 14:08:13 +01:00
Paul Duffin
fad7980075 Add test for no_framework_libs:true
Bug: 134566750
Test: m droid
Change-Id: Ie3c5c0730d4505c7932952eb20b5ccafd806a73a
2019-06-12 14:08:13 +01:00
Paul Duffin
b826a2f269 Remove unnecessary use of sdk_version: "core_current"
Modules that specify no_standard_libs: true should not specify the
sdk_version property as well because the former supercedes the latter.

Bug: 134566750
Test: m
Change-Id: I1d8663dc3a25baf23a1b136c7f35cf130cd7543b
2019-06-12 10:50:24 +01:00
Paul Duffin
b6c6bdd1c2 Add tests for core library neverallow rules
Bug: 134566750
Test: m
Change-Id: I65e2afdf726937c29fc4f62a317024dc133254bf
2019-06-12 10:50:24 +01:00
Jiyong Park
fc752ca1ac Let genrule be mutatable by the apex mutator
genrule modules were not mutated by the apex mutator. As a result, a
module that is mutated for an apex have depended on the genrule modules
host_bionic_linker_{asm|flags} that are not mutated for the APEX.

This in turn caused an inconsistency problem because the
host_bionic_linker_* genrules use the dynamic linker that isn't mutated
for APEX as an input, while the outputs of the genrules are used by
modules mutated for APEX. The inconsistency caused b/135008828.

Fixing this issue by correctly let genrule to be mutated by the apex
mutator.

Bug: 135008828
Test: checkout master-art-host
ALLOW_MISSING_DEPENDENCIES=true DIST_DIR=out/dist
./art/tools/dist_linux_bionic.sh -j50 showcommands
com.android.runtime.host
is passing

Change-Id: I92d90400c61d3951f6202d932832d0cb63c95a7d
2019-06-12 13:28:11 +09:00
Treehugger Robot
7268fd494d Merge "Package coverage files as a zip." 2019-06-12 02:00:01 +00:00
Oliver Nguyen
c743414d42 Package coverage files as a zip.
Test: make NATIVE_COVERAGE=true COVERAGE_PATHS="*"
Change-Id: I955212a20ea19c854ebc88635252a1d174ea8f7f
2019-06-11 16:04:11 -07:00
Elliott Hughes
633352f03f Merge "Switch to toybox date." 2019-06-11 20:49:52 +00:00