Commit graph

17066 commits

Author SHA1 Message Date
Colin Cross
68534a29d6 Don't print critical path parallelism ratio if elapsed time is 0.
Test: m nothing, examine out/soong.log
Change-Id: Ib23902c703d306337b2a5150d6d63b1e3d0f95b3
2020-01-04 07:26:28 +00:00
Treehugger Robot
6e3b471d3d Merge "Remove files that should no longer be installed" 2020-01-04 05:16:24 +00:00
Dan Willemsen
1e775d7619 Remove files that should no longer be installed
Make now exports (partial) lists of what should be installed. Those
lists are incomplete, but if something is removed from the list, we can
remove it from the filesystem so that incremental builds work better.

Test: built-in tests (m blueprint_tools)
Test: remove a module from PRODUCT_PACKAGES, see the print and file removed
Test: change the name of a cts test, see the old one removed from cts
Change-Id: I6bc14c6a5af63383ea265e97ed8b875fa51af0ed
2020-01-03 16:46:15 -08:00
Dan Willemsen
e333635983 Add option to limit environment variables given to ninja
Ninja does not track changes in environment variables, so we get
potentially incorrect builds when environment variables change during
incremental builds if some action was using one of them.

Add a variable to limit exposure of these variables to ninja, and thus,
all actions run by ninja. Kati and Soong can still read environment
variables, they explicitly track which ones they read so that we can
re-run them appropriately.

This list is just the beginning, there's no good way to detect which
environment variables are currently being used and to pass them through.
So this initial change won't have a behavioral change, and we'll flip
the switch and see what fails or who complains, flipping it off and on
and adding to the list until we can make this always happen.

Also adds a board-specific `BUILD_BROKEN_NINJA_USES_ENV_VARS := ...`
list so that we can temporarily allow board-specific variables until
they're fixed.

Test: check out/soong.log
Test: ALLOW_NINJA_ENV=false m nothing; check out/soong.log
Test: set BUILD_BROKEN_NINJA_USES_ENV_VARS := OLDPWD
      ALLOW_NINJA_ENV=false m nothing; check out/soong.log
Change-Id: I08e4834ce12100a577ef7d6a9a21b9e9d345cb93
2020-01-03 15:36:29 -08:00
Treehugger Robot
c481607536 Merge "Delete arch hooks" 2020-01-03 18:45:12 +00:00
Dario Freni
f4b13d4103 Merge "Add --include_build_info flag to apexer invocation." 2020-01-03 17:50:47 +00:00
Colin Cross
87f790c509 Delete arch hooks
They are not used anywhere.

Test: m checkbuild
Change-Id: Ice7d68b97ca894c0c4c9efc6dc55c0870a132b9c
2020-01-03 17:21:04 +00:00
Paul Duffin
36809d52ba Merge "java_sdk_library: Remove requirement for api_packages to be specified" 2020-01-03 13:32:54 +00:00
Paul Duffin
14544da609 Merge "java_sdk_library: support system_modules properly" 2020-01-03 13:32:42 +00:00
Nikita Ioffe
414f3a4c86 Merge "Whitelist system/apex/shim/build to use test_only_no_hashtree property" 2020-01-03 11:31:22 +00:00
Treehugger Robot
3afbc923dc Merge "java_sdk_library: Avoid generating system and test .txt files" 2020-01-03 00:49:39 +00:00
Nikita Ioffe
b4b44c0be2 Whitelist system/apex/shim/build to use test_only_no_hashtree property
It will be used to build a shim apex with zeroed hashtree for use in CTS
tests.

Test: builds
Bug: 145670581
Change-Id: I6f84850fefb3b58a1c2e8328242920d64a61e733
2020-01-02 23:01:39 +00:00
Dario Freni
0f4ae078be Add --include_build_info flag to apexer invocation.
Bug: 144477678
Test: verified that apex_build_info.pb is populated and included in the
final apex.
Change-Id: Iecbc2a68a82595eee32aaa26d11a7253daf89f69
2020-01-02 19:45:31 +00:00
Sasha Smundak
17c42bd105 Use absolute path for output.
Test: manual
Bug: 137798757
Change-Id: If2e9c31e1ff523914f5f2cecf8975e1da91c03a7
2020-01-02 11:20:40 -08:00
Paul Duffin
7a586d3a59 java_sdk_library: Remove requirement for api_packages to be specified
If api_packages is not set then will try and generate stubs from all
the source packages.

