Commit graph

32577 commits

Author SHA1 Message Date
Paul Duffin
1ab6186e91 Switch dex_bootjars to a singleton module
The main difference between a singleton and a singleton module that
affects this change is that the latter requires a module to be defined
in order for the singleton to be instantiated. This change defines the
module in both the tests and the standard build.

Bug: 177892522
Test: m droid
Change-Id: Id6669835cf3a2ab7359fa53047eb9042992a9362
2021-01-21 16:49:34 +00:00
Jiyong Park
1de5a578d2 Merge changes from topic "future_symbol"
* changes:
  API availability should be checked using __builtin_available
  __ANDROID_API__ tracks min_sdk_version
2021-01-21 16:33:05 +00:00
Yo Chiang
d813f12473 Remove GKI artifacts on installclean
Bug: 177495407
Test: m installclean && GKI prebuilts under OUT dir are removed
Change-Id: I05f888376c7f2b253e9966c1a652063a6c4760d9
2021-01-22 00:16:47 +08:00
Paul Duffin
9f04524673 Allow createGlobalSoongConfig() to be used from tests
Previously, the createGlobalSoongConfig() function was explicitly
prevented from being used in tests because it would fail. However, it
turns out that is no longer the case and it does now work.

That allows the following changes to be made:
* Tests no longer need to use GlobalSoongConfigForTests() to
  prepopulate the cache.
* GlobalSoongConfigForTests() is only needed in the dexpreopt
  package.

Bug: 177892522
Test: m nothing
Change-Id: Ifcbb1a44254c5d2d10c1d02ab23227488d1d1ed1
2021-01-21 15:44:30 +00:00
Hyundo Moon
2b7d4e1ba4 Merge "Allow service-media-s in apex" 2021-01-21 15:00:13 +00:00
Treehugger Robot
d684e04247 Merge "LOCAL_REQUIRED_MODULES from apex has ":32" or ":64" suffix" 2021-01-21 14:34:37 +00:00
Paul Duffin
c059c8c9a0 Add java.RegisterRequiredBuildComponentsForTest function
Insulate tests that exercise code in the java package from having to
register the build components provided by the java package by providing
a single function that registers them all. This follows the pattern
currently used in the cc and rust packages.

This change is in preparation for switching the dex_bootjars singleton
from a singleton, which does not require a module definition in order
to be instantiated, to a singleton module which does. That will require
adding a module definition into java.GatherRequiredDepsForTest() and
this change ensures that the required components will have been
registered in every test.

Bug: 177892522
Test: m nothing
Change-Id: I6475db8240894947dd07c89a940a3e4f201aa598
2021-01-21 11:47:32 +00:00
Inseob Kim
ec7cab81f9 Merge "Truncate vendor snapshot header glob list after filtering it" 2021-01-21 06:32:49 +00:00
Hyundo Moon
8bee1b00ea Allow service-media-s in apex
Bug: 175511943
Test: Builds successfully
Change-Id: I5d76087d3c537205e8b8ca837c13ca1aeb641b4c
2021-01-21 02:21:23 +00:00
Colin Cross
3a62a9cc2b Truncate vendor snapshot header glob list after filtering it
Test: m checkbuild
Change-Id: I4847bff5c03844194a9a80e8cb24a60694db6208
2021-01-21 00:46:46 +00:00
Inseob Kim
ab15f9644b Merge "Speed up vendor snapshot header globs" 2021-01-21 00:37:19 +00:00
Jiyong Park
636b767835 Merge changes Ifa1ed8de,I969bf4a2
* changes:
  Sign android_filesystem with avbtool
  Refactor filesystem.go to make it easy to build prop file
2021-01-21 00:21:24 +00:00
Evgenii Stepanov
04896cae35 Support memtag_heap in SANITIZE_TARGET_DIAG, fix cc_test interation.
cc_test without sanitize:memtag_heap acts as if it has implicit
sanitize{memtag_heap:true, diag:{memtag_heap:true}}. This is unaffected
by SANITIZE_TARGET.

Refactor the test to cover all permutations.

Change memtag include lists to act similar to SANITIZE_TARGET_DIAG: the
the sync include list upgrades async targets to sync, unless diag is
explicitly set to false in the target definition.

Bug: b/135772972
Test: cc_test.go

