Commit Graph

3897 Commits

Author SHA1 Message Date
Jingwen Chen
c1b6478f5e Add a mutex for soong config var map writes. am: 4ad40d99b0 am: efb5654552 am: 1b91d4be89
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1901432

Change-Id: I2c1ed764c35a2ca3d962408ce785ad3225d501f0
2021-11-24 12:56:00 +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
Jingwen Chen
9e4d384ebc Temporarily disable //system/apex from bp2build due to flaky failures. am: d43d4a4cdf am: f7251d4557 am: 43ca1ac2a4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899160

Change-Id: Ib2ef523a1a396d02d21153ddd3b19971b4363295
2021-11-23 15:36:31 +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
13025fe63c Add support for writing all Soong config variables into @soong_injection. am: 01812020c1 am: 096249a5b0 am: 67cc81d9a4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1895250

Change-Id: I19adaca90ddba9dda6989129686b1a416d7c6bf4
2021-11-23 12:27:05 +00:00
Jingwen Chen
c71a9482c5 Fix bp2build select generation for inter-attribute soong config am: 58ff6801f4 am: d4c0c1fc12 am: 19de6d49ea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1894968

Change-Id: I207b7b63629e42a9df37db345801b0a4db3e8b2d
2021-11-23 12:27:04 +00:00
Jingwen Chen
e12de38b7c Allowlist //system/apex. am: 228ef1e370 am: f05d2e8dcd am: 0eb455be0c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1894967

Change-Id: I35778ecabc5ddfa0d6f901b01f6aefcfac776901
2021-11-23 12:27:03 +00:00
Jingwen Chen
43e834945b Add support for merging defaults soong_config_module_types into bp2build am: 84817de033 am: 03eb2b1774 am: 07415f907f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1894966

Change-Id: If726a8e907ec715d970ce77acd7fa6548a6f73d3
2021-11-23 12:27:02 +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
Treehugger Robot
73cac2f692 Merge "Set min_sdk_version (packages/modules/adb)" am: 0662933a18 am: 42d53e3fb3 am: 217c1c69a3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1895251

Change-Id: I96d9d528607eefe79f07466ed86e30e7eb32e7df
2021-11-22 23:39:05 +00: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
e596da3246 Merge "Revert^2 "Add seapp_contexts to allowlist of makefile goal"" am: ac69c239d1 am: 77bd4841a7 am: 76267be6fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1897105

Change-Id: Iec3c699a590e06290ad0007d284ea68ff1d0d038
2021-11-20 02:31:23 +00:00
Yuntao Xu
ac69c239d1 Merge "Revert^2 "Add seapp_contexts to allowlist of makefile goal"" 2021-11-19 19:24:55 +00:00
Colin Cross
6bf007ed59 Merge changes from topic "app_set" am: 25f15a18e5 am: cf0dd40fb3 am: 80547efe96
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1893517

Change-Id: I1a493deb2175d66150d50e741319df1cd9fa6c46
2021-11-19 03:19:03 +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
9f04bd0642 Merge "Revert "Add seapp_contexts to allowlist of makefile goal"" am: 030878a492 am: fca78780d4 am: 547a9f5059
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1896452

Change-Id: I382cee7ad387d5429f8a6936a12f37e7b44c3a5e
2021-11-18 18:57:11 +00:00
Yuntao Xu
1c2907dc7c Merge "Add seapp_contexts to allowlist of makefile goal" am: cd6c3cd868 am: 02c78d304c am: 20cc4f0a1d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1876178

Change-Id: I6169766d7bd3ba005139b78255f02f1250f8f317
2021-11-18 18:00:37 +00:00
Vova Sharaienko
030878a492 Merge "Revert "Add seapp_contexts to allowlist of makefile goal"" 2021-11-18 17:56:09 +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
Yuntao Xu
cd6c3cd868 Merge "Add seapp_contexts to allowlist of makefile goal" 2021-11-18 17:05:46 +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
Treehugger Robot
a1aedba6d3 Merge "Quote aquery commands." am: 245b1bf4dc am: 817724812d am: dba226ab81
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1894223

Change-Id: Iea6c75f6073108ed239cfce640d7a6b9cfebde7a
2021-11-17 02:14:53 +00: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
44062f70ed 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. am: 455ba83a94 am: d8812610ba am: 233dd1b3bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1881650

