Commit graph

32831 commits

Author SHA1 Message Date
Colin Cross
cbce0b0dbd Add android_test_helper_app properties to java_defaults
Allows android_test_helper_apps to get their test_suites and
auto_gen_config properties from a java_defaults module.

Fixes: 179744452
Test: m checkbuild
Change-Id: Ifa09f9fd0a51d3a9682401e4c6bd2f82cd4f1b8a
2021-02-09 10:38:30 -08:00
Christopher Parsons
81314ff2e6 Merge "Set platform and toolchain flags to canonicalized for cquery/aquery" 2021-02-09 16:47:30 +00:00
Treehugger Robot
6f833664f0 Merge "Add sh_binary support to bp2build converter." 2021-02-09 16:29:55 +00:00
Jose Galmes
4c6895e5a3 Implement directed recovery snapshot.
Bug: 177451657
Test: m -j nothing
Change-Id: I0b84c34fb2e9e9340d9f9e7405428cd2cc4d43b5
2021-02-09 08:25:34 -08:00
Lev Proleev
3ddf9a8697 Add NNAPI AIDL interface to allowed deps
Bug: 172922059
Test: build
Change-Id: I5e0dce33d1090e548a7d9901ffe747439c11df29
Merged-In: I5e0dce33d1090e548a7d9901ffe747439c11df29
(cherry picked from commit e693333507)
2021-02-09 15:26:12 +00:00
Paul Duffin
937c91c406 Merge "Move hiddenapi tools used by build/soong from frameworks/base" 2021-02-09 15:17:42 +00:00
Paul Duffin
320e170675 Merge "Allow dex jars from prebuilt_apex to be used by hiddenapi" 2021-02-09 13:58:12 +00:00
Paul Duffin
b71a8de0d5 Merge "Refactor the hiddenAPI() method for reusability" 2021-02-09 13:57:52 +00:00
Paul Duffin
abe1abd224 Merge "Extract initHiddenAPI() from hiddenapi()" 2021-02-09 13:57:37 +00:00
Ivan Lozano
4ccfcc2ee4 Merge "rust: Add rust_ffi_static vendor ramdisk Support" 2021-02-09 13:49:28 +00:00
Rupert Shuttleworth
a1a56e8f82 Add sh_binary support to bp2build converter.
Test: Added a unit test in this CL.
Change-Id: I6e9b3c833a257414daf82e603b733e459535d206
2021-02-09 11:53:00 +00:00
Paul Duffin
fdada68320 Move hiddenapi tools used by build/soong from frameworks/base
Also, creates a python_binary_host module for generate_hiddenapi_lists
and uses that when constructing the build rule rather than using the
file directly.

Bug: 177317659
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
Change-Id: Ia11bb203ce5a74740d35f1b7e86716e15aad336e
2021-02-09 10:46:36 +00:00
Jingwen Chen
bb483cbcf5 bp2build: rename generated files to BUILD
The checked in files are named BUILD.bazel, while bp2build files are
named BUILD.

Test: GENERATE_BAZEL_FILES=true m nothing
Change-Id: If226f581b5075088f774dc4f5f9ee88259821835
2021-02-09 04:26:18 +00:00
Chris Parsons
ee423b04b4 Set platform and toolchain flags to canonicalized for cquery/aquery
Test: USE_BAZEL=1 USE_BAZEL_ANALYSIS=1 m libc
Change-Id: If9194d5e00d4d53a3c012ea2d602f0b8e73213c7
2021-02-08 23:06:05 -05:00
Treehugger Robot
198158b9f7 Merge "bp2build: refactor BazelTargetModule naming boilerplate." 2021-02-09 03:21:44 +00:00
Treehugger Robot
d85d058820 Merge "Pass list of module libraries to gen_ndk_backed_by_apex.sh" 2021-02-09 03:21:36 +00:00
Colin Cross
69f0a24762 Pass list of module libraries to gen_ndk_backed_by_apex.sh
Running find on the entire module directory can lead to flaky failures
when a directory is modified by another rule while find is traversing
it.  Pass a list of libraries in the module into the script instead
of finding them on disk.