Change-Id: I6a969f2f5804cd5f47fc4e93a20e3b99ea5fa111
2021-01-20 22:27:45 +00:00
Colin Cross
0cec312660 Move reflect.ValueOf out of product variable loop
Calling reflect.ValueOf for every variable for every module was
using ~3 seconds of CPU time on my AOSP builds.

Test: m checkbuild
Change-Id: Idf459ad8ddf5e07f6c0df0e58e2442aaa6ab3342
2021-01-20 19:32:42 +00:00
Anton Hansson
e77fccc959 Add a better error message for missing api files
Add some instructions for what to do.

Bug: 177806245
Test: m nothing (with java_sdk_library with no tracking files)
Change-Id: I286018f4d9105d5ade1e76cddb8670d0d097d77d
2021-01-20 19:21:16 +00:00
Colin Cross
0f93e5b9fb Speed up vendor snapshot header globs
The vendor snapshot header globs were repeated 9 times, once for each
possible header suffix.  Globbing is not a fast operation, so this
took 9.68s of CPU time in my AOSP builds.  Replace it instead with a
single glob, followed by filtering down to the desired header
extensions.

Test: m checkbuild
Change-Id: I9c8f8cdad8cbffc0a42217659a48dd9d676e4e4c
2021-01-20 18:36:25 +00:00
Colin Cross
08117deab4 Fix mismatch between cc and python for windows prefer32
Windows prefer32 was implemented in cc, which caused a mismatch
between cc and other packages like python.  This manifested as
missing variant when a python_test_host with compile_multilib: "first"
tried to depend on a cc_binary_host, which implicitly has multilib
"first".

Fixes: 177904375
Test: m checkbuild
Change-Id: Iaaac16ae171c06d90d04d7cac11789d3f39b8d99
2021-01-20 10:26:00 -08:00
Nicolas Geoffray
324234bd00 Merge "dexpreopt: Use the dirty-image-objects path from frameworks/base." 2021-01-20 18:13:20 +00:00
Cindy Zhou
0ae13ec307 Merge "Build against cfi supported coverage lib" 2021-01-20 18:08:30 +00:00
Colin Cross
bdeafb93fd Merge "Don't create SDK variants for native bridge modules" 2021-01-20 17:49:36 +00:00
Ulyana Trafimovich
0caabb6e27 Merge "Support building boot images with disabled dexpreopt." 2021-01-20 17:46:02 +00:00
Bill Peckham
1c8e5e817e Merge changes from topic "prebuilt-hiddenapi"
* changes:
  Supply LOCAL_SOONG_DEX_JAR for java_import with compile_dex.
  Enable an apex to include a java_import.
  Enable prebuilt hiddenapi CSV files.
2021-01-20 17:43:48 +00:00
Christopher Parsons
965561ce43 Merge "avoid error if bazel intermediates dir already exists" 2021-01-20 17:41:18 +00:00
Nicolas Geoffray
1086e604b9 dexpreopt: Use the dirty-image-objects path from frameworks/base.
Test: m
Bug: 176171716
Change-Id: Ifbc08ae03e2b1bec7161948970bd197386e3b305
2021-01-20 14:31:32 +00:00
Mohammad Islam
43c2fe1620 Merge "Fix capex build rule when building using RBE" 2021-01-20 14:21:17 +00:00
Ulya Trafimovich
a4a1c4ee98 Support building boot images with disabled dexpreopt.
Bug: 176171716
Test: build_mainline_modules.sh and ensure that the ART boot image is
    built: `find out -type f -name '*.art'` is nonempty for every arch.
Change-Id: Ibc45581eef2b205c750a30709780cf659ba7cfa1
2021-01-20 14:03:07 +00:00
Jiyong Park
57621b29c4 LOCAL_REQUIRED_MODULES from apex has ":32" or ":64" suffix
Currently, when a module is included in an APEX, the dependencies of the
modules are listed in LOCAL_REQUIRED_MODULES of the APEX. There are two
purposes for this:

1) for native dependencies, they are installed to
$(TARGET_OUT)/apex/<apexname> directories which isn't packaged as an
*.img. However, as a side effect of the installation, their symbol files
are placed under $(TARGET_OUT)/symbols directory to aid debugging.

2) to implement the symlink optimization. When the APEX is not
updatable, the dependencies are not included inside the APEX, but
installed directly to /system partition because the same files might be
used outside of the APEX. The files in the APEX are replaced with
symlinks to the system copy.

