Commit graph

12194 commits

Author SHA1 Message Date
Elliott Hughes
ef19e01f96 Switch to toybox stat on macOS too.
Bug: http://b/139450866
Test: builds
Change-Id: I97af607a311aea5f97544bd3ce1d532d999126ff
2019-09-05 10:01:37 -07:00
Treehugger Robot
47236f13fc Merge "Re-enable tautological-unsigned-enum-zero-compare" 2019-09-03 21:29:54 +00:00
Nikita Ioffe
3f3190fe4a Merge "apex.go: Add support for diffing content of APEX with whitelist file" 2019-09-03 15:09:03 +00:00
Paul Duffin
115445b5d6 Allow per test rules in neverallow_test.go
Makes testing individual rules easier by allowing them to be specified
per test rather than having to add them to the global defaults.

Bug: 138428610
Test: m nothing
Change-Id: Ic65a55dee2a02b6d33254753c047295dd5804408
2019-09-03 10:33:29 +01:00
Paul Duffin
91e3819335 Support multiple expected errors in neverallow_test.go
Extracted some common code used by visibility_test.go and
neverallow_test.go into a new function CheckErrorsAgainstExpectations
in testing.go.

Bug: 138428610
Test: m nothing
Change-Id: I6996fa52968c387e38b4a67ffa59cd07c2d524e8
Merged-In: Iafbadf12c6ffdc4d9128fcfe7f15792df5cfd020
2019-09-03 10:33:29 +01:00
Nikita Ioffe
5d5ae761c5 apex.go: Add support for diffing content of APEX with whitelist file
So far a very basic version.

In case there is a diff, soong will emit an error message with a command
to resolve the diff. Example:

New unexpected files were added to com.android.apex.cts.shim.v3. To fix the build run following command:
system/apex/tools/update_whitelist.sh system/apex/shim/build/default_shim_whitelist.txt out/soong/.intermediates/system/apex/shim/build/com.android.apex.cts.shim.v3/android_common_com.android.apex.cts.shim.v3/com.android.apex.cts.shim.v3-content.txt

Test: m checkbuild
Bug: 139125405
Change-Id: I57e694f394c56105dc7363a684983605c7bf5e7d
2019-09-02 17:55:21 +01:00
Yi Kong
8ca12bd837 Re-enable tautological-unsigned-enum-zero-compare
Clang is smarter at producing this new warning now, producing far
fewer false positives. Re-enable the diagnostic for Android.

Test: build
Bug: 72331526
Change-Id: Ide827791c51587bceb977ae4116894a8cd620eb1
2019-09-01 14:11:01 -07:00
Martin Stjernholm
cc4b0ad706 Update dexpreopt for the ART APEX name change.
Test: Build & boot
Bug: 135753770
Exempt-From-Owner-Approval: Approved internally
Change-Id: I3aac9112b022cce3ef8cfdf4bdbbed8bb0c8f4c7
Merged-In: I3aac9112b022cce3ef8cfdf4bdbbed8bb0c8f4c7
2019-08-30 17:47:30 +01:00
Treehugger Robot
7153b767a5 Merge changes from topic "drop_circular_dep"
* changes:
  Remove srcs_lib and srcs_lib_whitelist_pkgs
  Remove the automatic dependency to framework-res.apk for R/Manifest
  Prepare to be able to put framework-res in srcs
2019-08-30 13:47:31 +00:00
Treehugger Robot
c61c83db9a Merge "Automatically enable abi checker for the stub libs" 2019-08-30 05:29:23 +00:00
Yi Kong
73e2125894 Merge "Re-enable tautological-unsigned-zero-compare" 2019-08-30 01:44:27 +00:00
Treehugger Robot
17f4728d4b Merge "Normalize and validate the java_version property." 2019-08-29 18:15:07 +00:00
Treehugger Robot
1e7f14b1d5 Merge "Disable FORTIFY for fuzzer builds." 2019-08-29 17:00:20 +00:00
Anna Trostanetski
c772405d75 Merge "Move platform compat config to their own directory." 2019-08-29 16:57:34 +00:00
Roland Levillain
af93360ef9 Merge changes from topic "check-flattened-art-apex"
* changes:
  Add an output file type for flattened APEXes.
  Allow modules to be enabled/disabled depending on whether APEXes are flattened.
2019-08-29 15:17:29 +00:00
Pete Gillin
4e8b48a055 Normalize and validate the java_version property.
There are two parts to this change.

