Commit graph

45903 commits

Author SHA1 Message Date
Benjamin Brittain
9edc375a06 Add support for Rust JNI Libraries
Test: Verified Rust JNI lib is in apex

Change-Id: Icb013d7b2f4c5d8ec009ea4937185689cc0cac16
2021-11-30 13:38:15 -05:00
Florian Mayer
413da04189 Merge "Enable hwasan use after scope detection." 2021-11-30 18:36:48 +00:00
Colin Cross
a8077126e8 Support response file inputs in build_license_metadata
Soong can produce very large lists of dependencies that exceed the
command line length limit when calling build_license_metadata.  Add
support for reading arguments from a response file.

Bug: 207445310
Test: m
Change-Id: I6b68e3a7468e797cfbe53ff5d9da2ec9badb000f
2021-11-30 08:08:03 -08:00
Christopher Parsons
93c3cb69bc Merge "bp2build implementation for c_std" 2021-11-30 15:50:31 +00:00
Jiakai Zhang
cee9e19a51 Add entries for STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pb
This CL updates platform_systemserverclasspath,
systemserverclasspath_fragment, and
prebuilt_systemserverclasspath_fragment to write entries for
STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pb. A new property
`standalone_contents` is aded to `systemserverclasspath_fragment` and
`prebuilt_systemserverclasspath_fragment` to list the standalone system
server jars in the APEX, and entries will be written to
systemserverclasspath.pb accordingly at build time.

To add more context, these entries will be consumed by derive_classpath
in order to generate an environment variable
PRODUCT_STANDALONE_SYSTEM_SERVER_JARS. The environment variable will
then be comsumed by odrefresh to determine what jars to preopt on early
boot.

Note that the variable should not end with "CLASSPATH" because the list
is not used by runtime as a classpath. It is just a colon-separated list
of jars. System server loads the jars separately with paths hardcoded in
the code.

Bug: 203198541
Test: manual -
  1. Add some jars to PRODUCT_STANDALONE_SYSTEM_SERVER_JARS
  2. Add some other jars to PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS
     and standalone_contents.
  3. Build an image.
  4. Flash the image to a device.
  5. adb shell echo \$STANDALONE_SYSTEMSERVER_JARS
  6. See the correct list of jars.
Change-Id: I09a6fd1d3db85c194330da9b751702a9bf069e26
2021-11-30 10:51:10 +00:00
Jingwen Chen
d480859cee Move libprotobuf-cpp-full and libprotobuf-cpp-lite to mixed builds denylist.
These libraries can be built by bazel, but not in the target and product
variant as required in mixed builds. See associated TODO for more info.

Bug: 206538317
Bug: 204810610
Bug: 204811222

Test: b build //external/protobuf:all
Change-Id: I45802c682dd40874de6393708d27323152463db6
2021-11-30 02:28:29 +00:00
Chris Parsons
79bd2b7761 bp2build implementation for c_std
Test: mixed_droid in conjunction with topic changes
Change-Id: Ic673c1b269f5082b490b32057eb60f3b73eb0940
2021-11-29 18:38:31 -05:00
Chris Parsons
8a4981617f Unravel much of the bp2build denylist.
This change involves adding a number of packages to the bp2build allowlist,
and subsequently adding several specific modules to the denylist (with reasoning).

The end result is that:
1. It's more clear why certain modules are denylisted, either via their unsupported
   dependencies or unsupported properties.
2. This increases the number of converted targets to 320, up from 284.

Test: mixed_droid.sh
Test: bp2build.sh

Change-Id: I9f50869401455033a191c6c41d3836509afe1071
2021-11-29 12:07:25 -05:00
Sorin Basca
c0244da203 Adding configuration support for Java 11
Bug: 195387073
Test: m
Change-Id: Ibf26f35b83b300acacae800f9962a00916869412
2021-11-26 17:26:33 +00:00
Martin Stjernholm
a3ee4aadce Merge "Fix prebuilt selection logic for cc_prebuilt_library_headers." 2021-11-26 11:19:42 +00:00
Treehugger Robot
fe87ccef2a Merge "Add //build/bazel/examples/soong_config_variables/... to bp2build allowlist." 2021-11-26 07:51:43 +00:00
Treehugger Robot
b0879c843f Merge "Do not pass --compiler-filter=speed-profile with --profile-file." 2021-11-25 20:42:31 +00:00
Treehugger Robot
8a0dd0265b Merge changes Iecf7edd6,Iaca5cf23,I01d57919
* changes:
  Fix attribute names in generated permissions.xml
  Perform validation of shared library attributes
  Add support for new permissions library tag attributes