Change-Id: I189ee5c9e7ec33a492da3cd3ca4ba9b165da5451
2021-11-16 21:39:38 +00: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
501f02c3d0 Merge "Refactor ProductConfigProperties to use a struct key instead of an string key with hardcoded patterns." am: 59a5cb072b am: 7f98f45ff8 am: b8dc51a5cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1892222

Change-Id: Id4975a82327f9f1815e794adba0b02a573a22f06
2021-11-16 05:42:01 +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
61bd087651 Merge "Use new soong_cc_rust_prebuilt.mk" am: 3e1bc6cc0d am: 7e68fdef86 am: c7a2d4b4aa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1890877

Change-Id: I89601c1e9511d26091bd8c1669c35694e6590b61
2021-11-15 23:09:49 +00:00
Ivan Lozano
3e1bc6cc0d Merge "Use new soong_cc_rust_prebuilt.mk" 2021-11-15 22:19:46 +00:00
Rupert Shuttleworth
f1cb48b489 Merge "Allow libbuildversion to build with Bazel, but skip its 'tests' subdir for now." am: c0d9f8bd5e am: b75047f16f am: 86c453a41f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1887076

Change-Id: I94a14fab344a81b1eb7ce45dd8ceb0c870ec35b9
2021-11-15 10:10:00 +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
a3a2a61ea0 Merge "Add .PHONY for dist-for-goals targets" am: 8432238aa0 am: dbeb6b2eb7 am: 4733a58a28
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1889717

Change-Id: Ib63670f59320187fddddc609fbde75ba66a68bed
2021-11-12 08:02:45 +00: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
c0df0faef0 Remove modules from denylist after host C++ support am: 393002a913 am: 998284da66 am: 119106d3fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1889455

Change-Id: I3889812d935ed0b235bf5d0f611fe95a862a43a7
2021-11-11 20:35:03 +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
Christopher Parsons
039183d116 Merge "Support host platform cc builds" am: 4f5b548e74 am: 063cd58d11 am: 79f7491e78 am: d1da8a1fb1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1885868

Change-Id: I2b27a39083f8e4b439efd485f57dded4a3f7116e
2021-11-11 18:10:03 +00: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
011778d5ca Merge changes Ib3f4ee14,Iac22c9fd,Ibd78758c,I40d8696c,I2a2b10e4, ... am: 02ce1e7833 am: 6ea1d5be60 am: e68193dcbc am: dee1a86a44
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1885956

Change-Id: Ieb8b9c6da4ba3856577162ed25263b1871dd2fdf
2021-11-10 20:17:04 +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
f9fa105279 Merge changes from topic "soong-java-install" am: 8a709b149b am: 03a3ea3885 am: 932eda33a7 am: 3a075ff1a4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1881031

Change-Id: I472dde6b1ceb3531fad971371ba9570d254fe946
2021-11-10 17:58:19 +00:00
Colin Cross
74282ccf4b Move java module installation into Soong am: 24cc4be60b am: e2d3d87fcd am: 865a62d8ca am: 29c7bdd685
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1880650

Change-Id: I79a514d39a29b89f6783d059f38f333dc705ec73
2021-11-10 17:58:18 +00:00
Colin Cross
57c4a25fe3 Fix ctx.InstallFile calls for java modules am: 1d0eb7a9d0 am: c871fe905e am: 406461d954 am: 0978bcd3c1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1880649

Change-Id: Ifb924fd88bf86cac1e7e68c31743807a9a38f9c6
2021-11-10 17:58:17 +00:00
Colin Cross
abe20bc2eb Make HostJavaToolPath use pathForInstall am: ae5330a2d9 am: a8bd977845 am: e8aadabe21 am: d1d1dea4da
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1880648

Change-Id: If233fe656a367a67f58bd10762bba8b9716272da
2021-11-10 17:58:14 +00:00
Colin Cross
e2d3d87fcd Move java module installation into Soong am: 24cc4be60b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1880650

Change-Id: I9dfb4e0d5fd387258e5cf4cd9a7b73b4181fba69
2021-11-10 17:28:53 +00:00
Colin Cross
c871fe905e Fix ctx.InstallFile calls for java modules am: 1d0eb7a9d0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1880649

Change-Id: I4c74ca35e116674a46cd382a9d856092a76a0e6c
2021-11-10 17:28:52 +00:00