Normalization: If a module specifies 'java_version: "9"', this is now
normalized into 'java_version: "1.9"'. Users might reasonably assume
that "9" should be valid, since javac treats them as synonyms (and, in
fact, the javac documentation lists "9" as a valid value but doesn't
mention "1.9"). However, the soong code that triggers JPMS support
(i.e. setting -system rather than --boot-class-path) looks for the
string "1.9", so prior to this change modules specifying "9" would
fail with a confusing error ('javac: option --boot-class-path not
allowed with target 1.9'). Normalizing "9" to "1.9" fixes this. (The
change normalizes the other supported values, too, for consistency.)

Validation: This change also makes the build fail-fast with a clear
error message for invalid values. In particular, modules specifying
"10" or "11" fail with an explicit message that this is not supported,
in anticipation of the switch to OpenJDK 11. Prior to this change,
modules setting those values would get the confusing
'--boot-class-path not allowed' error described about since JPMS
support would not be triggered. (That could be fixed by changing the
JPMS logic to trigger on "10" and "11", but that would be dangerous
since support in the rest of the system for v54 and v55 class files is
unproven: it is better to fail explicitly.) (This change also makes it
fail-fast for any unrecognized values.)

Test: make java
Test: make targets with java_version set to "1.8", "8", "1.9", and "9", all succeed ("9" fails without this change)
Test: make targets with java_version set to "10" and "11", fail with the explicit "not supported" message
Test: make target with java_version set to "xxx", fails fast with the "unrecognized" message
Bug: 131683177
Change-Id: I2f5eb496c29d7736c68c01401c3f0967aeae99fc
2019-08-29 16:10:04 +01:00
atrost
87901b055b Move platform compat config to their own directory.
This prevents SystemConfig from trying to read them. Also removed ' ' prefix+postfix when creating an empty config.
Bug: 140074769
Bug: 140092095
Test: Flashed device, no more "SystemConfig: Tag compat-change is unknown..." warnings in logcat

Change-Id: I374826526fe3e4555474688b65a0be7253c6dd8c
2019-08-29 13:46:41 +00:00
Dan Shi
e7eb842bbb Merge "Add option disable_framework for auto-generated test config" 2019-08-29 05:18:20 +00:00
Jiyong Park
b5ddfa9219 Remove srcs_lib and srcs_lib_whitelist_pkgs
They are no longer used. Sources are provided via filegroup.

Also removing the SrcDependency interface as it is no longer used.

Bug: 135922046
Test: m
Merged-In: I81f9614d20fbdd2f7d18340d6dbdb592e7acde06
(cherry picked from commit fa21cba64a)
Change-Id: I81f9614d20fbdd2f7d18340d6dbdb592e7acde06
2019-08-29 13:58:40 +09:00
Jiyong Park
289206594c Remove the automatic dependency to framework-res.apk for R/Manifest
framework-minus-apex and framework-annotation-proc had automatic
dependency to framework-res.apk to get the generated R.java and
Manifest.java as their inputs.

That is no longer needed as the sources are fed from framework-srcs
filegroup.

Bug: 70046217
Test: m

Merged-In: Ibb03db01c177d6e908cbbdf91f18be8744f02c03
(cherry picked from commit 8cc55bdffe)
Change-Id: Ibb03db01c177d6e908cbbdf91f18be8744f02c03
2019-08-29 13:58:18 +09:00
Jiyong Park
b7c639e0b3 Prepare to be able to put framework-res in srcs
This change introduces two changes required to put
framework-res explicitly in srcs property, without relying on the build
system to specially add framework-res as a dependency to
framework-minus-apex, etc.

1) R.java and Manifest.java generated from aapt were packaged to the file
R.jar directly under the gen directory. With this change, the file
becomes android/R.srcjar under the gen directory.

2) android_app module now overrides OutputFileProducer interface so that
it can recognize "{.aapt.srcjar}" tag to reference the generated srcjar file.

Being able to put framework-res in srcs allows us to pass all the source
files (both in the source tree and the ones generates) via a filegroup.
Previously, the source files could only be passed via the java_library
module type. This caused a circular dependency problem when the java
library was used as an input (src_libs) of the droiddoc module. Using
filegroup eliminates the circular dependency.

Bug: 70046217
Test: m

