Commit graph

324 commits

Author SHA1 Message Date
Inseob Kim
0f46e7ca88 Add sepolicy prebuilt directories to soong_config
These are used when we build vendor sepolicy against old plat sepolicy.

Bug: 33691272
Test: build
Change-Id: Ia4fea509a2e122f24d1669a0908c4b3d2bb3b32c
2021-12-16 09:50:44 +09:00
Inseob Kim
1417880942 Add BoardPlatVendorPolicy to soong config
Bug: 205924657
Test: build
Change-Id: Ia0fe4fd916e539ee04aa0e8343068cc03bd9787c
2021-12-08 22:53:31 +09: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
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
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
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
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
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
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
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
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
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
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
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
Inseob Kim
a10ef270eb Add more sepolicy variables to soong_config
Bug: 33691272
Test: m selinux_policy on sc-dev
Change-Id: I4a7288d5f4ff99233fbdb56a8fd92da2d6f2ef7d
2021-09-15 03:04:53 +00:00
Rob Seymour
dc2cc0d8d7 Merge "Add module based host-tools snapshot" am: f6c37cc87d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1793067

Change-Id: I3a2bb2459677c14e3e99d654ed5ffb9b7dd09b21
2021-09-14 15:04:01 +00:00
Rob Seymour
f6c37cc87d Merge "Add module based host-tools snapshot" 2021-09-14 14:47:03 +00:00
Rob Seymour
925aa09ea1 Add module based host-tools snapshot
Add new module:
host_snapshot {
    name: "host-snapshot"
    deps: [
      (list of host tools)
    ],
    ...
}

Package host tools using android.PackagingBase to capture host tools and transitive packaging data.
Add JSON meta data to snapshot that allows snapshot to be installed via development/vendor_snapshot/update.py

Add support to generate a fake host snapshot of all host modules that is used to detect required
modules via development/vendor_snapshot/update.py.

Bug: 192556798
Bug: 194799048
Bug: 192896149
Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist -- check snapshot exists in dist

Change-Id: I849c4db801cd858408f6fe6a3ce69262a23a5be9
2021-09-13 21:29:14 +00:00
Anton Hansson
d841c3533a Merge "Add support for extension version in variables" 2021-09-01 09:00:15 +00:00
Anton Hansson
b021bf8c5a Add support for extension version in variables
This makes the sdk extension version usable in genrule cmds via %d.

Bug: 195281582
Test: current_sdkinfo module in packages/modules/common.
Change-Id: I82a90b83d23b0ba3779a943c2ad444bf5cf937da
Merged-In: I82a90b83d23b0ba3779a943c2ad444bf5cf937da
(cherry picked from commit e720c41f67a7e9309f1e6e48d5975383be7b2d28)
2021-08-31 17:41:41 +00:00
Treehugger Robot
61d7bc338f Merge "cmdline property in bootimg can be customized for debuggable builds" am: 4b2435bc79
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1813356

Change-Id: Ia4491bfb3c16e139bf40bde090c2274efea73b35
2021-08-31 02:00:51 +00:00
Jiyong Park
16e77a9b30 cmdline property in bootimg can be customized for debuggable builds
This change adds product_variables.debuggable.cmdline so that the kernel
cmdline arguments can be augmented for the debuggable builds.

To support that the type of the property has changed to string array.

Bug: 181936135
Test: inspect build.ninja
Change-Id: I81b3ead5187ccb378efabb87d1d15fbdb59d8e2f
2021-08-31 08:32:44 +09:00
Anton Hansson
35c86c07ed Add support for extension version in variables
This makes the sdk extension version usable in genrule cmds via %d.

Bug: 195281582
Test: current_sdkinfo module in packages/modules/common.
Merged-In: I82a90b83d23b0ba3779a943c2ad444bf5cf937da
Change-Id: I82a90b83d23b0ba3779a943c2ad444bf5cf937da
2021-08-27 17:35:40 +01:00
Xin Li
3eaa6bcecf Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I10ff6a5df76852f0a22fe3ac22df764528f07423
Change-Id: I71f2397f425a46d346e49ac422d256d7e049c7a2
2021-08-14 06:30:56 +00:00
Yuntao Xu
402e9b08e1 Add Platform_sdk_version_or_codename variable
1. Added a new product variable Platform_sdk_version_or_codename;
2. This variable is used to support the logic in the Android.bp file
when either the Platform_sdk_version or the Platform_sdk_codename is
used.