Fixes: 178509901
Test: TARGET_BUILD_APPS=com.android.runtime dist
Change-Id: Ie4bf288f0e3d99cbbed5ca8770687a9bbe5377e4
2021-02-08 16:52:07 -08:00
Jingwen Chen
ff8f1ce7d7 Merge "bp2build: make generated BUILD files publicly visible." 2021-02-09 00:38:03 +00:00
Treehugger Robot
ed7bfd9726 Merge "Turn missing jarjar output files into errors" 2021-02-08 23:47:13 +00:00
Treehugger Robot
3b9b0a11e9 Merge "Remove Use_lmkd_stats_log from product variables" 2021-02-08 20:58:19 +00:00
Bill Peckham
5c2406bde9 Merge "Enable android_app_import to supply framework-res." 2021-02-08 19:15:10 +00:00
Paul Duffin
9d67ca6ab7 Allow dex jars from prebuilt_apex to be used by hiddenapi
Invokes hiddenAPIExtractInformation() on the dex jar provided by the
deapexer (on behalf of prebuilt_apex) so that hiddenAPI can extract the
information it needs, if anything, from the dex file (and accompanying
classes implementation file).

The dex file provided by deapexer has already had the hiddenapi
information encoded into it so it does not need to do that again.

This change adds the primary parameter to hiddenAPIExtractInformation()
and checks it (and also the hiddenAPI.active property) before it does
anything. That ensures that it behaves correctly when called directly
as well as when called from hiddenAPIExtractAndEncode().

Bug: 178361284
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
      Also verified that the hiddenapi files created when using the
      prebuilts (using SOONG_CONFIG_art_module_source_build=false) are
      the same as when using the source. There is a slight difference
      in the order but otherwise identical.
Change-Id: I7abb63fd310bb94787ab7f4821e5fd283dc03046
2021-02-08 19:10:50 +00:00
Paul Duffin
4fd997bc13 Refactor the hiddenAPI() method for reusability
A follow up change needs to be able to contribute to the information
the hiddenapi process collates without having a dex file encoded. This
change pushes all the functionality related to information gathering
into the hiddenAPIGenerateCSV() method and then renames it and the
hiddenAPI() method to make it clearer what they do.

Bug: 178361284
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
Change-Id: I04417720216a0fbadcd88e6185e7de6570af6216
2021-02-08 19:10:50 +00:00
Paul Duffin
4103e92c4b Extract initHiddenAPI() from hiddenapi()
Previously, the hiddenapi() method combined both checks to determine
whether a module contributed to/was modified by the hiddenapi process
and logic to create ninja rules to perform those tasks. This change
separates the former out into a new initHiddenAPI() method.

The main purpose of this is to simplify the process of allowing the
CSV generation to be separated from the encoding. That is required
because when a java_import retrieves its dex file from the apex it
has already been encoded.

The initHiddenAPI() method is only called for java.Library (and
indirectly for java.SdkLibrary) and java.Import modules which means
that the hiddenapi() method does nothing for any other module type.
That is consistent with the previous behaviour because while the
hiddenapi() method is called for other module types they fail because
the boot image jars only support java_library, java_sdk_library,
and java_import at the moment. While it will need to support
java_sdk_library_import once any of the libraries that are currently
provided as java_sdk_library modules switches to providing prebuilts
that is outside the scope of this work.

