Commit graph

4019 commits

Author SHA1 Message Date
Yi Kong
b0d167cb43 Merge "addSamplingProfileGatherFlags is no longer needed" 2021-12-07 04:27:14 +00:00
Artur Satayev
a4fc08d204 Merge "Add ModuleWithMinSdkVersionCheck type." 2021-12-06 16:53:28 +00:00
Liz Kammer
85c0097d69 Merge "bp2build: support full/lite protos in cc libs" 2021-12-06 14:46:34 +00:00
satayev
b3fd411465 Add ModuleWithMinSdkVersionCheck type.
This is to help following refactor for individual modules to have their
own version of checking where needed.

For example, apk in apex may want to enforce it's own version of
CheckMinSdkVersion.

Bug: 205923322
Test: presubmit
Change-Id: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
2021-12-06 12:05:48 +00:00
Jingwen Chen
a86cbd4a49 Merge "Allowlist //build/soong/cc/{ndkstubgen,symbolfile}." 2021-12-06 11:36:52 +00:00
Yi Kong
5ded619f3e addSamplingProfileGatherFlags is no longer needed
We already add the "-fdebug-info-for-profiling" flag globally by default.
Besides, Sampling PGO does not need additional target-specific build
flags, unlike instrumentation PGO.

This is preparation to separate out sampling pgo into a separate module.
NFCI.

Test: presubmit
Change-Id: Icb28a98c021a78db25d8cb5ca9694ed6b7367a8d
2021-12-06 08:14:00 +00:00
Jingwen Chen
89e2188d49 Allowlist //build/soong/cc/{ndkstubgen,symbolfile}.
This contains the tool to generate stub libraries.

Bug: 208215661
Bug: 207812332

Test: b run //build/soong/cc/ndkstubgen
Change-Id: Id48d74381457e0a62aca0ed7f8a9367886863bfd
2021-12-03 01:13:40 +00:00
Usta
355a587e38 Removal of unused methods AppendProperties and PrependProperties from topDownMutatorContext
Test: m nothing
Bug: n/a

Change-Id: Ia37d1c9b96c39603964ba8db2ea6ba52d1138472
2021-12-02 15:21:45 -05:00
Liz Kammer
12615dbbca bp2build: support full/lite protos in cc libs
Test: bp2build.sh
Bug: 200601772
Change-Id: I3a7e00546726bc63b5eb8d5604557c5988a5320b
2021-12-02 11:00:46 -05:00
Artur Satayev
fb0a7234d7 Merge changes Ieb9aef29,I6985ebb6
* changes:
  Propagate min and max sdk versions to classpaths.proto configs.
  Introduce max_sdk_version device property.
2021-12-02 14:53:48 +00:00
Artur Satayev
a71eabb705 Merge "Test SdkSpecForm." 2021-12-02 14:49:21 +00:00
Jooyung Han
3d221b302a Merge "Set min_sdk_version (system/core)" 2021-12-02 02:27:20 +00:00
satayev
cca4ab762e Propagate min and max sdk versions to classpaths.proto configs.
These attributed define a range for dessert releases where the jars
should be active, and included in corresponding CLASSPATH varibles by
derive_classpath.

Bug: 190818041
Test: presubmit
Change-Id: Ieb9aef29657ad0694d48a63019f93faca2678252
2021-12-01 17:58:41 +00:00
satayev
0ee2f913ef Test SdkSpecForm.
Bug: 190818041
Test: presubmit
Change-Id: Ib8cd891f03537712d709ed063dd76dee55221118
2021-12-01 17:43:00 +00:00
Jingwen Chen
a358fdb6f3 Merge "Move libprotobuf-cpp-full and libprotobuf-cpp-lite to mixed builds denylist." 2021-12-01 13:32:27 +00:00
Colin Cross
9579f4c05d Merge "Switch default for InstallBypassMake to true" 2021-11-30 20:31:26 +00:00
Christopher Parsons
93c3cb69bc Merge "bp2build implementation for c_std" 2021-11-30 15:50:31 +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
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
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
Cole Faust
b3a4ff4fa5 Merge "Change type of Unbundled_build_apps from bool to []string" 2021-11-25 01:06:53 +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
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
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
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
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
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
4f71e12cc7 Set min_sdk_version (packages/modules/adb)
Many modules requiring min_sdk_version have been used without setting
it, but hard-coded in allowlist.

Bug: 158059172
Test: m
Change-Id: I6d11425f9c5db11cd52dd81f7500e4424555bfb5
2021-11-22 10:20:53 +09:00
Yuntao Xu
ac69c239d1 Merge "Revert^2 "Add seapp_contexts to allowlist of makefile goal"" 2021-11-19 19:24:55 +00:00
Yuntao Xu
feb0756d41 Revert^2 "Add seapp_contexts to allowlist of makefile goal"
e87a81673e

Change-Id: I461f3ecdd0b0ea0a4b7b12531cf8b561e170df55
2021-11-18 22:33:02 +00:00
Vova Sharaienko
e87a81673e Revert "Add seapp_contexts to allowlist of makefile goal"
Revert submission 1795972-Convert security/Android.mk to Android.bp

Reason for revert: http://b/206976319 Broken build 7928060 on aosp-master on sdk_arm64-sdk
Reverted Changes:
I0e0e7f677:Split property and file contexts modules
I5596d6f00:Add seapp_contexts to allowlist of makefile goal
If685e5ccc:Convert security/Android.mk to Android.bp

Change-Id: I8cf8c0bc2f88172bb3bfa850bbd7ce6daa170c3d
2021-11-18 17:29:01 +00:00
Colin Cross
50ed1f9ccb Install android_app_set modules in Soong
Add support for installing extra files from a zip file when installing
a primary file, and use it to support installing android_app_set modules,
which install a primary APK and then an unknown set of additional splits
APKs.

Test: app_set_test.go
Test: install test android_app_set
Bug: 204136549
Change-Id: Ia92f7e5c427adcef3bcf59c82a2f83450905c01d
2021-11-17 19:55:33 -08:00
Liz Kammer
c31929962b Quote aquery commands.
Bazel run shell actions begin `bin/bash -c <command>`, without escaping,
the command can be treated as an argument to `bin/bash`.

Test: build/bazel/mixed_droid.sh
Change-Id: I423cb393da2e6ac97448ec77b2596f12670dfd31
2021-11-16 17:31:05 -05:00
Wei Li
455ba83a94 Fix the output handling of Bazel aquery for py_binary targets so soong's python_binary_host modules can be converted to py_binary and built with Bazel dependent targets in mixed build.
Test: USE_BAZEL_ANALYSIS=1 m genfunctosyscallnrs
Test: USE_BAZEL_ANALYSIS=1 m func_to_syscall_nrs
Test: USE_BAZEL_ANALYSIS=1 m libseccomp_policy
Bug: 201094425
Bug: 197135289
Bug: 204949078
Change-Id: If98630830d687ca814d6ae09c1e610f2c3a371b1
2021-11-16 20:49:28 +00:00
Treehugger Robot
59a5cb072b Merge "Refactor ProductConfigProperties to use a struct key instead of an string key with hardcoded patterns." 2021-11-16 04:55:15 +00:00
Jingwen Chen
25825ca08d Refactor ProductConfigProperties to use a struct key instead of an
string key with hardcoded patterns.