So far, the module name like "libfoo" was directly used in
LOCAL_REQUIRED_MODULES. This becomes problematic when only a single arch
variant of the module is used by the APEX. The build system will install
both arch variants to the system partition.

This change fixes the problem by appending ":32" or ":64" suffix
when composing LOCAL_REQUIRED_MODULES.

Bug: N/A
Test: m
Test: Cherry-pick I285c5d1bb9b27265c8589f2588d95eafa324d412 and its
dependencies from internal master. `m nothing` doesn't show the artifact
path requirement error.

Change-Id: I78feae1d5b18f93b0f984d3b1558812fd1689a96
2021-01-20 20:44:35 +09:00
Bowgo Tsai
ae205c3e32 Moving $OUT/vendor-ramdisk-debug.cpio.lz4 to intermediate dir
Therefore, no need to remove vendor-ramdisk-debug.cpio.lz4
for installclean as it will not be installed to $OUT dir.

Bug: None
Test: make vendorbootimage_debug
Change-Id: Ib7fb9931c55a9bb24e5ca8c4a80bd72f7233c57f
2021-01-20 16:35:31 +08:00
Chih-Hung Hsieh
04f8d379e6 Add clang-analyzer check if selected.
* WITH_TIDY=1 should not include clang-analyzer-* checks
  because they are too slow.
* Nightly builds will use both WITH_TIDY=1 and
  CLANG_ANALYZER_CHECKS=1.

Bug: 173736193
Test: make with WITH_TIDY=1 and CLANG_ANALYZER_CHECKS=1
Change-Id: I3885fd0e20475ceee5e3798bffc11a61994ac113
2021-01-19 19:21:39 -08:00
Inseob Kim
9bd66d1537 Merge "Implement directed vendor snapshot" 2021-01-20 01:17:25 +00:00
Inseob Kim
4c4de0edc3 Merge "Refine sysprop_library header rules" 2021-01-20 01:17:22 +00:00
Ryan Prichard
809eac3057 Merge "Switch platform EH unwinder to prebuilt LLVM libunwind" 2021-01-20 00:10:59 +00:00
JaeMan Park
cdbbb1ea68 Merge "Make TestJavaSdkLibraryEnforce faster" 2021-01-20 00:00:54 +00:00
Jiyong Park
71baa7690a Sign android_filesystem with avbtool
Use_avb and other avb_* properties allows us to sign an
android_filesystem module with avbtool.

Bug: 172415113
Test: m

Change-Id: Ifa1ed8ded1b10170aaca9b34e6a14f0179dbab5d
2021-01-20 08:39:54 +09:00
Jiyong Park
7267831086 Refactor filesystem.go to make it easy to build prop file
The creation of the prop file is refactored to a function.

Bug: 172415113
Test: m

Change-Id: I969bf4a2476f7a4aa9571945d3645d7af52ff09a
2021-01-20 08:35:52 +09:00
Colin Cross
94e347e6a5 Don't create SDK variants for native bridge modules
Native bridge modules never need to build against NDK stubs, so
don't create SDK variants.  Also clear the sdk_version property
for modules that don't have SDK variants so that later code doesn't
use it to trigger SDK behaviors.

Test: m checkbuild
Change-Id: I1920fa82e9fab06235f01a62624382efa16cc6e3
2021-01-19 15:00:45 -08:00
Chris Parsons
07c1e4aba1 avoid error if bazel intermediates dir already exists
Previously, the build failed if the directory already existed,
so mixed builds had to be null builds.

Test: lunch aosp_flame && USE_BAZEL=1 USE_BAZEL_ANAYSIS=1 m libc &&
  USE_BAZEL=1 USE_ANALYSIS=1 m libc