2021-11-25 12:22:37 +00:00
Sundong Ahn
80c04891de Add Sh_binaries property
The sh_binary module is not supported the vendor variant. So, even if
there is "vendor: true" in sh_binary module, the image variant is
"image:" instead of "image:vendor.Tiramisu".
But the vendor APEX has vendor variant, so vendor APEX module and
sh_binary module have different variants and the sh_binary cannot be
added to vendor apex.
So the Sh_binaries property is added, and the image variant is removed
at DepsMutator.

Bug: 205065320
Test: make -j40 && sh_binary is added to vendor APEX && install check
Change-Id: I30e2d96a73b45e7b06eff24550542cb010008c41
2021-11-25 03:43:57 +00:00
Cole Faust
b3a4ff4fa5 Merge "Change type of Unbundled_build_apps from bool to []string" 2021-11-25 01:06:53 +00:00
Matthew Maurer
0e714da0f3 rust: Ensure unwind tables are generated
Currently, we are depending on a platform default in rustc's
android_base module to keep unwind tables generated. That default was
configured specifically to change the behavior for Firefox profiling
purposes prior to the existence of the override flag. As a result,
there's no structural reason the default will remain as is.

Bug: 193702360
Test: m
Change-Id: Ic5b57d5a31f4e67a66351a3f0efc530c95aa3836
2021-11-24 22:03:25 +00:00
Martin Stjernholm
e65c3aee02 Fix prebuilt selection logic for cc_prebuilt_library_headers.
Unlike other prebuilt modules it doesn't have a srcs property of any
kind, so android.Prebuilt cannot defer to the source module just
because its srcsSupplier would return nil.

Test: m nothing
Bug: 202192894
Change-Id: Iafcf165569bad6eae37820cf71aa0fcacb720e02
2021-11-24 20:48:04 +00:00
Treehugger Robot
a5524e3272 Merge "Rename rbc_product_config.sh to rbc_regression_test.sh" 2021-11-24 18:03:09 +00:00
Pedro Loureiro
ba6682fabf Fix attribute names in generated permissions.xml
Previously it would write min_device_sdk whereas the correct name should
be min-device-sdk. This happened for all shared libs attributes.

Test: m nothing
Test: manually installed an apex with a shared lib and made sure PM used
the attributes as expected

Bug: 191978330

Change-Id: Iecf7edd6bae98c7af908d3f320f10ae4973d0396
Merged-In: Iecf7edd6bae98c7af908d3f320f10ae4973d0396
(cherry picked from commit bde653e5fd)
2021-11-24 17:09:20 +00:00
Pedro Loureiro
c362142438 Perform validation of shared library attributes
Perform consistency checks as per http://go/updatable-shared-libraries

These include:
  * no attribute can specified can be less than T
  * max-device-sdk can't be less than min-device-sdk
  * min and max-device-sdk need to be at least the module's
  min_sdk_version
  * using on-bootclasspath-before implies that the module's
  min_sdk_version is at least T or the library has min-device-sdk of at
  least T

Test: m nothing

Bug: 191978330

Change-Id: Iaca5cf23fb0bc7e65effb3529c8e829560894c2e
Merged-In: Iaca5cf23fb0bc7e65effb3529c8e829560894c2e
(cherry picked from commit f9e584dd20)
2021-11-24 17:09:19 +00:00
Pedro Loureiro
9956e5e281 Add support for new permissions library tag attributes
We are expanding PackageManager's supported attributes and this change
enables the developer to define them in the .bp file.

Test: m nothing

Bug: 191978330

Change-Id: I01d579190fb585662086a7fc456f3b33cb89fb57
Merged-In: I01d579190fb585662086a7fc456f3b33cb89fb57
(cherry picked from commit 826863c8e0)
2021-11-24 17:09:18 +00:00
Usta Shrestha
8c64fa9a8e Merge "Minor refactoring of Append/PrependProperties() methods Test: m nothing and compare ninja file Bug: n/a" 2021-11-24 15:18:37 +00:00
Jingwen Chen
0a9d09f8f4 Add //build/bazel/examples/soong_config_variables/... to bp2build
allowlist.