Bug: 195986342
Test: m CtsThemeHostTestCases (the module where the product variable is
used)
Test: TreeHugger

Change-Id: I6b952ce47fd4adc280aa3c7ef4185487558af9bc
2021-08-11 12:33:37 -07:00
satayev
ad6cb082a4 Merge "Rename UpdatableBootJars to ApexBootJars." am: 4102c0cc47 am: adb9e9f752
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1773912

Change-Id: Iecc5f48620b2d4e5390ab9a081b2193924bd0dda
2021-07-26 18:29:56 +00:00
satayev
4102c0cc47 Merge "Rename UpdatableBootJars to ApexBootJars." 2021-07-26 17:59:36 +00:00
Colin Cross
e9a7d0f732 Merge "Reland "Split the x86 host toolchain into glibc and musl variants"" am: dcbc76134d am: 632d3cf202
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1777148

Change-Id: Icca632d52e633a77b26e960bf11cb448d05bbf64
2021-07-24 03:09:27 +00:00
Colin Cross
e4e1d6a9bc Merge "Revert "Split the x86 host toolchain into glibc and musl variants"" am: c5647ca16e am: a199295f7a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1777147

Change-Id: Ie502ec0d1e461c7809175d8a27078e92bb9b7e00
2021-07-23 23:00:47 +00:00
Colin Cross
a45cf21495 Merge changes Idbeb4819,Ifc02f9e5 am: 7628e933b6 am: 038ac4c9bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1775369

Change-Id: Icb2f36d978b0aee2e883a510029a410d406d1ff3
2021-07-23 23:00:37 +00:00
Colin Cross
528d67e523 Reland "Split the x86 host toolchain into glibc and musl variants"
Split the x86 host toolchain into glibc and musl variants

Create new musl toolchains that are based on the existing glibc
toolchains, and add the necessary flags for musl compiles.

This relands Ifc02f9e5afa61ff758be98b0c962f3a4b53d0546 with changes
for I46672e3a096b6ea94ff4c10e1c31e8fd010a163c.

Bug: 190084016
Change-Id: Iaa9f7a50ff601155ecd73acc5701a2c226be66dc
Test: TestArchMutator
2021-07-23 22:25:36 +00:00
Colin Cross
5d6904e1cf Revert "Split the x86 host toolchain into glibc and musl variants"
This reverts commit 4fb4ef2242.

Reason for revert: crossed with aosp/1775072

Change-Id: Ied922850b810d82627ba4f9ee42f672cfe286c91
2021-07-23 22:20:29 +00:00
Colin Cross
4fb4ef2242 Split the x86 host toolchain into glibc and musl variants
Create new musl toolchains that are based on the existing glibc
toolchains, and add the necessary flags for musl compiles.

Bug: 190084016
Test: TestArchMutator
Change-Id: Ifc02f9e5afa61ff758be98b0c962f3a4b53d0546
2021-07-23 08:57:17 -07:00
Colin Cross
1dd4b94aa3 Merge "Remove Fuchsia support from Soong" am: b8d69871a8 am: be588a31d1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1774379

Change-Id: I9e0151ef36eb011f8c942469ca50eff0b781faf6
2021-07-23 15:22:42 +00:00
satayev
d604b210c4 Rename UpdatableBootJars to ApexBootJars.
Note that ART apex boot jars and core-icu4j are exceptions here as they
are not part of ApexBootJars. ART apex boot jars are defined in their
own variable, while core-icu4j is treated as a regular non-updatable
boot jar.