This fixes a bug with label list conditions_default attrs where the
attribute values get clobbered in a map with the keys
"conditions_default" (with a default empty list) and
"acme__feature__conditions_default" (with a non-empty list) when
generating the LabelListAttribute.

Test: CI
Change-Id: I5429e40f747b7a0ed559f8a468a4831cd32df2c0
2021-11-16 02:50:22 +00:00
Ivan Lozano
3e1bc6cc0d Merge "Use new soong_cc_rust_prebuilt.mk" 2021-11-15 22:19:46 +00:00
Rupert Shuttleworth
c0d9f8bd5e Merge "Allow libbuildversion to build with Bazel, but skip its 'tests' subdir for now." 2021-11-15 09:00:12 +00:00
Ivan Lozano
d06cc748c1 Use new soong_cc_rust_prebuilt.mk
soong_{cc,rust}_prebuilt.mk has been merged. Use the new file.

Bug: N/A, clean-up
Test: m
Change-Id: I3f03e866815f6394aacd8cb0deba04f381b78c29
2021-11-12 13:27:58 -05:00
Colin Cross
b5399c84ff Add .PHONY for dist-for-goals targets
Mac builds don't include build/make/core/tasks/general-tests.mk
which causes the general-tests target not to be marked phony.  Have
Soong mark all dist-for-goals targets as phony so it doesn't rely
on other makefiles being present.

Bug: 205928834
Test: forrest
Change-Id: I9394c9c794fc83cde9649aa12a3039526d8206f3
2021-11-12 00:36:58 +00:00
Chris Parsons
393002a913 Remove modules from denylist after host C++ support
Test: mixed_droid
Change-Id: If9b04625b0ad4fce52283eb683f1342e24bb97f2
2021-11-11 13:56:56 -05:00
Chris Parsons
494eef3dc8 Support host platform cc builds
This involves handling of linux-* platforms (identifying them
appropriately as host), disabling unsupported Windows platform, and
denylisting of still-problematic modules.

Test: mixed_droid, with verification that shared library artifacts
originate from bazel-out

Change-Id: Ib52db49a2d2a3c1ff9b76af23fd4f22cfc9182d0
2021-11-10 21:57:15 +00:00
Colin Cross
02ce1e7833 Merge changes Ib3f4ee14,Iac22c9fd,Ibd78758c,I40d8696c,I2a2b10e4, ...
* changes:
  Fix InstallBypassMake symlink dependencies
  Add tests for ctx.InstallFile
  Fix OutDir vs SoongOutDir in tests
  Fix go vet error
  Add missing os.MkdirAll to WriteFileToOutputDir
  Use pathtools.WriteFileIfChanged in translateAndroidMk
2021-11-10 18:49:08 +00:00
Treehugger Robot
8a709b149b Merge changes from topic "soong-java-install"
* changes:
  Revert "Temporarily add method to get java binary tool"
  Move java module installation into Soong
  Fix ctx.InstallFile calls for java modules
  Make HostJavaToolPath use pathForInstall
2021-11-10 17:05:51 +00:00
Rupert Shuttleworth
2ac9c48ee6 Allow libbuildversion to build with Bazel, but skip its 'tests' subdir for now.
Bug: 198241918

Test: build/bazel/scripts/run_presubmits.sh

Change-Id: I9ab423bf8131de855cf0c380cd42e9fd662c7bfb
2021-11-10 11:16:05 -05:00
Colin Cross
64002afc56 Fix InstallBypassMake symlink dependencies
Host symlinks cannot use order-only dependencies because they may be
used as part of the dependency chain on a tool, and an order-only
dependency would cause the target of the symlink not to be updated.
Use regular dependencies instead.

Bug: 204136549
Fixes: 205674000
Test: TestInstallBypassMake
Change-Id: Ib3f4ee143e94d1995ec6c60d314e7c91e57cc775
2021-11-09 17:25:57 -08:00
Colin Cross
6ac9576eef Add tests for ctx.InstallFile
Add tests that cover Soong-only installation as well as installation with
InstallBypassMake.

Bug: 204136549
Test: TestInstall
Test: TestInstallBypassMake
Change-Id: Iac22c9fdf99994e06b419623ee5fa399ef6957fb
2021-11-09 17:25:57 -08:00
Colin Cross
7b6a55f5a2 Fix OutDir vs SoongOutDir in tests
Tests were using the same value for OutDir and SoongOutDir, separate
them to allow a test that needs to distinguish between them.

Test: all soong tests
Change-Id: Ibd78758c133a7f07bead3f51b699052676f92fbd
2021-11-09 17:25:57 -08:00
Colin Cross
d642113643 Add missing os.MkdirAll to WriteFileToOutputDir
Fix tests when out/soong doesn't already exist by adding os.MkdirAll
to WriteFileToOutputDir.

Test: soong tests
Change-Id: I2a2b10e43b967d0c61d0dbe6a3f8bf381babe73c
2021-11-09 17:25:57 -08:00
Colin Cross
836e387323 Use pathtools.WriteFileIfChanged in translateAndroidMk
pathtools.WriteFileIfChanged was reimplemented in translateAndroidMk,
but without a call to os.MkDirsAll.  Reuse pathtools.WriteFileIfChanged.

Test: soong tests
Change-Id: If3f6a7bfc172b4a1a8945109801146c2b7e72b96
2021-11-09 17:25:57 -08:00
Jingwen Chen
8c10020ffd Merge "bp2build: add support for soong_config_module_type." 2021-11-09 06:59:34 +00:00
Jingwen Chen
a47f28d28e bp2build: add support for soong_config_module_type.
Test: CI, go unit test
Bug: 198556411
Change-Id: Idf862904d51d822f92af0c072341c31b7a02fc64
2021-11-08 13:38:28 +00:00
Colin Cross
c899d7808e Revert "Temporarily add method to get java binary tool"
Java binaries and cc binaries are in the same directory again, the
separate method can be removed.

Bug: 204136549
Test: m checkbuild
Change-Id: I2e7ca82448aba5c7e54d3c3c376fe14a953ef4af
2021-11-05 14:26:53 -07:00
Colin Cross
24cc4be60b Move java module installation into Soong
Move java module installation rules into Soong by overriding
InstallBypassMake.  Update the locations that find host java tools
to look in the Make installation directory instead of the Soong
installation directory, which will no longer be used.

Bug: 204136549
Test: m checkbuild
Change-Id: I5af6d764c97e7ddb5ee121fc9830166c25d831b1
2021-11-05 14:24:51 -07:00
Colin Cross
1d0eb7a9d0 Fix ctx.InstallFile calls for java modules
Call ctx.InstallFile on the primary install file last so that the
primary install file can depend on the extra install files, and so that
the primary install file can be inferred from the last installed file.

Add missing ctx.InstallFile calls for the dexpreopt and hostdex outputs.

Fix the install subdirectory for modules installing to the testcases
directory.

Bug: 204136549
Test: m checkbuild
Change-Id: I7edd7647be27439d3ca0ecc589ca5e89d4ba8474
2021-11-05 14:20:28 -07:00
Colin Cross
ae5330a2d9 Make HostJavaToolPath use pathForInstall
Use pathForInstall instead of PathForOutput for HostJavaToolPath
so that it internally produces an InstallPath that can later support
being converted to Make installpath.