Merged-In: I9ab6116bcc6fa3da60933d427575463b05ae69b4
(cherry picked from commit 94f37f33ed)
Change-Id: I9ab6116bcc6fa3da60933d427575463b05ae69b4
2019-08-29 13:57:32 +09:00
Dan Willemsen
63cce39166 Merge "Disallow __DATE__/__TIME__ on host builds" 2019-08-29 02:14:27 +00:00
Jaewoong Jung
7ca5576905 Merge changes Ife12ba69,Ibf910262
* changes:
  Implement android_test_import
  AndroidMkEntries minor refactoring.
2019-08-29 00:55:14 +00:00
Jooyung Han
a9caf47ea2 Merge "soong: Add tests for depending on disabled module" 2019-08-28 23:58:33 +00:00
Dan Shi
20ccd2125d Add option disable_framework for auto-generated test config
The new option will allow the auto-generated test config for cc_test to
include RunCommandTargetPreparer to disable framework before the test
run and re-enable it after the test run.

Bug: 140065309
Test: test hello_world_test with the new option.
Change-Id: If2189e9474f5b11bd0d0471e231a2cae14155389
2019-08-28 15:53:43 -07:00
Ivan Lozano
c6de2d9482 Merge "Add Rust support to Soong." 2019-08-28 22:04:56 +00:00
Jaewoong Jung
b28eb5fdcb Implement android_test_import
Test: app_test.go, prebuilt CTS tests
Fixes: 132371143
Change-Id: Ife12ba691dfa597dde90faf0957224a6f444e139
2019-08-28 14:58:19 -07:00
Ivan Lozano
ffee334706 Add Rust support to Soong.
Adds support to Soong for building rust modules. This currently only
supports x86_64 device and x86 linux host targets. The functionality
is sufficient to build crosvm.

Bug: 136189233
Test: Test module builds.
Test: crosvm builds.
Change-Id: I6ea04615834a6d673578ab10ea1a2eb04259fe09
2019-08-28 14:11:07 -07:00
Jaewoong Jung
e0dc8dfd22 AndroidMkEntries minor refactoring.
This includes a few changes that make AndroidMkEntries more resemble
AndroidMkData, especially in terms of how extra entries are added.
Most importantly it can now have multiple custom functions.

Test: Soong tests
Change-Id: Ibf9102624d16d0c1c9894a2794fc7c797bb34c9a
2019-08-28 13:07:03 -07:00
Mitch Phillips
b9b3e79096 Disable FORTIFY for fuzzer builds.
Disables FORTIFY for fuzz target builds. We generally build with a
sanitizer and want the sanitizer to handle the bugs and provide us with
a nice stack trace.

Bug: 140187921
Test: m example_fuzzer && $ANDROID_HOST_OUT/fuzz/example_fuzzer (note
that you get a proper ASan report instead of a fortify crash)

Change-Id: I15a117b26c401a03785fb44c0f796588f366bc55
2019-08-28 12:41:07 -07:00
Treehugger Robot
7eedfe00e7 Merge "Save deps when asflags contains -xassembler-with-cpp" 2019-08-28 19:16:11 +00:00
Treehugger Robot
21738f6032 Merge "Remove hashtree from builtin APEXes" 2019-08-28 14:18:21 +00:00
Jiyong Park
a034b83988 Automatically enable abi checker for the stub libs
The header ABI checker is enabled by default for the libs that are used
across APEXes.

Bug: 138219814
Test: m
Change-Id: Ic0e9c5fdfa1259f500d990abc504c452436f3bd7
2019-08-28 22:58:11 +09:00
Yi Kong
30a3c7faca Re-enable tautological-unsigned-zero-compare
Clang is smarter at producing this new warning now, producing far
fewer false positives. Re-enable the diagnostic for Android.

Test: build
Bug: 72331526
Change-Id: I2020b887fbeb3cd833462e50df835a6cd104920d
2019-08-28 09:48:30 +00:00
Jooyung Han
e65ed7cd67 Remove hashtree from builtin APEXes
Builtin APEXes (/system, ...) don't need hashtree.
So if we remove hashtree from builtin APEXes we can save more space in
/system.

However, this change only affects to the apex bundles which are built
from source, not from prebuilts.
Removing hashtree from prebuilts will be handled in a follow CL.