Change-Id: I167cb82b3e47e9388a1ebca7daffe45f91474125
2021-01-19 17:19:16 -05:00
Chris Parsons
943f243bc2 Support aquery depsets with depth
In Bazel aquery responses, Bazel represents action inputs by preserving
the form of the depset data structure which contains them.
(https://docs.bazel.build/versions/master/skylark/lib/depset.html)
Thus, Soong's aquery handler must appropriately "flatten" this
data structure in cases where the depset consists of multiple levels.

Test: m nothing
Test: lunch aosp_flame && USE_BAZEL_ANALYSIS=1 m libc
Change-Id: I2ebacac1deea7538eb34ad1975594caae71091a2
2021-01-19 21:50:32 +00:00
Bill Peckham
fb04df4d57 Supply LOCAL_SOONG_DEX_JAR for java_import with compile_dex.
Without LOCAL_SOONG_DEX_JAR, ninja fails with a missing
dependency error.

Test: m nothing
Test: new TestImportSoongDexJar
Bug: 173705556
Change-Id: I54a4c6ea93877667a3fb97f8b2621c42e431f577
2021-01-19 18:15:16 +00:00
Bill Peckham
a41a6963b4 Enable an apex to include a java_import.
With the addition of the compile_dex property to the
java_import module it becomes possible to include a
java_import module in an apex. This change allows the
dependency and adds a test.

Bug: 177228901
Test: m nothing
Test: new TestApexWithJavaImport
Change-Id: I9336dade1857109e2fd21f7d57e1dc4abc4a402c
2021-01-19 18:15:03 +00:00
Bill Peckham
bae4749de2 Enable prebuilt hiddenapi CSV files.
By enabling these hiddenapi CSV files to be prebuilt, it
becomes possible to create a split build that supports
the hiddenapi encode dex step, but doesn't contain all
of the java sources needed to generate the CSV files.

Bug: 175048716
Test: m nothing
Test: new TestHiddenAPISingletonWithPrebuiltCsvFile
Test: local build without prebuilt hiddenapi
Test: local build with prebuilt hiddenapi
Change-Id: I805ea3ec05860d2df211a3985ec025bf36f0d775
2021-01-19 10:07:45 -08:00
Treehugger Robot
de1357378b Merge "Implement code-generation step for bp2build." 2021-01-19 17:41:59 +00:00
Jingwen Chen
daa54bcbba Implement code-generation step for bp2build.
Implement bp2build codegen as a discrete step that runs after an
alternatively registered pipeline of mutators, instead of a
presingleton.

bp2build codegen requires a Context that supports VisitAllModules and
PathContext, so this CL also makes a BpToBuildWrapperContext that
conforms to PathContext by adding two method implementations.

Test: GENERATE_BAZEL_FILES=true m nothing && bazel query //... --config=bp2build | wc -l # 31433
Test: m queryview && bazel query //... --config=queryview # 63638

Change-Id: I0dd359746584b228046d2d0ff00895f28f9bdfc3
2021-01-19 11:03:36 -05:00
Christopher Parsons
ad3421aacf Merge "Improve aquery-related validation and error handling" 2021-01-19 14:59:51 +00:00
Paul Duffin
fe6147eb26 Merge "Export dex implementation jars from prebuilt_apex" 2021-01-19 14:34:29 +00:00
Treehugger Robot
0e3aaa47aa Merge "Remove unused parameter to newContext." 2021-01-19 13:10:28 +00:00
Mohammad Samiul Islam
9ac0e32979 Fix capex build rule when building using RBE
Presubmit builds were failing cause they were being built using RBE.

Bug: 172911362
Test: presubmit-builds are passing now
Change-Id: I65ffd912ccf2f4fb8cb9824e7a9579f66908d7b3
2021-01-19 11:32:29 +00:00
Inseob Kim
f61dfa5a02 Merge "Allow sysprop library API files to be missing" 2021-01-19 11:24:12 +00:00
Jingwen Chen
09b609d476 Remove unused parameter to newContext.
Test: TH, soong bootstrap tests
Change-Id: Ia7c0fdc2b5d784ef6b389858dab2fcbad35a3763
2021-01-19 04:55:02 -05:00
Inseob Kim
7cf1465d2e Implement directed vendor snapshot
Vendors can now generate only needed modules by setting the following
Makefile variables:

- DIRECTED_VENDOR_SNAPSHOT: set to true
- VENDOR_SNAPSHOT_MODULES: list of snapshot candidates

e.g.

DIRECTED_VENDOR_SNAPSHOT := true
VENDOR_SNAPSHOT_MODULES := toybox_vendor sh_vendor libbase libcutils ...

Bug: 157967325
Test: m dist vendor-snapshot after setting those in BoardConfig.mk
Change-Id: I6515a43d9358d94483d7c7fa2b066f9dd457f6aa
2021-01-18 20:08:09 +09:00