Bug: 178361284
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
Change-Id: Iaa91e0a8e2bffec03296dd894e9662556f4464c0
2021-02-08 19:10:50 +00:00
Paul Duffin
5d0572b7eb Merge "Integrate hiddenapi processing into boot jars test" 2021-02-08 18:43:10 +00:00
Paul Duffin
1a75902832 Merge "Exclude exported_java_libs dependencies from visibility checks" 2021-02-08 18:40:46 +00:00
Treehugger Robot
c6fcf29872 Merge "Remove duplicate entries from hiddenapi files" 2021-02-08 18:16:38 +00:00
Treehugger Robot
41905bf733 Merge "bp2build: add bazel_module: { bp2build_available } prop." 2021-02-08 18:14:20 +00:00
Colin Cross
d97cf63cdf Turn missing jarjar output files into errors
Jarjar doesn't exit with a nonzero return code when there is a syntax
error in a rules file and doesn't write the output file.  Without a
nonzero return code ninja prints a warning but continues, which leads
to stale results on incremental builds where the output file already
exists, or delayed errors on clean builds whre the output file didn't
exist.

Delete the output file before running jarjar, and then check if it
exists after running jarjar.

Fixes: 119516143
Test: m out/target/common/obj/APPS/TeleService_intermediates/classes.jar
Change-Id: I7e9f7ff34de565a986ab0dc6e375f606c91c3846
2021-02-08 10:14:04 -08:00
Jingwen Chen
033bfa6e29 Merge "queryview: blocklist package module type." 2021-02-08 15:18:19 +00:00
Ivan Lozano
e6d3098c1b rust: Add rust_ffi_static vendor ramdisk Support
Similar to our vendor support, this adds support for linking rust static
libraries to vendor ramdisk cc modules.

A bug fix is also included where a restriction against setting rust_ffi
vendor-specific was not being enforced.

Bug: 179397942
Test: Example modules link, Soong tests pass.
Change-Id: I737cdf0c2f49ab349bcea2a0429e6298ebc1313e
2021-02-08 09:36:26 -05:00
Jingwen Chen
1a0485b34e Merge "bp2build: Refactor CreateBazelTargetModule API." 2021-02-08 14:08:05 +00:00
Paul Duffin
a7139425bc Exclude exported_java_libs dependencies from visibility checks
Test: m nothing
Change-Id: Iba45580c0711d48034898e9d42832c7e2b0e6284
2021-02-08 13:13:02 +00:00
Ioannis Ilkos
09ab9b4679 Remove Use_lmkd_stats_log from product variables
Use_lmkd_stats_log used to control LMKD_LOG_STATS when compiling lmkd.

However, for newer Android releases, we mandate that lmkd informs statsd of process kills (change id I8cb123b9488fbc6e88863c2f0e75f1422bcd282e)
After aosp/1555318 we compile lmkd with statsd by default, so this setting is a noop.

Change-Id: Ibcf661e205b3ed2a4a520a42952aaece503e9350
Test: build
Bug: 177985094
2021-02-08 11:18:51 +00:00
Jingwen Chen
fb4692a743 bp2build: refactor BazelTargetModule naming boilerplate.
This CL replaces the "__bp2build__" name prefix boilerplate with a props
creation function, and centralizes the prefixing in there.

Test: TH
Test: soong tests
Change-Id: Ic963199ab60dcce0d3361abff111cfa9acd4c21b
2021-02-08 04:10:18 -05:00
Jingwen Chen
96af35bec6 queryview: blocklist package module type.
The package module type was recently introduced, and its module name is
the full package path. queryview uses the module name as the eventual
target name in the generated BUILD files, so this causes a crash as seen
in b/179605762.

Workaround this by not generating package modules in the queryview
directory.

Test: m queryview && bazel query --config=queryview //...
Fixes: 179605762
Change-Id: Iac2bd79d02bec47d6271583d106c184fb2f16e68
2021-02-08 00:49:32 -05:00
Paul Duffin
89886cbdb0 Ensure subtest failures are reported on subtest
A subtest (code inside the func passed to t.Run(...)) are passed their
own t *Testing pointer to use to report errors in order to ensure that
they are treated as errors of the subtest and not the containing test.

This change ensures that the subtests in the following tests use the
correct t *Testing.
* TestPrebuiltExportDexImplementationJars
* TestBootDexJarsFromSourcesAndPrebuilts

