Commit graph

9342 commits

Author SHA1 Message Date
Colin Cross
2fc72f66d0 Remove duplicated shouldUncompressDex logic
shouldUncompressDex has already been computed and stored in
deviceProperties.UncompressDex, pass it to dexpreopter instead
of recomputing it.

Also add a stub for java libraries to set UncompressDex.

Test: no change to build.ninja
Change-Id: I663d9fbbe768a8dc9a97c7d456dd7a010f43162d
2019-01-09 08:31:48 +00:00
Colin Cross
1f8076b42d Merge changes I6f80b7b3,Ida8f046c
* changes:
  Don't dexpreopt when compile_dex but not installable
  Don't dexpreopt or strip java_test modules
2019-01-09 05:43:12 +00:00
Colin Cross
9036e2eef1 Merge changes Ideba9c0d,Iea2ab9be
* changes:
  Add dexpreopt enabled tests
  Add Maybe* methods to TestingModule
2019-01-09 05:28:20 +00:00
Treehugger Robot
667b3ae692 Merge "Executables in APEXes have root:shell" 2019-01-09 05:23:20 +00:00
Elliott Hughes
2837d75ffd Merge "Switch to toybox chmod(1)." 2019-01-09 00:27:35 +00:00
Jaewoong Jung
acb529b038 Handle multi dir all-*-files-under function calls.
This change fixes a bug where androidmk assumes all-*-files-under
function only takes one directory parameter.

Test: androidmk_text.go, manual execution
Change-Id: Ib1614a2ddde7ea1120c1c37126231988f4862165
2019-01-09 00:07:01 +00:00
Jiyong Park
805cbc3ac2 Executables in APEXes have root:shell
Executables under /system/bin are configured as (uid:gid)=(root:shell)
by fs_config.cpp. Therefore, an executable that is moved/copied from
/system/bin to an APEX should be configured as such.

Test: adb shell ls -al /system/bin/linker
/apex/com.android.runtime/bin/linker shows
-rwxr-xr-x 1 root shell 1133528 1970-01-01 09:00 /apex/com.android.runtime/bin/linker
-rwxr-xr-x 1 root shell 1133528 1970-01-01 09:00 /system/bin/linker

Change-Id: Ibb698aab237362fed312da2af809cceead8a1092
2019-01-09 08:41:45 +09:00
Treehugger Robot
06af80e3a4 Merge "Don't use vendor variant when BOARD_VNDK_VERSION is not set" 2019-01-08 23:34:08 +00:00
Jaewoong Jung
06fbd65c28 Merge "Add LOCAL_OVERRIDES_PACKAGES support to androidmk." 2019-01-08 15:15:07 +00:00
Jaewoong Jung
7494e7301a Merge "Add java_import_host handling logic." 2019-01-08 15:14:51 +00:00
Nan Zhang
d50f53bc25 Fix the issue for dumping metrics file to artifact
Bug: b/63815990
Test: N/A
Change-Id: I72ddc8579626e652a8c27299e009b24ded5312f6
2019-01-07 20:26:51 -08:00
Jaewoong Jung
18ef4a2881 Add LOCAL_OVERRIDES_PACKAGES support to androidmk.
It is supposed to be translated to overrides.

Test: Manual test
Change-Id: Ice2e7c5f7669ad1e4c3e82000c8dd52d20a49a7a
2019-01-07 14:30:43 -08:00
Jaewoong Jung
2a9ed7c429 Add java_import_host handling logic.
Now java_import with a host flag set to true is converted to
java_import_host.

Bug: 122372359
Test: bpfix_test.go + manual test with real examples.
Change-Id: Ie38fa51a44c83c434927db4b742d6839c64b3d63
2019-01-07 14:13:51 -08:00
Treehugger Robot
e2e13a5d99 Merge "Save invocation info of dex2oat runs." 2019-01-07 21:38:16 +00:00
Treehugger Robot
ef7647f3ea Merge "Fix: soong_ui.bash's wrong check for TOP variable" 2019-01-07 04:44:59 +00:00
Treehugger Robot
4e78fec21e Merge "Pass -S option to wrapper for python binary." 2019-01-07 02:42:09 +00:00
Colin Cross
dc2da916fb Don't dexpreopt when compile_dex but not installable
Modules shouldn't be dexpreopted and possibly stripped when
compile_dex is set but installable is not set.  This matches the
previous behavior when the dexpreopt rules were in Make.