Bug: 204136549
Test: m checkbuild
Change-Id: If4f5d3552b27ffe6b9bc709c4a08d9513c49ef7d
2021-11-05 14:20:28 -07:00
Inseob Kim
a92d10bdf2 Add seapp_contexts to allowlist of makefile goal
This is an interim solution before seapp_contexts and seapp_neverallows
are migrated into Soong. CtsSecurityHostTests needs these two modules.

Bug: 194096505
Test: build
Change-Id: I5596d6f00b957afd86c752501c1e83b3d4089d9e
2021-11-05 05:10:26 +00:00
Colin Cross
acfcc1f682 Move cc module installation into Soong
Move cc module installation rules into Soong by overriding
InstallBypassMake.  Update the locations that find host tools
to look in the Make installation directory instead of the Soong
installation directory, which will no longer be used.

The methods that find host tools are also used on go binaries,
so update the config methods that tell Blueprint where to install
go binaries to the Make installation directory too.

Bug: 204136549
Test: m checkbuild
Change-Id: Id172592c195e506102982a4af0084f6d9c68a896
2021-11-04 10:28:58 -07:00
Colin Cross
3e3eda6eb6 Temporarily add method to get java binary tool
cc binaries are moving from out/soong/host/linux-x86/bin to
out/host/linux-86/bin first, to be followed by java binaries.
Temporarily add a method that gets the java binary path while
it is different from the cc binary path.

Bug: 204136549
Test: m checkbuild
Change-Id: I04a7e741436da6be68078f23d074870413a5bb5e
2021-11-04 10:28:58 -07:00
Treehugger Robot
c37663aad9 Merge "Convert .meta_lic files to textproto" 2021-11-03 18:31:02 +00:00
Treehugger Robot
a3bd963988 Merge changes Id11f4fb1,Id573d970,Ia94a0b5c
* changes:
  Fix //conditions:default excludes computation for LabelListAttribute.
  bp2build: split Bazel conversion context into smaller ones, and change TopDownMutatorContext signatures to use Bazel conversion context.
  Add an error check in `bazelPackage` for malformed labels.
2021-11-03 15:36:28 +00:00
Paul Duffin
8380ee66a5 Merge "Use module-lib system modules when building from prebuilts" 2021-11-03 15:32:42 +00:00
Liz Kammer
5506c1658c Merge "Update bp2build denylist cause" 2021-11-03 14:19:16 +00:00
Wei Li
c989eaf4c3 Keep the following targets disabled in mixed build since there are errors in mixed_droid CI after go/oag/1861755 is submitted.
func_to_syscall_nrs
libseccomp_policy_app_zygote_sources
libseccomp_policy_app_sources
libseccomp_policy_system_sources

Test: CI
Bug: 204949078

Change-Id: Iaf9d7cd8831da984bcee82399be138ebe3aab9e8
2021-11-03 04:15:36 +00:00
Liz Kammer
b84b8c9c9a Update bp2build denylist cause
The binary is converted; however, there are still issues with the host
toolchain.

Test: build/bazel/ci/bp2build.sh
Change-Id: Idf864ea6c64c0c7bbbaa0c9d43d6eac5120e0268
2021-11-02 15:03:12 -04:00
Wei Li
664a4fd0af Fix python_binary_host module in mixed build.
Test: USE_BAZEL_ANALYSIS=1 m genfunctosyscallnrs
Test: USE_BAZEL_ANALYSIS=1 m func_to_syscall_nrs
Test: USE_BAZEL_ANALYSIS=1 m libseccomp_policy
Bug: 201094425, 197135289

Change-Id: Ibc8b99a92149410c8a879b7a4facf6c8961a7b9f
2021-11-02 17:04:38 +00:00
Jingwen Chen
55bc820d66 bp2build: split Bazel conversion context into smaller ones,
and change TopDownMutatorContext signatures to use Bazel conversion context.

This minimizes the context interfaces/functions actually needed to
convert a module, and makes such interfaces easier to mock/test.

Test: CI
Change-Id: Id573d97023d59e06ef70e1f54437024d3f7aadbd
2021-11-02 06:51:27 +00:00
Jingwen Chen
80b6b64db5 Add an error check in bazelPackage for malformed labels.
Bug: 204281595
Test: CI
Change-Id: Ia94a0b5c8dd3a0294475e9bc816a19ae03f7342d
2021-11-02 06:24:31 +00:00
Colin Cross
34c7832aaa Convert .meta_lic files to textproto
Make it easier to write tools against .meta_lic files and store complex
data by writing them in textproto.

Test: builds

Change-Id: I54bb82cc5581d17078fd0f56eed43a7364dc70db
2021-11-01 16:32:31 -07:00
Dan Willemsen
8528f4ec5e Add Darwin+Arm64 toolchain support
This just sets up the toolchain and allows Darwin+Arm64 to be specified
as a HostCross target. These variants will not be exported to Make, or
be installed on a Soong-only build. A future CL will add support for
universal binaries using these variants.