Bug: 178361284
Test: m nothing
Change-Id: I4e8b166051cb6098c89d8e68a450c81a714f7677
2021-02-07 10:58:24 +00:00
Paul Duffin
f38931c287 Integrate hiddenapi processing into boot jars test
This change registers the hiddenapi singleton so that hiddenapi
processing is performed as part of
TestBootDexJarsFromSourcesAndPrebuilts so that additional hiddenapi
related tests can be added later.

The hiddenapi singleton uses the BootJars/UpdatableBootJars properties
from productVariables not the dexpreopt.GlobalConfig so this change
makes sure that they are consistent.

Performing hiddenapi processing causes the dex file used in "prebuilt
with source apex preferred" test to be encoded with hiddenapi
information which changes the path in the test.

Bug: 178361284
Test: m nothing
Change-Id: I2eb3d8cf11f6fb3bf4a34d6e4ae0c397c890191e
2021-02-07 10:58:24 +00:00
Paul Duffin
219b177279 Remove duplicate entries from hiddenapi files
Prevents the hiddenapi files index and metadata files from including
duplicate entries.

Bug: 178361284
Test: m droid
      Compared hiddenapi files before and after change
      Verified that the only differences were due to the removal of duplicates
      Used sort -u to remove duplicates from before file and compared with after file
Change-Id: I0b9e420aec42cdcf4584099a7ffd2ed9c3715d6d
2021-02-07 10:58:24 +00:00
Paul Duffin
01289a2407 Add test for hiddenAPI index file generation
The index file and the metadata file both currently include duplicate
entries due to them including both the <x> and <x>.impl libraries
created by java_sdk_library in their inputs, plus including both source
and prebuilt versions of the same named module. This change adds a test
to illustrate that behavior. A follow up change will correct the problem
and update the test accordingly.

This change only adds a test for the index file because the metadata
file depends on files from frameworks/base which makes it difficult to
test. Bug 177317659 will fix that and allow the metadata file
generation to be tested too.

Bug: 178361284
Test: m nothing
Change-Id: I33921d7267c9f4bb42726343d73f8a396d536aaa
2021-02-07 10:58:24 +00:00
Paul Duffin
254aee4843 Merge changes I9e94662d,I4b4e0dc8
* changes:
  Export implementation class jars for java_boot_libs
  Improve module filtering in hiddenapi stubFlagsRule()