Bug: 145998881
Test: m checkbuild
Change-Id: Ic9d7f82bb34c4b960a2f17614d7f64ddd13ad8b0
2020-01-02 15:38:39 +00:00
Paul Duffin
12ceb4699b java_sdk_library: support system_modules properly
Bug: 145998881
Test: m checkbuild
Change-Id: Ia7663dca4b0ce84fe6dafca27e1aeb1bcda86221
2020-01-02 15:38:20 +00:00
Paul Duffin
37e0b77e3b java_sdk_library: Avoid generating system and test .txt files
If the library does not provide system and test APIs then do not
generate/require corresponding .txt files.

Bug: 145998881
Test: m checkbuild
Change-Id: I21cfdb0b63fd575e8c8c63ea2b436e0c4aa8f3fc
2020-01-02 15:38:18 +00:00
Paul Duffin
c4cea76c0d java_sdk_library: Rename createDocs to createStubsSources
The createDocs(...) method was obviously named because it created a
droiddocs target that generated the stubs source but it now creates a
droidstubs target so the name was misleading.

Bug: 145998881
Test: m checkbuild
Change-Id: I7419b0a01ee87ecb2b396e4817e5e88a88a8b7b6
2020-01-02 14:56:00 +00:00
Paul Duffin
03fbd786b5 java_sdk_library: Remove unused stubsLibraryDependencyTag
Bug: 145998881
Test: m checkbuild
Change-Id: I3ce0fa498c261a9a1f0382f6d548bb070a656358
2020-01-02 14:55:27 +00:00
Treehugger Robot
0a83b7961c Merge "java_sdk_library: construct droidstubs args as []string" 2020-01-02 14:34:06 +00:00
Paul Duffin
1b82e6a108 Add support for java_test in sdk
Adds java_test_import module type for use by the sdk snapshot and
adds java_tests property to the sdk and sdk_snapshot module type.

This is needed for the conscrypt test sdk.

Bug: 143678475
Test: m nothing
Change-Id: Ied4c56c978dac2f92a9b3bc34b3235d7eeba2fd3
2019-12-31 15:08:59 +00:00
Paul Duffin
e602918294 Restrict SdkMemberTypes that can be used with sdk/sdk_snapshot
By default SdkMemberTypes are only supported on module_exports module
type. Support for sdk module type has to be explicitly specified.

The java_header_libs, native_shared_libs and stubs_sources are
supported on sdk. The latter is required to provide the stubs source
for an API specified in java_header_libs as they should be kept in
sync.

Bug: 146341462
Test: m nothing
Change-Id: I19b9e60792780a797458d4a9e489506602b13144
2019-12-31 15:08:59 +00:00
Paul Duffin
235ffffbdc java_sdk_library: construct droidstubs args as []string
Bug: 145998881
Test: m checkbuild
Change-Id: Id3eb99577200a807050dbf86f47816a2476c3d9c
2019-12-31 15:08:33 +00:00
Paul Duffin
28aa544884 Merge "Added module_exports/_snapshot as alias for sdk/_snapshot" 2019-12-31 14:59:19 +00:00
Treehugger Robot
0a6c8813ba Merge "AIDEGen: collect cc_srcs and cc related flags in module_bp_cc_deps.json" 2019-12-31 01:16:35 +00:00
Kiyoung Kim
2c12207919 Merge "Detach VNDK using core library list from VNDK APEX" 2019-12-31 00:55:46 +00:00
Paul Duffin
8150da6e9d Added module_exports/_snapshot as alias for sdk/_snapshot
Bug: 146341462
Test: m nothing
Change-Id: I27e1ef494a2b0874074aa43614612189b17e7860
2019-12-30 18:03:30 +00:00
Kiyoung Kim
e1aa8ea34e Detach VNDK using core library list from VNDK APEX
Some devices require VNDK using core library list, but this is dependent
to system image rather than VNDK version. This change removes VNDK using
core variant library list file from VNDK APEX, and also remove VNDK
version from its filename.

Bug: 142599349
Test: m -j passed && aosp_cf_x86_go_phone booted
Change-Id: Ibc53b8dfc9d38e14bbaa878154034d25a6d34089
2019-12-30 14:29:52 +09:00
bralee
5a5cce695f AIDEGen: collect cc_srcs and cc related flags in module_bp_cc_deps.json
Define a field CCSrcs and other cc related flags in a type ccIdeInfo
struct and write them into out/soong/module_bp_cc_deps.json. AIDEGen
can use these data to generate CMakeLists.txt by Python for multiple
native projects in CLion IDE.