Bug: 139957269
Test: m
Test: see if /system/apex/*.apex have hashtree
Change-Id: Id755382b2153bf6bbaf2c480f3bbb91b6f62a564
2019-08-28 17:27:27 +09:00
Dan Willemsen
98ab311767 Save deps when asflags contains -xassembler-with-cpp
Usually, ".S" files are processes with the c preprocessor, and ".s"
files are not, so they don't have any dependency information, since it
is generated by the preprocessor.

But with the -xassembler-with-cpp flag, ".s" files are processed with
the preprocessor, so we should ask for dependency information from them.

Test: NINJA_ARGS="-t deps out/soong/.intermediates/external/sonivox/arm-wt-22k/libsonivox/android_arm_armv7-a-neon_core_static/obj/external/sonivox/arm-wt-22k/lib_src/ARM-E_filter_gnu.o" m
Test: treehugger
Change-Id: Iee7baeebc2b205b5a2f33e7c1705ea4a5b4fc95a
2019-08-27 21:20:40 -07:00
Dan Willemsen
5d980c878d Disallow __DATE__/__TIME__ on host builds
Instead of just making this an error when building for the device, also
turn on this error for host builds. This is more important as we begin
to use remote caches during the build.

Test: treehugger
Change-Id: I6fcc945464032d951729aead540ea77850c88c41
2019-08-27 19:37:10 -07:00
Treehugger Robot
13f873cefc Merge "Add no_apex check for static library" 2019-08-28 01:48:28 +00:00
Elliott Hughes
f1ff226cd4 Switch most of the darwin tools to toybox.
Bug: http://b/139450866
Test: treehugger
Test: "works for me on my machine" (last week)
Change-Id: I5dd00e6fda134b06967651007afb7565ce4f9e24
2019-08-27 15:17:32 -07:00
Treehugger Robot
80f8d8cd2d Merge "Add docs.zip output tag to droiddoc" 2019-08-27 15:28:26 +00:00
Tom Cherry
e12019c434 Merge "Remove setting _USING_LIBCXX" 2019-08-27 15:10:27 +00:00
Roland Levillain
935639d70f Add an output file type for flattened APEXes.
Allow modules to depend on the flattened flavor of an APEX package
using `module.{flattened}` (returning the output install path of the
flattened APEX).

Also add this flattened output install path as an implicit output
dependency of a flattened APEX phony module.

Test: m checkbuild
Bug: 139277987
Change-Id: I8c55d5ff2922a36fcc8ec0819fbe3e93a772ef8a
Merged-In: I8c55d5ff2922a36fcc8ec0819fbe3e93a772ef8a
2019-08-27 14:26:18 +01:00
Roland Levillain
2879d41a98 Allow modules to be enabled/disabled depending on whether APEXes are flattened.
Allow the `enabled` Soong/Blueprint property (e.g. in `genrule` and
`cc_prebuilt_binary` module definitions) to have a different value
when APEX flattening is enabled.

Test: m checkbuild
Bug: 139277987
Change-Id: Ic586bdfac7690077445da12543154381d92cf98e
Merged-In: Ic586bdfac7690077445da12543154381d92cf98e
2019-08-27 14:25:59 +01:00
Sundong Ahn
2db7f46d0c Add no_apex check for static library
If no_apex module is static library, this module is not included to
filesInfo. So add a check tat the static library is no_apex among
indirect dependencies.

Bug: 139016109
Test: m -j
Change-Id: I46ddf099715aea0e088027a1141e282969cef0e1
2019-08-27 19:06:49 +09:00
Treehugger Robot
2569cc5026 Merge "We have md5sum/sha1sum/sha256sum/sha512sum on Darwin now too." 2019-08-27 03:17:07 +00:00
Treehugger Robot
309b9c02a5 Merge "Implement sysprop_library API stability check" 2019-08-27 00:44:34 +00:00
Jiyong Park
0f60062cb5 Merge "Remove srcs_lib_whitelist_dirs" 2019-08-27 00:30:06 +00:00
Treehugger Robot
308e247a27 Merge "Add $ANDROID_PRODUCT_OUT/apex to installclean." 2019-08-26 23:35:35 +00:00
Jaewoong Jung
a436b1ae86 Merge "Add default_dev_cert to android_app_import" 2019-08-26 19:58:50 +00:00
Steven Moreland
0aabb11dd4 Add $ANDROID_PRODUCT_OUT/apex to installclean.
When removing dependencies from APEXes, the lib files were still there
even after installclean.

Bug: 139016109
Test: run installclean, see apex directories go away :D
Change-Id: I4dad8e3aa0042cdd5bbb76bd6fdd01b025b98495
2019-08-26 18:35:55 +00:00