2021-02-07 10:52:01 +00:00
Ivan Lozano
a707092636 Merge "rust: Only pass "-lstatic" for rlibs." 2021-02-06 04:47:03 +00:00
Bob Badour
02040de891 Add LOCAL_LICENSE_KINDS to build/soong
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  android/Android.bp
  android/soongconfig/Android.bp
  androidmk/Android.bp
  apex/Android.bp
  bazel/Android.bp
  bp2build/Android.bp
  bpf/Android.bp
  bpfix/Android.bp
  cc/Android.bp
  cc/config/Android.bp
  cc/libbuildversion/Android.bp
  cc/libbuildversion/tests/Android.bp
  cc/ndk_api_coverage_parser/Android.bp
  cc/ndkstubgen/Android.bp
  cc/symbolfile/Android.bp
  cmd/dep_fixer/Android.bp
  cmd/diff_target_files/Android.bp
  cmd/extract_apks/Android.bp
  cmd/extract_jar_packages/Android.bp
  cmd/extract_linker/Android.bp
  cmd/fileslist/Android.bp
  cmd/host_bionic_inject/Android.bp
  cmd/javac_wrapper/Android.bp
  cmd/merge_zips/Android.bp
  cmd/multiproduct_kati/Android.bp
  cmd/path_interposer/Android.bp
  cmd/pom2bp/Android.bp
  cmd/pom2mk/Android.bp
  cmd/sbox/Android.bp
  cmd/soong_build/Android.bp
  cmd/soong_env/Android.bp
  cmd/soong_ui/Android.bp
  cmd/zip2zip/Android.bp
  cmd/zipsync/Android.bp
  cuj/Android.bp
  dexpreopt/Android.bp
  dexpreopt/dexpreopt_gen/Android.bp
  env/Android.bp
  etc/Android.bp
  filesystem/Android.bp
  finder/Android.bp
  finder/cmd/Android.bp
  genrule/Android.bp
  jar/Android.bp
  java/Android.bp
  java/config/Android.bp
  kernel/Android.bp
  linkerconfig/Android.bp
  linkerconfig/proto/Android.bp
  makedeps/Android.bp
  partner/Android.bp
  phony/Android.bp
  python/Android.bp
  python/tests/Android.bp
  remoteexec/Android.bp
  rust/Android.bp
  rust/config/Android.bp
  scripts/Android.bp
  sdk/Android.bp
  sh/Android.bp
  shared/Android.bp
  symbol_inject/Android.bp
  symbol_inject/cmd/Android.bp
  sysprop/Android.bp
  tradefed/Android.bp
  ui/build/Android.bp
  ui/logger/Android.bp
  ui/metrics/Android.bp
  ui/metrics/proc/Android.bp
  ui/status/Android.bp
  ui/terminal/Android.bp
  ui/tracer/Android.bp
  xml/Android.bp
  zip/Android.bp
  zip/cmd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  finder/fs/Android.bp
  third_party/zip/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: Ia47ca14f16b8c9f84f9d533a07e5b00e2c04e8d4
2021-02-06 04:23:21 +00:00
Bob Badour
07065cd360 Allow cross-cutting dependencies like licenses.
Test: m all

Bug: 171227245
Bug: 151953481
Bug: 151177513
Bug: 67772237
Change-Id: I6e8ce01898e174a9587469157485debbb7b96980
2021-02-05 19:59:11 -08:00
Treehugger Robot
b02128ad0b Merge "Remove libbinder_headers from apex_available allowlist" 2021-02-06 03:20:47 +00:00
Jooyung Han
7701309889 Merge "cc: fix version macro for stubs" 2021-02-06 01:41:31 +00:00
Bill Peckham
a036da9b27 Enable android_app_import to supply framework-res.
By enabling an android_app_import module to supply the
special framework-res module, it becomes possible to
create a split build that excludes the source of over
10,000 files under frameworks/base/core/res, replacing
this source with a prebuilt. However, since other parts
of a monolithic build use the source of framework-res,
this scheme works only if your split build manifest
excludes modules that depend on framework-res source.

Bug: 176851898
Test: lunch aosp_arm64-userdebug && m nothing
Test: new TestAndroidAppImportExportPackageResources
Test: local build without prebuilt framework-res
Test: local build with prebuilt framework-res
Change-Id: If00d9dbc656c8406c038448d09f93f767c1e06d1
2021-02-05 14:30:46 -08:00
Colin Cross
d685adb245 Merge "soong_zip: don't glob RSP file entries" 2021-02-05 21:33:37 +00:00
Jose "Pepe" Galmes
c64b961708 Merge "Generate fake versions of modules excluded in directed vendor snapshot." 2021-02-05 17:54:48 +00:00
Jose Galmes
0a942a0368 Generate fake versions of modules excluded in directed vendor snapshot.
When using the directed vendor snapshot, the build fails because soong
fails to find some variants of the modules that have been excluded
from VENDOR_SNAPSHOT_MODULES, even though those modules are not going
to be used by the build.

The solution implemented here is to generate fake versions of those
modules (empty files) and include them in the generated Android.bp,
so that soong finds the modules, even though trying to use them would
fail.

Bug: 171821997
Bug: 179275601

Test: source build/envsetup.sh
Test: m -j nothing

Change-Id: Ibd3e963ab3e5504c0ac817f7cabbd241bf47a5cb
2021-02-05 17:53:53 +00:00