Bug: 141512319

Test: 1. export SOONG_COLLECT_JAVA_DEPS=false SOONG_COLLECT_CC_DEPS=true;m nothing
         check
	 1). File out/soong/module_bp_cc_deps.json is generated.
	 2). In "JniInvocation_test" module: "path", "srcs",
	     "global_common_flags", "local_common_flags",
	     "global_c_flags", "local_c_flags", "global_c_conly_flags",
	     "local_c_conly_flags", "global_cpp_flags",
	     "local_cpp_flags" and "system_include_flags"
	     have been created.

Change-Id: I9292cc6373157ba68f013998a7364f84a70d5593
2019-12-30 09:35:40 +08:00
Treehugger Robot
e9391f8bab Merge "Create APEX variation only when needed" 2019-12-28 04:18:59 +00:00
Jooyung Han
380f85edd3 Merge "Dedup generating xml file for java_sdk_library" 2019-12-27 23:26:41 +00:00
Dan Willemsen
1bdbdec5a0 Take into account RAM usage for multiproduct_kati
Apparently we have some instances of Soong taking 16GB of RAM. While
that's a problem to solve on it's own, make multiproduct_kati's
auto-parallelism detection smarter by taking into account the total RAM
on the machine instead of just the number of CPUs.

Bug: 146925549
Test: check soong.log for autodetected parallelism values
Change-Id: Ice34c2cf73ea4f8f235521cbefc8654a79a04eef
2019-12-27 09:54:11 -08:00
Dan Willemsen
2bb82d0011 Add TotalRAM detection
Colin originally wrote this for the highmem pool:

https://android-review.googlesource.com/c/platform/build/soong/+/1168271

But while that's a larger change, this is useful to just be in the logs,
and for use in multiproduct_kati to better limit the number of
concurrent jobs.

Test: check soong.log on linux and mac
Change-Id: I0518d303a220d775f8d78dba9f660b2954e68e3e
2019-12-27 09:43:49 -08:00
Jiyong Park
3ff1699683 Create APEX variation only when needed
Create an APEX variation of a module only when it is either directly
included in an APEX or the dependency to the module demands that the
module should be included. For example, a non-static dependency to a
java library no longer creates an APEX variant of the library.

Bug: 146907857
Test: m (apex_test amended)
Test: cat out/soong/build.ninja | grep "Module:" | wc -l
reduced from 47132 to 45881

Change-Id: Icd79fb4b60668d852b9f018343b934b5e42a8eda
2019-12-27 14:11:47 +09:00
Kiyoung Kim
fb1e5fbf13 Merge "Move compat symlinks from makefile to soong" 2019-12-27 00:08:06 +00:00
Jooyung Han
624058e6a5 Dedup generating xml file for java_sdk_library
Permission XML file for java_sdk_library is generated by
java_sdk_library itself now.

And, build rule is switched to android.WriteFile since "echo -e" is
not supported from build server. (-e is printed to output)

Bug: 145474221
Test: m com.android.cronet and check its permissions xml file
     also, m org.chromium.net.cronet.xml (created dynamically)
Change-Id: Iffb119151c49bc4fe6c4386fa267cca193f37dbc
2019-12-26 12:20:24 +00:00
Jooyung Han
4791cb507b Move compat symlinks from makefile to soong
Two APEXes (i18n, art) requires compat symlinks and these symlinks are
created via ld.config.txt module's POST_INSTALL_CMDS.

  $ m installclean
  $ m ld.config.txt
  $ tree $OUT/system

.../system
├── bin
│   ├── dalvikvm -> /apex/com.android.art/bin/dalvikvm
│   └── dex2oat -> /apex/com.android.art/bin/dex2oat
├── etc
│   └── ld.config.txt
└── usr
    └── icu -> /apex/com.android.i18n/etc/icu

By the way, ld.config.txt is going to removed since linkerconfig
generates it on device.

So, we're moving symlink creation from ld.config.txt(rootdir/Android.mk)
to APEXes' POST_INSTALL_CMDS.

  $ m installclean
  $ m com.android.i18n
  $ tree $OUT/system

.../system
├── apex
│   └── com.android.i18n.apex
└── usr
    └── icu -> /apex/com.android.i18n/etc/icu

  $ m installclean
  $ m com.android.art
  $ tree $OUT/system