Bug: 121317615
Test: dexpreopt_test.go
Change-Id: I6f80b7b37a990c475b91aa5d98a19a3baa85eb1b
2019-01-06 08:50:36 -08:00
Colin Cross
e302687ea4 Don't dexpreopt or strip java_test modules
I6bb2c971cee65d2338839753aa0d84939f335b1b accidentally caused
java_test modules to be dexpreopted and possibly stripped.

Test: dexpreopt_test.go
Change-Id: Ida8f046c509c97e38bd3bce66944d32f01530db4
2019-01-06 08:50:32 -08:00
Colin Cross
638149e650 Add dexpreopt enabled tests
Add tests that verify when dexpreopt is enabled or disabled.

Test: dexpreopt_test.go
Change-Id: Ideba9c0dac30eb31e7ae29e46d1d1590202b8369
2019-01-05 22:36:13 -08:00
Colin Cross
b77ffc48dc Add Maybe* methods to TestingModule
Add methods to TestingModule that return an empty BuildParams instead
of panicking, which can be used to test if a module has a matching
rule.  Also add godoc to the TestingModule methods.

Test: m
Change-Id: Iea2ab9be57d3f3f60437041f4e5a7e2100e1fe48
2019-01-05 22:36:13 -08:00
Nan Zhang
dae8314a54 Merge "Generate build timing metrics to proto format file" 2019-01-05 02:17:30 +00:00
Jiyong Park
7c1dc6100a Don't use vendor variant when BOARD_VNDK_VERSION is not set
Vendor variants are not available when BOARD_VNDK_VERSION is not set.

Test: m for aosp_marlin
Change-Id: I5d89a401f5cf98db3f0a9aa553f00b2d6ee9ed1e
2019-01-05 11:17:10 +09:00
Nan Zhang
17f2767724 Generate build timing metrics to proto format file
Test: Dumped the text formated based metrics file to out dir,
and checked the file.
Bug: b/63815990

Change-Id: Iff476f72a0be74eb53b6b26ef468d11c0f24a404
2019-01-04 15:54:01 -08:00
Jaewoong Jung
bf35e33cfb Merge "Add buildDir to java patch-module paths." 2019-01-04 20:43:50 +00:00
Jaewoong Jung
91b38477e2 Merge "Add defaults support to genrule." 2019-01-04 20:43:37 +00:00
Jaewoong Jung
a45e15e2d4 Merge "Make bpf implement SourceFileProducer." 2019-01-04 19:04:47 +00:00
Jaewoong Jung
98716bdf40 Add defaults support to genrule.
Bug: 119635195
Test: genrule_test.go
Change-Id: I8aeff18760b031491012dd4864985b4ed01dbf3a
2019-01-04 15:37:59 +00:00
Jaewoong Jung
38e4fb2ce6 Add buildDir to java patch-module paths.
This solves a problem where javac fails to find patch-module targets
when a build diretory is not under the project root.

Bug: 117770838
Test: java_test.go + manual build
Change-Id: If70d0d388a3f6c87b3f78a927df2063616d50c8a
2019-01-04 15:37:20 +00:00
Treehugger Robot
9b84d34be3 Merge "Don't expect depfile from .s files" 2019-01-04 15:19:33 +00:00
yangbill
7265e5f9c1 Pass -S option to wrapper for python binary.
Prevent problem for some users using PAR file built by android's
build system which cause by the different site package of python
installed by user themselves.

Bug: 120469915
Test: 1. m atest
         atest --help
      2. apply aosp/861470
         full build