Test: CI
Bug: 203677881
Change-Id: Id95f272005c356b22b1f24f932cb1ef6c3363d03
2021-11-24 07:00:11 +00:00
Jingwen Chen
4ad40d99b0 Add a mutex for soong config var map writes.
Fixes: 207572723
Test: CI
Change-Id: Ide4ca9961b8615186c3ab703c461b6ef53ef656e
2021-11-24 03:42:35 +00:00
Cole Faust
701ca2545e Change type of Unbundled_build_apps from bool to []string
Unbundled_build_apps is supposed to be a list of apps to
build as unbundled, not just a simple boolean. Change it
to properly reflect what it is, because the starlark
product configuration relies on soong's interpretation
of variables types.

Bug: 201700692
Test: Presubmits
Change-Id: I85d40d58fe519f9f6e5a382b8f3ec9014f990aa1
2021-11-23 19:06:01 -08:00
Cole Faust
fbfd40073d Rename rbc_product_config.sh to rbc_regression_test.sh
Test: Presubmits
Change-Id: I3423b9cc44d972646d89952a310a47147548ddc4
2021-11-23 16:57:16 -08:00
Martin Stjernholm
ae44fd8032 Don't pass ":=" in variable name to AndroidMkEntries.SetString.
Fixes typos in https://r.android.com/1897972.

Test: m SOONG_CONFIG_art_module_source_build=false nothing
Bug: 204136549
Change-Id: I768c21bc99bfb4978fcf7f4f3631eef866e76764
2021-11-23 23:17:33 +00:00
Usta
ef3676c94b Minor refactoring of Append/PrependProperties() methods
Test: `m nothing` and compare ninja file
Bug: n/a

Change-Id: If6e4a0de0a8f4f479fe3cbe044cf50d07648c8d9
2021-11-23 17:31:51 -05:00
Treehugger Robot
b5f81d2a6a Merge "Account for "validations:"" 2021-11-23 22:12:26 +00:00
Cole Faust
b3b28012b9 Merge "Print product vars in board config launcher" 2021-11-23 20:46:45 +00:00
Bob Badour
0174ae3ae0 Account for "validations:"
Change-Id: I72b188c8cac54aa59d31e91b2a03b1329384e686
2021-11-23 12:12:06 -08:00
Sophie Zheng
1469ff6ece Merge "NDK API coverage" 2021-11-23 17:38:08 +00:00
Jingwen Chen
d43d4a4cdf Temporarily disable //system/apex from bp2build due to flaky failures.
Bug: 207466993
Test: CI
Change-Id: Ie8fad3e34113e037271cd9f869babe7630d434ad
2021-11-23 12:41:17 +00:00
Jingwen Chen
01812020c1 Add support for writing all Soong config variables into @soong_injection.
Also remove the need to use bp2build_available on
soong_config_module_types as we want to convert every single of them
into the tree for a complete soong_injection soong_config_variables.bzl
file.

The variables are split into their bool, value and string types
respectively, as they all need to be handled differently on the Bazel
product_platform side, as well as for generating constraint values and
settings. For example, value variables need to integrate with
TemplateVariableInfo, and string variables need to include the string
value itself into the select key/constraint value.

Sample soong_config_variables.bzl file: https://gist.github.com/jin/cef700bfb20c8656a931306dd71d47e1

Test: CI
Bug: 198556411
Change-Id: I8665dd1269a507edb37de62407ed3641564bea5c
2021-11-23 08:37:30 +00:00
Jingwen Chen
58ff6801f4 Fix bp2build select generation for inter-attribute soong config
variable usage.

There's bug a in the current soong_config_variable handling
implementation where a soong_config_variable sets conditions_default
value for an attr, and a non-conditions_default value for another attr.
This results in the former attr not properly setting the zero value for
the non-conditions_default select key, resulting in the pretty printer
omitting the attribute totally.

The current implementation in this CL ensures that the zero value is set
whenever this happens at the module level. This is seen in
library_linking_strategy_cc_defaults (see comments in code, and the new
tests)

Test: CI
Bug: 198556411

Change-Id: Ibaeb94508c51a7429fb7a08df610cbb5470f76d2
2021-11-23 08:37:30 +00:00
Jingwen Chen
228ef1e370 Allowlist //system/apex.
This bp2builds the one cc_binary in that package that uses
library_linking_strategy_cc_defaults. That target is buildable, but
there's still a bp2build_available allowlist bug that causes the select
statements and static_libs deps to not show up for the target (only
dynamic_deps are), due to how bp2build_available is special cased for
soong_config_module_type in the loadhook.