.../system
├── apex
│   └── com.android.art.debug.apex
├── bin
│   ├── dalvikvm -> /apex/com.android.art/bin/dalvikvm
│   └── dex2oat -> /apex/com.android.art/bin/dex2oat

Bug: 143192278
Test: m && boot (since these two apexes are bootstrap apexes)
Change-Id: Ib29ea9f9ac40e74f78cd530e7daef8c51292fd24
2019-12-24 14:00:47 +09:00
Treehugger Robot
29d1336d11 Merge "Run extractor for Go files in build/soong directory" 2019-12-23 20:55:25 +00:00
Sasha Smundak
ca54088aa8 Run extractor for Go files in build/soong directory
Bug: 137798757
Test: run cd build/soong &&  ../../prebuilts/build-tools/linux-x86/bin/go_extractor --goroot=$PWD/../../prebuilts/go/linux-x86 --rules=vnames.go.json --canonicalize_package_corpus --output $OUT_DIR/soong/golang.kzip ./...
Change-Id: Ib1edde4bf36e6b0683f49da0986f243690c81d6b
2019-12-23 11:34:15 -08:00
Paul Duffin
e2bc36f12c Merge "Generate .srcjar for prebuilt_stubs_sources" 2019-12-23 13:32:08 +00:00
Jooyung Han
97e7279cc6 Merge "apex: drop java_import support" 2019-12-23 09:14:32 +00:00
Jooyung Han
5a80d9f352 apex: drop java_import support
java_import doesn't support dex jar which is necessary to be packaged in
an APEX. Supporting this would require non-trivial work. By the way
java_import is not used and there is a workaround.(defining java_library
and static-linking with it)

We drop the support for `java_import` in APEX.

Bug: 139175488
Test: m (soong tests amended)
Change-Id: I924386571079090c701276d87f665ce7fbb6f074
2019-12-23 06:46:39 +00:00
Jiyong Park
d061df9ef3 android_*_stubs_current modules are moved to frameworks/base
The modules were moved from developement/build to frameworks/base.
In addition, they no longer uses 'sdk_version:"none"'. Reflect that
change here.

Bug: N/A
Test: m

Exempt-From-Owner-Approval: cherry-pick from internal

Merged-In: I6f69f7cb64a6ed3c2032a116500436eabe562dca
(cherry picked from commit 12cc126760)
Change-Id: I6f69f7cb64a6ed3c2032a116500436eabe562dca
2019-12-22 17:20:27 +09:00
Treehugger Robot
7e143af6ee Merge "Add support for java_test_helper_app." 2019-12-22 05:21:37 +00:00
Dario Freni
6f3937cb29 Add support for java_test_helper_app.
Bug: 142712057
Bug: 138429615
Test: apex_test passes, tried building an apex with a test app.
Change-Id: Ib75bd48042d8b1fe102038bef08cd1be708e996d
2019-12-21 08:50:12 +00:00
Treehugger Robot
727173ecca Merge "Create product variant for product partition" 2019-12-21 00:56:45 +00:00
Jaewoong Jung
dcee89cad6 Merge "Make apex.overrides overridable by override_apex." 2019-12-20 18:20:50 +00:00
Paul Duffin
a0843f6a6f Differentiate between cc library and binary
The cc library and cc binary (and other cc module types) are all
instances of cc.Module. So, to differentiate between them and make
sure that only appropriate library instances can be added to
native_shared/static_libs this adds a special sdkMemberTypes field to
Module which if set specifies the SdkMemberTypes the module supports.
If it is not set then the module type cannot be used in the sdk at all.

Corrects an issue with one of the tests where a prebuilt cc
library was added to the sdk instead of a source cc library.

Adds a new test to ensure that cc_library_(shared|static)_host module
types work with the sdk as well and another test to ensure that
cc_library can be used as either.

Bug: 142918168
Test: m checkbuild
Change-Id: I359cdbdd15328ca571f276d2b6ce9a229ebb2c86
2019-12-20 15:45:17 +00:00
Paul Duffin
6c26dc7392 Dedup cc library module type registration
Test: m checkbuild
Bug: 146540677
Change-Id: I6685338550f587212e70f3eba8d4342b66f566e2
2019-12-20 15:22:52 +00:00
Martin Stjernholm
d732beed90 Merge "Add script for building all target arch's needed in AML (Android Mainline) prebuilts." 2019-12-20 11:53:33 +00:00