Change-Id: I72c83f9397f0e88eecfcd32806f1746520299447
2019-01-04 18:10:32 +08:00
Dan Willemsen
fcabb1c518 Don't expect depfile from .s files
.s files (unlike .S files) aren't run through the preprocessor, so -M*
doesn't actually write out a depfile.

Since our ninja is now going to be verifying that the depfile is created
(https://android-review.googlesource.com/861510), don't specify a
depfile for .s files.

Bug: 121058584
Test: apply https://android-review.googlesource.com/861510
Test: cd external/libavc; mma
Change-Id: I1697aa020c63639317c8f4771147026601ae72fc
2019-01-03 23:25:11 -08:00
Logan Chien
fa478c0234 Do not build lsdump for APEX variants
This commit stops building lsdump files for APEX variants since APEX
variants are local to APEX modules themselves.

Bug: 121986692
Test: make findlsdumps  # compare $ANDROID_PRODUCT_OUT/lsdump_paths.txt
Change-Id: I37fcd152d0d84d235a354ea53e53e808dd71464a
2019-01-04 13:28:06 +08:00
Logan Chien
3aeedc9592 Do not add _platform suffix to non-apex variation
This commit renames `_platform` suffix to `` (empty string) so that
non-apex variations are not renamed to `_core_shared_platform` or
`_vendor_shared_platform`.

This commit makes sure that `_core_shared` and `_vendor_shared` is
always under `$OUT_DIR/soong` regardless the usages from apex modules.
Furthermore, this avoids the confusing stale lsdump files (e.g. both
`_core_shared` and `_core_shared_platform exist) while creating
reference ABI dumps for VNDK ABI checks.

Bug: 121986692
Test: lunch aosp_arm64-userdebug; make  # no more _platform variants.
Change-Id: Ic02a60ac45f982580349661c22331d114617fd92
2019-01-04 13:28:01 +08:00
Nan Zhang
e7968b192c Merge "Pass --merge-qualifier-annotations to check-api" 2019-01-04 00:53:45 +00:00
Treehugger Robot
f17284e05d Merge "Fix: stubs lib is installed in APEX" 2019-01-03 23:15:03 +00:00
Treehugger Robot
dddedf2e8c Merge "manifest_fixer: rename to --prefer-code-integrity" 2019-01-03 22:22:26 +00:00
Nan Zhang
dee152bfa3 Pass --merge-qualifier-annotations to check-api
As tnorbye@ mentioned, the check-API comptibility needs the annotations
that were merged in so that the behavior will be consistent with
signature file.

Test: check the ninja file.
Bug: N/A
Change-Id: I0c06c838cf7ddfd43f583fc8c1b1ad999a4cc066
2019-01-03 11:28:47 -08:00
Jiyong Park
67883b3ec6 Fix: stubs lib is installed in APEX
This CL fixes the problem that when a lib is defined with stubs, the
stubs variantof the lib is installed to the APEX. This was happening
because the non-stubs variant is the last variant of the 'version'
variants and addFarVariationDependencies selects the first variant when
the 'version' variant isn't specified.

Fixing the problem by making the non-stubs variant (whose name is "")
the first variant.

Test: m (apex_test)

Change-Id: I1505fd2f29a0d70c916bad51000aa06f2b80b137
2019-01-04 03:37:00 +09:00
Jiyong Park
d26357ebbd Merge changes from topic "apex_bundle_pubkey"
* changes:
  Bundle public keys with APEX
  Add installable property to apex_key
2019-01-03 18:28:42 +00:00
Jiyong Park
835d82b73c Bundle public keys with APEX
When an apex key is marked as 'installable: false' and the build is
debuggable, the pubic key file for the apex key is bundled with the APEX
that is signed with the key.

This eliminates the need to install the public keys for the
testing-purpose APEX in the system partition.

Bug: 122047804
Test: m
Change-Id: Ifa5914891463dbf4c21484ea440836521b2f90b1
2019-01-04 03:23:12 +09:00
Jiyong Park
50d99206d5 Add installable property to apex_key
Setting the property to false prevents the key from being installed.
Useful for testing keys.

Bug: 122042717
Test: add 'installable: false' to the apex_key
'com.android.apex.test_package.key'. mma under
/system/apex/apexd/apexd_testdata. The key is not found under
out/target/product/..../system/etc/security/apex

Change-Id: Ibf70e4e8ea5e73432d06b1c4050df531eaafc85e
2019-01-04 03:23:12 +09:00
Victor Hsieh
a2c16c1aa0 manifest_fixer: rename to --prefer-code-integrity
During code review, the name change was suggested.

Test: local CTS passed
Bug: 112037137
Change-Id: I7eb25210afb45c7477b0d606574048a15c9c721d
2019-01-03 09:51:11 -08:00
Jiyong Park
f7df9b7e55 Fix: 'required' property is ignored
This change fixes a bug that the 'required' property of a module is
ignored when the module is using a shared from an APEX. This is
happening because LOCAL_REQUIRED_MODULES is overwritten (with := instead
of +=) when ApexesProvidingSharedLibs is not empty.

Fixing the bug by appending ApexesProvidingSharedLibs to
AndroidMkData.Reuired so that it is handled in android/androidmk.go

Test: m
Test: build with https://android-review.googlesource.com/c/platform/bionic/+/849044
and make sure that system/bin/vold_prepare_subdirs exist.

Change-Id: Ie57bca480ba4198b4da0df1c73e92fa42b5ebda8
2019-01-04 01:19:44 +09:00
Colin Cross
189ff9868e Set stem for uninstalled apex modules
Apex modules with installable: false are not installed, so the
dist rule copies from LOCAL_BUILT_MODULE instead of
LOCAL_INSTALLED_MODULE.  If LOCAL_BUILT_MODULE_STEM is unset,
LOCAL_BUILT_MODULE will have the module name as the stem,
resulting in an incorrect file copied to the dist directory.
Set LOCAL_MODULE_STEM instead of LOCAL_INSTALLED_MODULE_STEM,
which also covers LOCAL_BUILT_MODUL_STEM.

Fixes: 122277867
Test: tapas test1_com.android.tzdata && m dist
Change-Id: I0af0c5adcac478a1ce68c4625203fd9bd56bf94d
2019-01-02 22:37:21 -08:00
Dan Willemsen
7f30c076d5 Print a status message when starting ninja
This way we don't appear hung at:

  No need to regenerate ninja file

Change-Id: I8dbdaa2c1b1c5a6a73187d0e6061f363b62e10c9
Fixes: 122251150
Test: m nothing
2019-01-02 12:50:49 -08:00
Alex Light
5de4196079 Save invocation info of dex2oat runs.
It is useful to have the exact dex2oat invocation used to generate
artifacts for some tests. This adds the --write-invocation-to= flag to
the build to save this information.

Test: m droid
Bug: 119332327
Change-Id: Id7664cf6d05bbb1c580f94584cdeb96084d5799c
2019-01-02 10:59:08 -08:00
Jooyung Han
e9793a7e82 Fix: soong_ui.bash's wrong check for TOP variable
soong_ui.bash defines `gettop` function and it finds top of the source
tree. It also checks if `TOP` is properly set and if set use it.
However its check was using the wrong operator (`-z`) for it.

Test: m -j
Change-Id: Ie86dc340a9f89f45ff0828ea43f6afa3713bda76
2018-12-28 14:43:52 +09:00
Treehugger Robot
186c771cb4 Merge "In java.go, add implement check for both Dependency and IDE relevant interfaces" 2018-12-28 01:41:25 +00:00
Treehugger Robot
dc208bb2bb Merge "Fix soong_zip printing warnings with --ignore_missing_files" 2018-12-27 23:49:58 +00:00
Dan Willemsen
edc934ccc9 Fix soong_zip printing warnings with --ignore_missing_files
We weren't defaulting args.Stderr to os.Stderr, so we had been calling
fmt.Fprintln with `nil`.

Test: soong_zip --ignore_missing_files -C test/ -f abc -o test.zip
Change-Id: I0421f4bfb07fa36edf86c68ffc847995777c8221
2018-12-27 12:41:25 -08:00