This config is a bit stranger than the regular 64/32 multilib, as it's
two primary 64-bit configs. And on a Darwin/X86 machine, the Arm64
versions are HostCross (doesn't work on the current machines), while a
Darwin/Arm64 machine, either version works (if Rosetta is installed).

Bug: 203607969
Change-Id: Iacaed77d267773672da027cd74917e33fb1c1e94
2021-11-01 15:07:37 -07:00
Colin Cross
1caea35278 Merge "Export Soong install rules to Make" 2021-11-01 21:31:56 +00:00
Paul Duffin
004547facd Use module-lib system modules when building from prebuilts
When building from source the build uses the java system modules for
the public or module APIs as needed. However, previously when building
from prebuilts it would always use the public API. That difference lead
to build failures when building from prebuilts.

This change makes the selection of java system modules when building
from prebuilts consistent with the selection when building from
sources.

As API levels 30 and 31 (which are the only previous releases to
provide system modules) did not provide separate java system modules
for the module-lib API those levels always use the public APIs.

Bug: 204189791
Test: - before applying these change
      m TARGET_BUILD_APPS=framework-connectivity
      - build fails with compilation error due to missing module APIs
      m sdk dist
      cp out/dist/system-modules/module-lib/core-for-system-modules.jar prebuilts/sdk/current/module-lib/core-for-system-modules.jar
      - apply these changes
      m TARGET_BUILD_APPS=framework-connectivity
      - build passes as expected
Change-Id: Id113ff014e7892b1009fbcaad89b1ae23a7c3b79
2021-11-01 16:40:28 +00:00
Colin Cross
91eaa6316a Merge changes I04f2f558,Ie16a6264,I83a3be9f,Icb3eeef3
* changes:
  Rename amod variable in AndroidMkEntries.fillInEntries to base
  Make HostToolPath, HostJNIToolPath and sboxPathForToolRel use pathForInstall
  Add PathForGoBinary
  Remove PathForOutput from InstallPathToOnDevicePath
2021-10-30 19:19:53 +00:00
Chih-hung Hsieh
7b2239f648 Merge "Add -{checkbuild,tidy} targets only for modules in mm" 2021-10-30 03:57:06 +00:00
Chih-Hung Hsieh
a3d135b1af Add -{checkbuild,tidy} targets only for modules in mm
Test: lunch aosp_coral-userdebug; WITH_TIDY=1
      make 7-libgptutils.coral-checkbuild 7-libgptutils.coral-tidy
Test: only coral libgptutils in out/build-aosp_coral.ninja
Test: lunch aosp_arm64-eng; make has no *libgptutils* tagets
Test: no libgptutils in out/build-aosp_arm64.ninja
Test: lunch aosp_cf_arm64_phone-userdebug; make libskia-checkbuild
Test: lunch aosp_arm64-eng; WITH_TIDY=1 make tidy-soong

Bug: 202763874
Change-Id: I2d5a3fdc627d62e43c3f10e61b338a03c10440be
2021-10-29 18:02:27 -07:00
Colin Cross
6301c3cffa Export Soong install rules to Make
Previously Soong's install rules have been disabled when embedded
in Make (ctx.Config().KatiEnabled() == true).  The primary blocker
for moving installation into Soong has been the `required` proeprty,
which is too vague to be easily handled in Soong.  Keeping
installation in Make has resulted in two host bin directories,
the Make-owned directory (e.g. out/host/linux-x86/bin), and the
Soong-owned directory (e.g. out/soong/host/linux-x86/bin).  The
lack of knowledge in Soong about the final, Make-owned installation
location makes it hard to support NOTICE files entirely in Soong.

This patch begins to solve this problem by supporting the creation of
the installation rules into Soong, but rather than writing the rules
to the ninja file it writes them to a Makefile and lets Kati convert
them to ninja.  This allows Kati to inject extra dependencies to
handle the `required` property.

Converting all modules to create their installation rules in Soong
would be too complex, so only modules that return true from
InstallBypassMake will use the Soong installation rules.  This
is currently only set for robolectric tests.

Bug: 204136549
Test: m checkbuild
Change-Id: I28af9fa7fadece8ea1f98f5efd140c823751cae7
2021-10-29 16:34:55 -07:00
Colin Cross
f1f763a981 Rename amod variable in AndroidMkEntries.fillInEntries to base
AndroidMkEntries.fillInEntries calls its android.ModuleBase amod,
despite also handling an android.Module.  Rename amod to base to
match other locations, and add a new amod for the android.Module.
This will simplify the next patch that needs to access the
android.Module.

Bug: 204136549
Test: m checkbuild
Change-Id: I04f2f558959def22e8b3f5b8c534b8d655b06a4e
2021-10-29 16:34:55 -07:00
Colin Cross
790ef35d1e Make HostToolPath, HostJNIToolPath and sboxPathForToolRel use pathForInstall
Use pathForInstall instead of PathForOutput for HostToolPath,
HostJNIToolPath and sboxPathForToolRel so that they internally produce
an InstallPath that can later support being converted to Make install
path.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie16a62641d113873daeec4d1dd4261251bc0d0eb
2021-10-29 16:34:55 -07:00
Colin Cross
a44551fec6 Add PathForGoBinary
Add PathForGoBinary that uses pathForInstall to return the install
path of a GoBinaryTool.  This will replace various places that used
PathForOutput to reconstruct a path to a Go tool, and will support
moving Go tools to the Make install directory outside of the
PathForOutput directory in a future patch.

Bug: 204136549
Test: m checkbuild
Change-Id: I83a3be9f5c621975540f5ed601a0b9e2611c98b9
2021-10-29 16:34:55 -07:00
Colin Cross
b1692a3468 Remove PathForOutput from InstallPathToOnDevicePath
The next patches will make more InstallPaths use the Make output
directory, which is not inside PathForOutput.  Fix the assumption
that the InstallPath is relative to PathForOutput by storing
enough information in the InstallPath to find the on-device path
without PathForOutput.

Bug: 204136549
Test: soong tests
Change-Id: Icb3eeef3f1c72f773f333267f8a7dfc503feacb5
2021-10-29 16:34:55 -07:00
Paul Duffin
12e311d958 Add tests for prebuilts of all API surfaces
Previously, the tests only covered checking the sdk dependencies added
when using a prebuilt current (public) and system SDKs, i.e. with
sdk_version set to "current_30" or "system_30". This change adds tests
to cover other APIs, e.g. "test_30", "module_30" and
"system_server_30". It adds tests for "module" and "system-server" up
to API level 32 as following changes will give them different behavior
as API levels less than or equal to 31 do not have a separate
core-for-system-modules.jar file for the module-lib API.

Bug: 204189791
Test: m nothing
Change-Id: I585a88615439a24abf75250114a86113b5f5da57
2021-10-29 17:57:12 +01:00
Treehugger Robot
c9e85ca825 Merge "Make a pass over our codebase cleaning up non-precise / non-inclusive language." 2021-10-28 20:51:17 +00:00
Joe Onorato
b4638c1ac3 Make a pass over our codebase cleaning up non-precise / non-inclusive language.
Test: treehugger
Bug: 204369779
Change-Id: I6e63cae824d323535cdb14b493edd868df47738d
2021-10-28 10:32:07 -07:00
Chih-hung Hsieh
4dceb3705f Merge "Do not add .tidy files as RBE link inputs" 2021-10-27 20:29:04 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
34d60d6672 Remove vestigial GetPrebuiltCcStaticLibraryFiles
Test: mixed_{libc,droid}.sh
Change-Id: Ie6e22e1994f8abf1b66f4abfd834bf38a1f097b2
2021-10-26 15:03:18 +00:00
Chih-Hung Hsieh
3bb934f0ad Do not add .tidy files as RBE link inputs
* RBE adds implicit dependent files as inputs
  and creates too long commands.
* Adds .tidy files as validation paths.
* Change type of tidyFiles to WritablePaths.

Bug: 203577539
Test: lunch aosp_cf_arm64_phone-userdebug; USE_RBE=true WITH_TIDY=1 make
Test: USE_RBE=true WITH_TIDY=1 mm in external/skia
Change-Id: I5fc9d6f8c9c58abcd3721ca9fbae1bc785e4e609
2021-10-25 12:24:30 -07:00
Jiyong Park
d163d4d7f5 Add the device config GenerateAidlNdkPlatformBackend
The config is used to force the generation of the AIDL ndk_platform
backend which will eventually be removed in favor of the ndk backend.
The switch is needed as an escape hatch for some devices whose BSP
(outsourced and thus hardly modifiable) depends on the ndk_backend
libraries.

Bug: 161456198
Test: m
Merged-In: Ie11ca62be05754bb2593da16e1380103c670b393
Change-Id: Ie11ca62be05754bb2593da16e1380103c670b393
(cherry picked from commit 65d9718328)
2021-10-25 08:55:57 +09:00
Liz Kammer
2dafba7da9 Merge "bp2build: Add support for cc_binary." 2021-10-20 14:02:39 +00:00
Chris Parsons
787fb36189 Add OS to configuration key in mixed builds
This also removes the special-case filegroup from mixed builds
buildroot; no special handling is required. Since we're currently
hardcoding linux_x86_64 as our host platform, it should be fine
to continue assumping that hardcoded host for now.

Test: USE_BAZEL_ANALYSIS=1 m adbd
Change-Id: I35509f4eb33ba7a243fab4c34b35958f6f2fceab
2021-10-19 16:55:52 -04:00
Liz Kammer
2b8004b1ef bp2build: Add support for cc_binary.
Bug: 197920036
Test: build/bazel/ci/bp2build.sh
Change-Id: I2c4200967653af15a330ab8cbaf796b70d43f32d
2021-10-19 14:12:39 -04:00
Dan Willemsen
2a109db10b Merge "Reduce modules exposed to Make in Mac builds" 2021-10-19 00:32:54 +00:00
Liz Kammer
503f65da36 Merge "Add tests for defaults used in conditions_default" 2021-10-18 22:03:33 +00:00
Dan Willemsen
def7b5d198 Reduce modules exposed to Make in Mac builds
Device builds are no longer supported on Mac, but we do support building
various host tools, including the SDK build-tools and platform-tools
packages. These have dependencies on [java] device modules, so we don't
completely disable device modules, only hide them from Make (which makes
them more difficult to trigger from the command line).

Also fix the mac build of multiproduct_kati, so that `m blueprint_tools`
works on Mac.

Bug: 187222815
Test: `m`, `m dist`, etc on Mac
Change-Id: I92f16605d5cd173d431cbcb79081234d45cc6e2e
2021-10-18 12:44:45 -07:00
Liz Kammer
bdce0dfbdf Add tests for defaults used in conditions_default
Bug: 203123704
Test: go test soong tests
Change-Id: Ia12c51d01108ad1f311d738b182d4bb94c500810
2021-10-18 12:49:41 +00:00
Jingwen Chen
df27b7a1e0 Denylist genrules that create the same file in the same package.
Test: bp2build presubmits

Bug: 194642721
Bug: 203369847
Change-Id: Id0faff5fcf4136fac5236980dd60c5d8e54d9547
2021-10-18 06:33:16 +00:00
Treehugger Robot
adf2b3e68f Merge "Add android_sdk_repo_host to build platform-tools&build-tools" 2021-10-15 02:04:45 +00:00
Liz Kammer
2fc348986c Add missing directories to bp2build.
Added directories with deps of adbd that were not converted and added
them to be converted via bp2build.

Test: bp2build.sh
Test: mixed_droid.sh
Change-Id: Iacb634b23e1fdc2767a0923882b71f482ebca53d
2021-10-13 17:07:41 -04:00
Lev Rumyantsev
1eda2bd946 Merge "Support 64-bit arm_on_x86_64" 2021-10-13 19:42:49 +00:00
Lev Rumyantsev
34581212a4 Support 64-bit arm_on_x86_64
hasArmAndroidArch only checked for 32-bit arm target and thus didn't
work properly on 64-bit only systems.

Test: CtsRsCppTestCases 64-bit only arm on x86
Bug: 194800662
Change-Id: I87332d793dcdd4859766c9067b9fd53f9e4c2516
2021-10-13 09:55:10 -07:00
Liz Kammer
fdd72e6351 bp2build: Add special arch-variant targets.
Soong supports additional arch-variant targets based on arch/os aside
from strictly arch/os names. Handle the unconverted cases based solely
on arch/os.

Test: build/bazel/ci/bp2build.sh
Change-Id: I8dc987b1aa4a4ea646dd5b03a94b84297ba6113a
2021-10-13 09:01:56 -04:00
Dan Willemsen
9fe1410213 Add android_sdk_repo_host to build platform-tools&build-tools
The Android SDK has been built with Make up until now, monolithically,
then split up into several sdk-repo zip files for different purposes.
The Mac and Windows SDKs really only need to contain the platform-tools
and build-tools pieces, but due to this monolithic sdk zip, we had to
build the whole SDK first.

This adds an `android_sdk_repo_host` module that can build these
platform-tools and build-tools zips.

Bug: 187222815
Change-Id: I55809e1d7447dd65e22461f921b2b8abb6d5f822
2021-10-13 01:25:02 -07:00
Liz Kammer
8cdd6f007d Merge "Restrict mixed build cquery to deps of depth 2." 2021-10-08 17:04:02 +00:00
Xin Li
800112b97f Merge "Merge Android 12" 2021-10-07 23:50:21 +00:00
Jingwen Chen
8f22274297 Stop relying on target.kind in mixed builds.
target.kind was a field that existed for only a few months, and have
been removed from Bazel. This is needed to update to a newer Bazel version.

Also, this reverts filegroups to be queried for a specific arch again,
but leaving file targets in the common arch (which is correct, anyway).

Fixes: b/199363072
Test: mixed_libc
Test: presubmits
Change-Id: I3b8e5c43a39516d977d327a44a75750b2f251be3
2021-10-07 14:04:38 +00:00
Liz Kammer
c19d5cdcff Restrict mixed build cquery to deps of depth 2.
This will be the list of targets directly being requested + additional
targets necessary for mixed_root. This reduces the size of the cquery
file by ~300Kb. Additionally, it removes unnecessary targets, making it
ever so slightly easier to find what one is looking for in cquery.out
for debugging purposes.

Test: build/bazel/ci/mixed_droid.sh
Change-Id: I6d0e337c9ab7c13388459dee16415be0ab3c0506
2021-10-06 18:16:58 -04:00
Christopher Parsons
f5a385f171 Merge "Remove more out-of-date items from denylist" am: b19d4cda2e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844513

Change-Id: Ic7a0cebac496ca1d07145b4cd28439b4fd373e70
2021-10-04 19:44:07 +00:00
Christopher Parsons
b19d4cda2e Merge "Remove more out-of-date items from denylist" 2021-10-04 19:31:36 +00:00
Treehugger Robot
3e745e63f3 Merge "Bp2Build common properties auto-handling" am: d905146590
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815376

Change-Id: I38f1063302ea90583a51e625076e6232b4364ab7
2021-10-04 19:20:28 +00:00
Treehugger Robot
d905146590 Merge "Bp2Build common properties auto-handling" 2021-10-04 19:02:07 +00:00
Treehugger Robot
70e2b79d9c Merge "Make RuleBuilder fail fast when passed a nil Path" am: b5e3a79358
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844300

Change-Id: I6fe77f48ff5fd9b225bf577bc20821a05633067f
2021-10-04 18:25:44 +00:00
Treehugger Robot
b5e3a79358 Merge "Make RuleBuilder fail fast when passed a nil Path" 2021-10-04 18:12:04 +00:00
Chris Parsons
b97a817fdb Remove more out-of-date items from denylist
Test: mixed_droid CI
Change-Id: Ifc5bb10328860a5d979eb627a5347d8c23203155
2021-10-04 12:48:29 -04:00
Christopher Parsons
349f4963df Merge "Remove out-of-date items from bp2build denylist" am: 9c03ef7790
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1843716

Change-Id: I611dc8b307b7ac38e97f84a3bf4139e1260e1bd3
2021-10-04 14:45:06 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
447f6c99c9 Bp2Build common properties auto-handling
Introduce `commonAttributes` & `fillCommonBp2BuildModuleAttrs used in
CreateBazelTargetModule

Adapt `bp2BuildInfo` to use `commonAttrs` instead of `Name`.
And thus also all downstream users of `CreateBazelTargetModule`.

As initial user, the Soong `required` property will be
translated to Bazel's `data`.

Bug: 198146582, 196091467
Test: build_converstion_test.go:TestCommonBp2BuildModuleAttrs
Test: go test
Test: mixed_{libc,droid}.sh
Change-Id: Ib500e40f7e2cb48c459f1ebe3188962fc41ec124
2021-10-04 14:43:04 +00:00
Paul Duffin
3866b89d15 Make RuleBuilder fail fast when passed a nil Path
Previously, the RuleBuilder would add all supplied Paths directly to
one of its lists of Paths without checking to make sure it was not nil
only to panic somewhere in its Build() method when it attempted to
convert it to a string. Deferring the failure made it harder to debug.
This change fails fast by checking every Path when it is passed to the
RuleBuilder.

Test: m nothing
Change-Id: I06b35da02101f6dfab80d2daaf3d8e44ded8b6be
2021-10-04 12:56:10 +01:00
Christopher Parsons
86a0c43017 Merge "bp2build: Handle target.linux" am: d6558d15bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1843713

Change-Id: I89c7a1211cd22141b42333ad2c55e24b5caa6584
2021-10-01 22:08:28 +00:00
Chris Parsons
c39f63358b Remove out-of-date items from bp2build denylist
Test: mixed_droid CI
Change-Id: Ic51cf7ed193641882dbe0018818d8e3bcab53507
2021-10-01 18:01:11 -04:00
Chris Parsons
2dde0cb3de bp2build: Handle target.linux
Also refactor target.bionic to be handled not as its own configuration
axis, but instead to be grouped into os selects handling.

This allows us to remove libbase and its dependencies from the bp2build
denylist.

Test: mixed_droid.sh CI
Change-Id: I92f30074d286306207653fe37589835ae3db16c4
2021-10-01 14:56:39 -04:00
Liz Kammer
55f82b0f02 Correct path for removing old bazel artifacts am: d7d5b72e4e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842591

Change-Id: I62f4c92912921fd0c372d8ce3eb5520561eec77e
2021-10-01 15:36:37 +00:00
Liz Kammer
d7d5b72e4e Correct path for removing old bazel artifacts
Test: mixed_libc.sh
Bug: 201767767
Change-Id: Ie34ac3a583dbefb6c4b79ea0756acef623116af7
2021-10-01 10:33:12 -04:00
Ulyana Trafimovich
ab70bc55c5 Merge "Remove unused variable SKIP_BOOT_JARS_CHECK." am: 1b5262bd69
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1841576

Change-Id: Ice0247fa07797d12f2c1911bee3569cffed5dee1
2021-10-01 07:34:21 +00:00
Ulyana Trafimovich
1b5262bd69 Merge "Remove unused variable SKIP_BOOT_JARS_CHECK." 2021-10-01 07:21:39 +00:00
Chris Parsons
c4f917591c Temporarily disable libbase am: b1f405e66d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842754

Change-Id: I154119390d6bfb641f2fd44040e6f658134f815c
2021-09-30 22:12:37 +00:00
Chris Parsons
b1f405e66d Temporarily disable libbase
This should unbreak the build and give me some time to investigate the
root cause.

Test: USE_BAZEL_ANALYSIS=1 m libandroidfw
Change-Id: Ia843ae5b92a70131b4989b4bdebc063866cb1075
2021-09-30 17:25:32 -04:00
Chris Parsons
486b80a0d5 Support building libcrypto via mixed builds am: a37e195182
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1839353

Change-Id: I34a5ec794874856a415e2c5415ef8b08ef3a7e21
2021-09-30 20:10:15 +00:00
Chris Parsons
a37e195182 Support building libcrypto via mixed builds
This required the following fixes to bp2build:
  - Correctly handle Bionic_* and Linux_* targets
  - Correctly handle cc_object's selects
  - Generate linker_script, stl, and system_dynamic_deps for cc_object in bp2build

Test: USE_BAZEL_ANALYSIS=1 m adbd
Change-Id: I753fd18df8ae551fb69df07e4174527c5388f289
2021-09-30 12:30:36 -04:00
Ulya Trafimovich
fbe51fe0ec Remove unused variable SKIP_BOOT_JARS_CHECK.
The variable is no longer used after https://r.android.com/1737753.

Bug: 189298093
Test: m
Change-Id: I7f660fb205212d109f3e9ce2c805508ef481da24
2021-09-30 14:03:09 +01:00
Liz Kammer
4b8b9b7e52 Add deps of protos to bp2build. am: 0f3b7d2fc4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838060

Change-Id: I9b9735e5396cedbb027187a054515e783901ef9a
2021-09-29 16:55:55 +00:00
Liz Kammer
87517e2637 Sort bp2build directory allowlist. am: 55682fea4b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838059

Change-Id: I8e5591d7c6e19309eab7234ea98ac1148fb69138
2021-09-29 16:55:52 +00:00
Liz Kammer
0f3b7d2fc4 Add deps of protos to bp2build.
Update BazelOutPath to implement genPathProvider. This allows Bazel
outputs (incl filegroup) to be used as an input to generating a file
(e.g. proto).

Test: bp2build.sh
Test: mixed_build.sh
Bug: 200601772
Change-Id: I5ad67ade193025652100b214996b26ce9ca9bf83
2021-09-29 10:31:27 -04:00
Liz Kammer
55682fea4b Sort bp2build directory allowlist.
Test: bp2build.sh
Change-Id: I48157fd4e02fef3a6917f0a40418cc929168ffff
2021-09-29 10:30:35 -04:00
Jingwen Chen
8d1e0849fa bp2build //system/core/libasyncio:libasyncio am: b59f6e2397
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838474

Change-Id: I9e3acde8ba150d51717b595952a8576cdf0d2eca
2021-09-28 23:26:34 +00:00
Jingwen Chen
3b99edfa96 bp2build //external/lz4/lib:liblz4. am: 8385250f4f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838473

Change-Id: I7869e7f6d8ab661a25dbedc98550f1b4a040fd90
2021-09-28 23:26:30 +00:00
Jingwen Chen
b59f6e2397 bp2build //system/core/libasyncio:libasyncio
Test: presubmits
Change-Id: Ie748d2017eaf9043392975ca0db8ae4f673ba059
2021-09-28 00:48:14 +00:00
Jingwen Chen
8385250f4f bp2build //external/lz4/lib:liblz4.
Fixes: 198241792
Test: presubmits
Test: USE_BAZEL_ANALYSIS=1 m adbd
Change-Id: Ifc0326805f39259f06348dcc0b1b4a7c86afc856
2021-09-28 00:05:20 +00:00
Romain Jobredeaux
572a87d1e4 Merge "Exclude WallpaperPicker app and pom2bp-generated BUILD files from bp2build." am: 3bafa69336
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832976

Change-Id: I5cc98dae403f67999798ae25a1ac4c8af6bfb414
2021-09-27 21:06:50 +00:00
Romain Jobredeaux
3bafa69336 Merge "Exclude WallpaperPicker app and pom2bp-generated BUILD files from bp2build." 2021-09-27 20:54:51 +00:00
Treehugger Robot
68e36bfa00 Merge "Add more sepolicy variables to soong_config" am: 208d2962f0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826065

Change-Id: I25a8e93236a4bc76ea5654d7e999561b477d7fc9
2021-09-27 11:20:39 +00:00
Treehugger Robot
208d2962f0 Merge "Add more sepolicy variables to soong_config" 2021-09-27 11:05:19 +00:00
Paul Duffin
5e253253ff Merge "Insert imageVariantSpecificInfo between arch and link info" am: 99df906e34
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834874

Change-Id: If7af6edbc91844e96d8132384cf98fbd926a83a7
2021-09-25 09:29:58 +00:00
Paul Duffin
99df906e34 Merge "Insert imageVariantSpecificInfo between arch and link info" 2021-09-25 09:13:14 +00:00
Christopher Ferris
51beb6b7c8 Merge "Add two new variables to Malloc_not_svelte." am: d8fd124227
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1836134

Change-Id: Ib816cc29bcc07920dca08736c301ad9429d9b84a
2021-09-25 01:54:53 +00:00
Christopher Ferris
d8fd124227 Merge "Add two new variables to Malloc_not_svelte." 2021-09-25 01:36:48 +00:00
Christopher Parsons
a64586fb74 Merge "Add stl property support for bp2build" am: 0bb4ac55d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834858

Change-Id: I9c45eab96c5e62667bd78d0fa48601ab140357a0
2021-09-24 20:08:41 +00:00
Christopher Ferris
dea6617bc5 Add two new variables to Malloc_not_svelte.
Add the srcs and header_libs for the system/core/debuggerd
change to support removing scudo code on svelte configs.

Bug: 201007100

Test: Builds.
Change-Id: Iec083dc5cbfbc63334a72e2e77a53067786a85ca
2021-09-24 11:55:51 -07:00
Chris Parsons
a967f253e6 Add stl property support for bp2build
Test: mixed_libc
Test: USE_BAZEL_ANALYSIS=1 m libbase
Change-Id: If56d4a728de3ae4022cc9dadadc9bf8b952f9eaf
2021-09-24 13:51:56 -04:00
Paul Duffin
b42fa67a47 Insert imageVariantSpecificInfo between arch and link info
Previously, the archTypeSpecificInfo included an array of
*linkTypeSpecificInfo. This change replaces that array with an array of
*imageVariantSpecificInfo which themselves contain an array of
*linkTypeSpecificInfo.

That allows the sdk snapshot to handle image variants correctly, i.e.
collate their properties, optimize their properties and then detect if
there are any image variant specific properties for any image variant
other than the CoreImageVariant ("") and report it as an error.

The latter case is treated as an error because while Soong needs to
handle image specific variants there is currently no requirement to
handle generating a prebuilt with image specific properties. A follow
up change will test the error handling.

Image specific variants are needed because the "jni_headers"
cc_library_headers module provides a number of image variants (e.g.
recovery) that are used outside the ART module. Therefore, the sdk
snapshot needs to do the same.

At the moment image variants like the recovery variant are supported by
copying the property that creates the variant (e.g. recovery_available)
through to the prebuilt but that is not safe for a couple of reasons:
1. It ignores any differences between the recovery variant and the
   other variants which could cause compatibility issues in modules
   that build against the prebuilts.
2. It marks modules in the snapshot with recovery_available even when
   they do not need it.

This change will allow follow up changes to address both those issues.

Bug: 195754365
Test: m nothing
Change-Id: I1c187d814f44b2cb7607cd43a6b215134be0faad
2021-09-24 17:32:03 +01:00
Liz Kammer
6fe2d9a3aa Merge "bp2build: Add support for export_.*headers props" am: 6244df2a24
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835374

Change-Id: I10252c15de0bbc6691a69fb214461f6d56d000ff
2021-09-24 13:29:34 +00:00
Liz Kammer
6244df2a24 Merge "bp2build: Add support for export_.*headers props" 2021-09-24 13:13:05 +00:00
Martin Stjernholm
40fc93fb3c Merge changes I957f3df8,I68986dcc am: cf6bf37d04
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1829372

Change-Id: Ifcf471f2746c1037b83c2a11b8f5120b86fd6cb2
2021-09-24 09:44:00 +00:00
Martin Stjernholm
cf6bf37d04 Merge changes I957f3df8,I68986dcc
* changes:
  Consolidate the code to resolve a deapexer module dependency.
  Propagate the dex jar path as an OptionalPath which is either valid or invalid with a message.
2021-09-24 09:32:24 +00:00
Treehugger Robot
d17a3ad9f2 Merge "For mixed build bazel actions, remove old outputs" am: e1bb74e724
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834860

Change-Id: I32be5f8098a6161aad6d2bdabfb848fd374eeed1
2021-09-23 22:48:05 +00:00
Treehugger Robot
e1bb74e724 Merge "For mixed build bazel actions, remove old outputs" 2021-09-23 22:38:12 +00:00
Chris Parsons
e37a4de773 For mixed build bazel actions, remove old outputs
This should fix incrementality issues in cases where actions don't wipe
the old output. (Looking at you, llvm-ar)

Test: mixed_libc.sh
Change-Id: I4b6639e74c72921a5a703d73fd36f766f121c6ad
2021-09-23 17:25:10 -04:00
Liz Kammer
7a210ac233 bp2build: Add support for export_.*headers props
Soong supports export_.*_headers properties, the libraries contained in
this list must also be within a shared/static/whole_static/header libs
property. For bp2build, we eliminate this duplication. The libraries
not listed in an export_.*_headers property will migrate to an attribute
prepended with implementation_, those in export_.*_headers will not have
a prefix.

Test: build/bazel/ci/bp2build.sh
Test: build/bazel/ci/mixed_libc.sh
Bug: 198241472
Change-Id: I3eb84c983ec5d241c8a568e411dfd5619d3184a7
2021-09-23 16:07:45 -04:00
Christopher Parsons
f75a32998e Merge "Disable mixed builds for non-device OS" am: 4ea6052650
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834999

Change-Id: I7bdd47462db00faeaa85917d47f310c17b134aae
2021-09-23 20:02:36 +00:00
Wei Li
0e504d7dc9 Merge "Add bp2build converter for cc_genrule." am: a06db33ebd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1829492

Change-Id: I73b0abd1f86d7dfc17a683595585aff4b5ffb91e
2021-09-23 18:17:04 +00:00
Chris Parsons
1826621bdd Disable mixed builds for non-device OS
We don't currently support propagation of OS in mixed builds, and our
host toolchains are not properly configured.

This allows us to continue to make progress on device OS until host is
supported.

Test: mixed_libc CI
Test: USE_BAZEL_ANALYSI=1 m adbd
Change-Id: I2bf8b3f9ca7928dd33bf2fb3d4fa067da0f593f3
2021-09-23 14:11:42 -04:00
Wei Li
a06db33ebd Merge "Add bp2build converter for cc_genrule." 2021-09-23 18:04:03 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
0a72e89916 Merge "Annotate FIXME for b/200678898" am: fda604ab7c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832335

Change-Id: I73c2f65504a17a0b866ccb498ba1f20fcfd2b6f8
2021-09-23 17:22:51 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
fda604ab7c Merge "Annotate FIXME for b/200678898" 2021-09-23 17:18:49 +00:00
Martin Stjernholm
4482560cc7 Consolidate the code to resolve a deapexer module dependency.
It will get more logic in upcoming CLs.

Add a property to DeapexerInfo for the APEX name, for use in error
messages.

Test: m nothing
Bug: 192006406
Change-Id: I957f3df8b34543a38cde38768dac93e78132d672
2021-09-23 17:19:55 +01:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
fd0c03c315 Annotate FIXME for b/200678898
Bug: 200678898
Test: TBD
Change-Id: I433f3187714d5ea19b081ed5e3fe758de0a29ddd
2021-09-23 15:12:03 +00:00
Treehugger Robot
f40148060b Merge changes I67c5022b,I3baa2535 am: 2e65f41953
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832259

Change-Id: Idd0df37d03a2ac22c1e9e03a34cee680c4ad37c9
2021-09-23 14:37:07 +00:00
Treehugger Robot
2e65f41953 Merge changes I67c5022b,I3baa2535
* changes:
  Detect duplicates in sdkRegistry
  Dedup SdkMemberType/TraitRegistry
2021-09-23 14:21:05 +00:00
Paul Duffin
ba27bee268 Merge "Removes usages of SdkMemberTrait/TypeRegistry outside android/sdk.go" am: 0a7428073c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832257

Change-Id: I76136aafd4443f43731d82760fdc36f7be6dbc3b
2021-09-23 13:07:55 +00:00
Paul Duffin
0a7428073c Merge "Removes usages of SdkMemberTrait/TypeRegistry outside android/sdk.go" 2021-09-23 13:05:41 +00:00
Jerome Gaillard
8467166b0c Merge "Fix path to layoutlib project" am: f346429e0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834613

Change-Id: I931d20bb43cf0c3294c5c2746da828ac06914e17
2021-09-23 13:03:27 +00:00
Paul Duffin
adaec6a171 Merge "Add support to sdk/module_exports to specify required traits" am: 95a1d1672f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1827876

Change-Id: I459f5843376c4ec281b6bbced07e6b60657c4070
2021-09-23 13:03:13 +00:00
Jerome Gaillard
f346429e0e Merge "Fix path to layoutlib project" 2021-09-23 12:57:32 +00:00
Jerome Gaillard
655ee02d29 Fix path to layoutlib project
It is in the 'frameworks/layoutlib' folder and not in 'framework/layoutlib'.

Change-Id: I437558a0afa8bfaac0226b1e4c5a7c0a983b180a
2021-09-23 11:38:11 +00:00
Paul Duffin
581f2e5f79 Detect duplicates in sdkRegistry
Bug: 195754365
Test: m nothing
Change-Id: I67c5022b7cc61891fd6b90365f8271d97d7bcd98
2021-09-23 11:37:57 +01:00
Paul Duffin
30c830b82a Removes usages of SdkMemberTrait/TypeRegistry outside android/sdk.go
In preparation for a refactoring that will dedup the registry code.

Bug: 195754365
Test: m nothing
Change-Id: I93e8485d588f5b4d6b5e2967da5dbef7b6c831ad
2021-09-23 11:37:57 +01:00
Paul Duffin
f04033be81 Dedup SdkMemberType/TraitRegistry
Bug: 195754365
Test: m nothing
Change-Id: I3baa2535fd21a47bea2229f13cf5eb166396fe79
2021-09-23 11:37:57 +01:00
Paul Duffin
d19f894512 Add support to sdk/module_exports to specify required traits
Currently, every sdk member of a specific module type has to be treated
in the same way as every other sdk member of that type. e.g. it is not
possible for an sdk member to use different variants to other members
of the same type.

Adding a new member type for each different way to treat the members is
not scalable as if there were N different ways treat a member then it
would require 2^N types for all the possible combinations.

This adds a new traits mechanism that allows the behavior of member
types to be customized per sdk member. Each member type can specify a
list of supported traits and customize its behavior based on which
traits are required for each member. A trait can be supported by
multiple different member types.

Bug: 195754365
Test: m nothing
Change-Id: I165ac80d208c0402d2a9ffa8085bba29562c19b7
2021-09-23 11:37:51 +01:00
Wei Li
bcd399479a Add bp2build converter for cc_genrule.
Test: cc_genrule_conversion_test.go

Change-Id: I19290b417d6336020a15ba7fa772ee0c76c58225
2021-09-23 05:41:20 +00:00
Romain Jobredeaux
a2c081413a Exclude WallpaperPicker app and pom2bp-generated BUILD files from bp2build.
Bug: 198418951
Test: b build packages/apps/WallpaperPicker
Change-Id: I86eb64c734eb262a497595f525027534cdabdf32
2021-09-22 14:43:43 -04:00
Romain Jobredeaux
9ba010c641 Merge "Exclude directories with manual BUILD files from bp2build." am: f05bea080b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1822113

Change-Id: I6543f9c9829b02e5e5a3ef50779d4f5b6d6cdc96
2021-09-22 17:48:17 +00:00
Romain Jobredeaux
f05bea080b Merge "Exclude directories with manual BUILD files from bp2build." 2021-09-22 17:28:31 +00:00
Christopher Parsons
5a5ceb553e Merge "bp2build: reference static variants directly" am: ce0944fc96
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832014

Change-Id: I6314b59c55d7dcc65444d44f631d39ff566c49d9
2021-09-21 15:32:04 +00:00
Christopher Parsons
ce0944fc96 Merge "bp2build: reference static variants directly" 2021-09-21 15:13:43 +00:00
Chris Parsons
953b35623a bp2build: reference static variants directly
Previously, when referencing a cc_library as a static_lib from a
converted module, the corresponding target would depend on the "root
target" of that cc_library. This resulted in a superfluous dependency on
the shared target of the cc_library dependency. This superfluous
dependency could sometimes result in cycles.

This change ensures the static target name is directly specified in such
cases.

Test: mixed_libc.sh CI
Test: USE_BAZEL_ANALYSIS=1 m fmtlib
Change-Id: I36ee9f0a9017b1e9d73df9e3174669107f0afd4f
2021-09-20 15:15:29 -04:00
Martin Stjernholm
e576120738 Merge "Show less ambiguous paths in the error when it fails to match the given output file." am: bacf6a1a6a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1830039

Change-Id: I247387b90d0508e22f24adb941b005b5a5df1b7e
2021-09-20 18:10:48 +00:00
Martin Stjernholm
bacf6a1a6a Merge "Show less ambiguous paths in the error when it fails to match the given output file." 2021-09-20 17:44:01 +00:00
Martin Stjernholm
804f4d1117 Merge changes I464e6ebd,Iaf7655e4 am: 3536614edd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826777

Change-Id: I7e03d04afbc809544d964548caa1646bc36aa353
2021-09-20 13:17:53 +00:00
Martin Stjernholm
a4aaa47a00 Show less ambiguous paths in the error when it fails to match the given
output file.

PathRelativeToTop should give an unambiguous path that can be used for
matching, as opposed to Rel().

Test: `m nothing` with a test with an invalid Output() call
Change-Id: I6d501df6acb0a1700f1480bd4250320f69278c39
2021-09-20 14:17:09 +01:00
Martin Stjernholm
c32dd1c0ab Make it possible to pass an error message with an invalid optional path.
This is useful to delay errors until the paths need to be used.

Test: m nothing
Change-Id: I464e6ebd04b06c5e17617e8ee4e65a3320f1168f
2021-09-20 14:02:11 +01:00
Martin Stjernholm
2fee27f3c9 Replace OptionalPath.valid flag by checking the path itself.
Test: m nothing
Change-Id: Iaf7655e4676d2beeb7c7ac3bcba11a7dad4a01a3
2021-09-20 14:02:11 +01:00
Martin Stjernholm
f9dd87304f Add a function to match modules through a variation map. am: 14cdd71152
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1825132

Change-Id: I9b6765ee40d47bb9470bdb0f0f09bb572d700343
2021-09-18 00:48:46 +00:00