Test: b build //system/apex:library_linking_strategy_sample_binary
Change-Id: Ic38a1bfaa476108db63348d030e196d8561300ca
2021-11-23 08:37:30 +00:00
Jingwen Chen
84817de033 Add support for merging defaults soong_config_module_types into bp2build
select statements.

This supports defaults from the same or different namespaces, and
transitively defaults as well.

Test: soong unit tests
Test: CI
Change-Id: I99435bacfcfbfe20ad753b8021a1779531d7595a
2021-11-23 08:37:30 +00:00
Colin Cross
d5e7af9003 Switch default for InstallBypassMake to true
Enable InstallBypassMake for all module types by switching its default
to true.

Bug: 204136549
Test: m checkbuild
Change-Id: Ied082995e74d71dee6aecea99689ac3f63600d3b
2021-11-22 21:57:36 -08:00
Jack Yu
bc07b0c67e Merge "Support for OMAPI Vendor stable interface" 2021-11-23 04:54:02 +00:00
Jooyung Han
4a8f41081e Set min_sdk_version (system/core)
Many modules requiring min_sdk_version have been used without setting
it, but hard-coded in allowlist.

Bug: 158059172
Test: m
Change-Id: Ibb09ddfdb11df0791a28eb8a0a49f1780084fd95
2021-11-23 11:10:38 +09:00
Jooyung Han
9876c5eaab Remove libsync from apex_available allowlist
As libsync is NDK/LLNDK, it doesn't need to be aded to allowlist as
apex_available.

Bug: n/a
Test: m
Change-Id: I16cfb258a24bde4def428f1e6277f5d3c95c228c
2021-11-23 11:06:16 +09:00
Cole Faust
3c1868bbcc Print product vars in board config launcher
Bug: 201700692
Test: ./build/bazel/ci/rbc_regression_test.sh -b aosp_cf_x86_64_phone-userdebug
Change-Id: I1d3f6f13fc662807db2a86d1daffcc81433d82fc
2021-11-22 16:34:11 -08:00
Treehugger Robot
0662933a18 Merge "Set min_sdk_version (packages/modules/adb)" 2021-11-22 23:00:34 +00:00
Treehugger Robot
1125dc5317 Merge "Update rust prebuilt version to 1.56.1p1" 2021-11-22 22:51:02 +00:00
Treehugger Robot
3eb75a72a0 Merge "Revert "Revert "Switch to clang-r437112""" 2021-11-22 22:07:06 +00:00
sophiez
3691097ba9 NDK API coverage
Fixed typo in dist path for backed by.

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only

Change-Id: Ic67c0bd5644dec11829f0dc2535016fec788a067
2021-11-22 11:49:49 -08:00
Martin Stjernholm
9fdd87d7e4 Do not pass --compiler-filter=speed-profile with --profile-file.
It is the default, and hence unnecessary to pass explicitly. This
allows some other compiler filter to be passed through BootFlags.

Test: m out/host/linux-x86/apex/art_boot_images/javalib/x86_64/boot.oat
  on master-art and check that it doesn't change
Test: m droid
  on master and check that
  out/soong/.intermediates/art/build/apex/com.android.art/android_common_com.android.art_image/image.apex/javalib/x86_64/boot.oat
  and out/target/product/vsoc_x86_64/system/framework/x86_64/boot-framework.oat
  are identical.
Bug: 174746397
Change-Id: Ie281e55aaa641d5fd8dcc5c7e201c7870cc934c1
2021-11-22 19:05:17 +00:00
Pirama Arumuga Nainar
1381dceeba Update rust prebuilt version to 1.56.1p1
Respin rust point release 1.56.1p1 with cherry-pick of
https://reviews.llvm.org/D104556 (needed for Rust coverage).

Bug: https://issuetracker.google.com/issues/206980172
Test: m rust
Change-Id: Ib63a7d8128c86ae9291c4f5275726cfc3bc15f48
2021-11-22 09:55:44 -08:00
Colin Cross
ab6db81276 Merge "Move apex module installation into Soong" 2021-11-22 17:29:11 +00:00
Anton Hansson
c5eac1cf47 Merge "Silence unpack-prebuilt-apex" 2021-11-22 16:36:49 +00:00