Bug: 191127295
Test: atest CtsClasspathsTestCases
Change-Id: I3cea3d82ef521655a1a5ffa8cae2258ab9d08bfc
2021-07-22 17:35:42 +01:00
Colin Cross
cb0ac95bde Remove Fuchsia support from Soong
Bug: 194215932
Test: m checkbuild
Change-Id: Id7d3964d9417f8b0938af9b168bb4c00cebe9390
2021-07-21 20:37:46 -07:00
Treehugger Robot
a5d5782e39 Merge "dexpreopt.config should be created even though unbundled image is built" am: 75d719fdd7 am: 1bc89a7af1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1730112

Change-Id: I4e91d1b293e84c69f032e148931357e2a050e10f
2021-07-15 09:28:40 +00:00
Jeongik Cha
4b073cd083 dexpreopt.config should be created even though unbundled image is built
Bug: 188179858
Test: compare dexpreopt_config.zip files from
 1. TARGET_BUILD_UNBUNDLED_IMAGE=true m dexpreopt_config_zip
 2. m dexpreopt_config_zip
(note that m clean should run between steps)

Change-Id: I36a6e8b10b9922cc5522accaf90af1aa05049a86
2021-07-15 09:57:49 +09:00
Treehugger Robot
1a02146ca9 Merge "Add libs to debuggable" am: 3b90bb9834 am: 3835adce04
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1744764

Change-Id: Id7c43d2e29aaba652016dd9cd7cbce47dcd2161c
2021-06-29 00:20:16 +00:00
Treehugger Robot
3b90bb9834 Merge "Add libs to debuggable" 2021-06-28 23:58:12 +00:00
Yifan Hong
8f323ae364 Add libs to debuggable
Test: pass
Bug: 190868302
Change-Id: Ia51d9bb97d2f413b515335534cd5a771da68ce4b
2021-06-28 15:39:55 -07:00
Liz Kammer
0425ac6016 Merge changes I4a5ea40c,I40ab16e3 am: 2f26595072 am: cc1961d51d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1726010

Change-Id: I4f1af9e641322edc52dd60206168e43c28d44d3e
2021-06-07 17:18:03 +00:00
Liz Kammer
6044fae776 Use maps in bazel *attribute types am: 9abd62d133 am: e90edc333c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1725151

Change-Id: I3d75f3405b099d21151334598a346f8c1c592e9b
2021-06-04 14:29:03 +00:00
Liz Kammer
47535c51fa Handle excludes_{shared,static}_libs
Bug: 188497994
Test: bp2build.sh
Change-Id: I4a5ea40cbd804e8542fe33143e4926abc0c6164f
2021-06-04 10:15:36 -04:00
Liz Kammer
9abd62d133 Use maps in bazel *attribute types
This is to simplify the process of resolving label + exclude labels
across the various configuration axes we have and across the various
properties/modules that use this behavior.

Test: ci/bp2build.sh && ci/mixed_droid.sh
Change-Id: I8efae3e75ddb365384f5caaf5bb504a5206618d3
2021-06-03 17:37:56 -04:00
Rupert Shuttleworth
e33da475f9 Make GetTargetProperties() aware of more complex targets, like 'android_arm', instead of just 'android'. am: c194ffbcf3 am: 42b29a5b40
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1712089

Change-Id: I2a68455e55701c2251d61a0db6855c34879fea93
2021-05-26 05:13:18 +00:00
Rupert Shuttleworth
c194ffbcf3 Make GetTargetProperties() aware of more complex targets, like 'android_arm', instead of just 'android'.
Test: Added new unit test and updated existing tests.

Test: bazel build //bionic/... //external/... //frameworks/... //system/...

Test: ./build/bazel/scripts/run_presubmits.sh

Change-Id: I250d1964f5cf42b92ddb929379d35d8c844423f7
2021-05-25 19:40:16 -04:00
Treehugger Robot
5221b7664b Merge "Handle arch/os-specific product variables" am: c1ae9243a4 am: 91743e86ce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1700827

Change-Id: Id941cac62a9a64a9d224038583b73421b432881e
2021-05-25 06:59:32 +00:00
Liz Kammer
e3e4a5f2d8 Handle arch/os-specific product variables
Bug: 183595873
Test: go test bp2build tests
Change-Id: I36e93ae1eb2943555dd304d5bdf62d995e77b437
2021-05-24 14:32:38 -04:00