Commit Graph

1174 Commits

Author SHA1 Message Date
Treehugger Robot
6ec14861b7 Merge "Introduce BazelStringOrLabelFromProp." am: 95ac23eeeb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2255856

Change-Id: I54a2fd05ede068d2d103769f7144a06aba66bf40
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-20 18:36:38 +00:00
Jingwen Chen
6817bbb3c8 Introduce BazelStringOrLabelFromProp.
Soong supports string properties, but they are overloaded, and can mean
one of three things:

* path reference
* module reference
* string literal

Bazel has different types: label and string attributes. Thus there needs
to be a way to categorize them correctly in bp2build.

This CL introduces a new function to be used on properties like
apex_key.private_key / apex_key.public_key, as well as
android_app.certificate / apex.certificate.

It is important to disambiguate the prop betenn a string literal
attribute or file/rule target label attribute, so this functions does
just that.  The new attributes are then further handled by their
respective macros (apex_key, android_binary, apex).

Bug: 253557437
Fixes: 253557437
Test: presubmits, new tests

Change-Id: Id8111cdd60d3aabcae7d17fe9da84d0ee3966023
2022-10-20 14:57:37 +00:00
Vinh Tran
7abf2c4f64 Merge "Default apex's compile_multilib to "first" in bp2build" am: 827db14152
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2243697

Change-Id: I6ffdf6e089443358751840e99981184ddd4d6a8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-17 14:37:59 +00:00
Vinh Tran
827db14152 Merge "Default apex's compile_multilib to "first" in bp2build" 2022-10-17 14:12:29 +00:00
Vinh Tran
8f5310f90c Default apex's compile_multilib to "first" in bp2build
In Soong, decodeMultilib, used to get multilib to determine the dep variations, return "first" if defaultMultilib is set to "common". apex sets defaultMultilib to "common" which means equivalent compileMultilib in bp2build for apex should be "first" (See new Soong unit tests for more context).

This CL fixes bp2build for apex to be more correct.

Bug: 251559512
Test: go tests
Change-Id: Id1cb4407980fc1fab91822c81326f37fb4adfa0a
2022-10-13 16:59:30 -04:00
Colin Cross
b5645cb929 Merge "Move checking of minApiForArch for apex into cc" am: 21c71a35bd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2243980

Change-Id: Ie2123163a7d78d023db91d857dd012b83c3898f5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-13 20:56:51 +00:00
Colin Cross
8ca61c1820 Move checking of minApiForArch for apex into cc
I49220cbec628f1508709741dc56b62aaac7786d9 attempted to allow
apexes to depend on native code whose min_sdk_version had been
increased to meet the minimum supported API level for a new
architecture.  It wasn't quite right, as it assumed that the
primary architecture of the apex would be the newest, and
it applied to all dependencies, not just ones that were
specfiic to the new architecture.  Move the checking into
cc.ShouldSupportSdkVersion, where it can be specific to an
individual architecture variant.

Bug: 250918230
Test: TestApexMinSdkVersion_MinApiForArch
Change-Id: I303cf485ba54b4c6bf63a9f9b49286ff9b2c9c83
2022-10-07 16:04:50 -07:00
Xin Li
4369cdc509 Merge tm-qpr-dev-plus-aosp-without-vendor@9129937
Bug: 248070379
Merged-In: I368aabf4d032c02773416f27affa12eb40e77b40
Change-Id: I7747fa3ef0bb518c1b2aedd9170b9d4d880dc3af
2022-10-06 11:59:15 -07:00
Colin Cross
ec731a83e3 Merge "Use MinApiForArch to set minSdkVersion for apexes" 2022-10-05 22:03:22 +00:00
Colin Cross
a497606f1d Merge changes I154a6f3a,I79f0c20a,I605ae9af,I647c7305,I95e96e3e, ...
* changes:
  Move fuzzer's CollectAllSharedDependencies into GenerateAndroidBuildActions
  Support AllowMissingDependencies in prebuilt_apex modules
  Support AllowMissingDependencies for apex dependencies
  Add AllowMissingDependencies support for prebuilt_etc module with no src property
  Make OutputFileForModule work for AllowMissingDependencies
  Fix panics when target arch is riscv64
2022-10-05 21:25:17 +00:00
Colin Cross
56534df14f Use MinApiForArch to set minSdkVersion for apexes
Apexes for new architectures have to increase their minSdkVersion
to the minimum supported version for the architecture.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I49220cbec628f1508709741dc56b62aaac7786d9
2022-10-04 19:15:45 -07:00
Colin Cross
1d48715961 Support AllowMissingDependencies for apex dependencies
Use android.OutputFileForModule instead of cc.Module.OutputFile,
which will already handle the AllowMissingDependencies case.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I605ae9afe06ac450adec1d2a856e529e45ed5cb5
2022-10-04 16:38:14 -07:00
Colin Cross
a2aaa2fdef Fix panics when target arch is riscv64
Fix panics in api_level.go and apex.go when using riscv64 as the target
arch.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I85c7685f3d14fa2dc7ffbcdea7f490feca304ef7
2022-10-04 10:53:07 -07:00
Jingwen Chen
bea58093b4 Share certificate bp2build between android_app and apex.
The certificate module is handled the same in Soong between android apps
and apexes, so share the bp2build code as well.

There are a few changes in this CL:

- If override_apex.certificate is unset, the generated apex also unsets
  it. This prevents the generated apex from using the base apex's
  certificate, which is most likely incorrect (e.g. google variant using
  the cert for the aosp variant). Instead, rely on the default
  certificate handling in the macro.
- If the certificate prop is a string, then it gets generated into
  certificate_name in order to disambiguate. This behavior is identical
  to android_app.

Test: added various unit tests.

Bug: 249089160
Fixes: 249089160
Change-Id: I99e18964ff546429a985d0f64dc21e2c69d35d9d
2022-10-03 09:20:47 +00:00
William Escande
f03a3b00fe Remove obsolete com.android.bluetooth apex
Also remove the soong hack that allowed us to build during the
transition

Bug: 243054261
Test: build + TH
Merged-In: I60bac1ec687f03a38f38240969a1c38a8e5bf92c
Change-Id: I60bac1ec687f03a38f38240969a1c38a8e5bf92c
2022-09-14 21:09:50 +00:00
William Escande
5c832be715 Remove obsolete com.android.bluetooth apex
Also remove the soong hack that allowed us to build during the
transition

Bug: 243054261
Test: build + TH
Change-Id: I60bac1ec687f03a38f38240969a1c38a8e5bf92c
2022-09-14 21:08:53 +00:00
Dennis Shen
4dd7ab8f24 Merge "Place native shared libs for soong build DCLA." am: ee959f49eb am: dec8ae572d am: 51ec697e2d am: 46df0dcbc7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2172270

Change-Id: I7c8fa8f14cc82e94f1b179722c2240f9a6c36c24
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 18:45:48 +00:00
Dennis Shen
ee959f49eb Merge "Place native shared libs for soong build DCLA." 2022-08-19 17:23:24 +00:00
Dennis Shen
af41bc13da Place native shared libs for soong build DCLA.
Currently, DCLA is built in rapid. With new train build, DCLA will be
directly built in soong, just like a regular module, refer to
b/239679485. In old rapid built DCLA, native shared libs are placed the
following way inside apex:

/lib(64)?/foo.so/<sha256 foo.so>/foo.so

The sha256 hash is used to differentiate different libs. To ensure the
same lib placement in soong built DCLA, three changes are made:

(1) in apex.go, added an apex soong module property called
dynamic_common_lib_apex to indicate if this apex is a DCLA
(2) in builder.go, update apexRule to call into run_apexer binary
instead of apexer binary. run_apexer binary is a wrapper of apexer
binary. If it is DCLA, the wrapper binary will place the native
shared libs in desired location and update canned_fs_config accordingly.

TEST: manuualy added this field to adbd. Local build by banchan
and then inspect the payload image contensts. All libs are proprely
placed.

BUG: 241096765

Change-Id: I2a5e7ea75a6e9a7af1932ff7dccb9dc3a3785db9
2022-08-18 18:25:19 +00:00
Spandan Das
8e742d4188 Merge "Spellcheck" am: 6b7c1dbf88 am: d6068de346 am: 88654a8b88 am: 8db5f3ffd9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2175925

Change-Id: Ia17fd408f3ba2d878beb0265dc4c5bd9ce1bb243
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-05 23:35:02 +00:00
Spandan Das
d6068de346 Merge "Spellcheck" am: 6b7c1dbf88
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2175925

Change-Id: I19195f0a91317762b24bb99c10c06bab79fcf455
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-05 21:50:03 +00:00
Spandan Das
a5f39a12de Spellcheck
This should fix a spelling error that crept in during a documentation CL

Test: N/A
Change-Id: I085f7fd1399f06e3b8808ed54963abce0e06f7fe
2022-08-05 02:36:36 +00:00
Treehugger Robot
88f1d5d368 Merge "Implement mixed builds for apex modules, take 2." am: 88e7512572 am: 953254b150 am: 1c0be10898 am: e4fe8254fe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2167802

Change-Id: If608e5c6aaaabcef7c2586a19f6779cca91910d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-30 00:26:42 +00:00
Treehugger Robot
953254b150 Merge "Implement mixed builds for apex modules, take 2." am: 88e7512572
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2167802

Change-Id: I9efd3c2e6f8c93aa8d1add3cbe6802e24d73b084
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 23:06:00 +00:00
Sasha Smundak
fe9a5b833d Implement mixed builds for apex modules, take 2.
* Add ApexCqueryInfo to obtain apex artifacts used by the makefile
  generator and downstream modules
* Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse
* Implement android.MixedBuildBuildable for modules
* Enable mixed build for apex modules with payload_type:"image"

The first take 6a2b7c40b was setting compressed APEX suffix incorrectly, and
was reverted in 8a3c91494.

Fixes: 239925080 239695521 232085015
Test: treehugger
Change-Id: I1720f8db3c7cc773183d25a815d9b7eeaf7c73ad
2022-07-28 14:43:50 -07:00
Martin Stjernholm
49e037486b Merge "Revert "Implement mixed builds for apex modules."" am: 0bb7f0494e am: 2fb081fd28 am: 3346a24aef am: 87b3ef440b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2165026

Change-Id: I277e0641c4423109c5f8b42b275d8e462f2d891e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 16:04:08 +00:00
Martin Stjernholm
2fb081fd28 Merge "Revert "Implement mixed builds for apex modules."" am: 0bb7f0494e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2165026

Change-Id: I375077ee73ba18308d0841ca76956757935dd992
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 14:08:18 +00:00
Martin Stjernholm
0bb7f0494e Merge "Revert "Implement mixed builds for apex modules."" 2022-07-26 13:52:18 +00:00
Martin Stjernholm
8a3c914942 Revert "Implement mixed builds for apex modules."
Revert submission 2147387-mixed_builds

Reason for revert: Breaks zipapex build on git_master-art-host
Bug: 239925080
Reverted Changes:
I9f1e03e5e:Implement mixed builds for apex modules.
I13d9a0270:Add container and bundle encription key pairs to t...

Change-Id: I0eaad4dd81cac16d634f4c9cec18137a38e30d47
2022-07-26 09:35:39 +00:00
Paul Duffin
e3e8ba7745 Merge "Export any platform_compat_config used by apex to sdk snapshot" am: 69d09f49ec am: fa26f65155 am: 4dcb86de2c am: a984b2b876
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2160797

Change-Id: I416dc6c804b2b110946d879f10fcbe1b5683132e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 23:39:41 +00:00
Paul Duffin
fa26f65155 Merge "Export any platform_compat_config used by apex to sdk snapshot" am: 69d09f49ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2160797

Change-Id: Icb98af219a66d7ad48518ac49c6150798361f62b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 22:29:39 +00:00
Paul Duffin
fcf79850d8 Export any platform_compat_config used by apex to sdk snapshot
Previously, the platform_compat_config modules needed to be explicitly
listed in the sdk snapshot and the apex. This change will automatically
export them to the sdk snapshot when the apex is listed in its apexes
property.

Bug: 232401814
Test: m tethering-module-sdk
      # Before this change the generated snapshot did not contain the
      # platform_compat_config, after this change it did.
      m art-module-sdk
      # As that explicitly specifies the platform_compat_config in its
      # compat_configs property this change has no effect.
Change-Id: Ia854b9a52db2b1619fca41a387ce98d7f9f9efe9
2022-07-20 14:18:24 +00:00
Alexander Smundak
8e728f144e Merge "Implement mixed builds for apex modules." am: 9ec1ff98b7 am: f7ccf8c822 am: 34a6bda87e am: 035e5fddd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2104104

Change-Id: I65ea31f7232738d87ed3319c684475fa7d44d561
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 15:01:44 +00:00
Alexander Smundak
f7ccf8c822 Merge "Implement mixed builds for apex modules." am: 9ec1ff98b7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2104104

Change-Id: I1fb794735088c8d69bd425cbe6a9d4b62b9ca43d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 13:59:21 +00:00
Sasha Smundak
6a2b7c40b3 Implement mixed builds for apex modules.
* Add ApexCqueryInfo to obtain apex artifacts used by the makefile
  generator and downstream modules
* Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse
* Implement android.MixedBuildBuildable for modules
* Enable mixed build for apex modules with payload_type:"image"

Bug: 232085015
Test: treehugger
Change-Id: I9f1e03e5e7a5b5dde35a5db10c253069543ac973
2022-07-18 13:34:36 -07:00
Paul Duffin
3611e6609d Merge "Add apexes property to sdk" am: 0d89b3dc27 am: 4057d6455a am: da014983b3 am: 00e64f4aa0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2096447

Change-Id: Icaef07d099761c689ce7556b04b655971f30b4c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 12:08:22 +00:00
Paul Duffin
4057d6455a Merge "Add apexes property to sdk" am: 0d89b3dc27
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2096447

Change-Id: Ib57f709febd0827967afcd301825d7dae568b67a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 10:59:52 +00:00
Paul Duffin
4e7d1c43e2 Add apexes property to sdk
Specifying an apex in the apexes propety will cause all the
*classpath_fragments that are contents of the APEX to be automatically
added as members of the sdk and appear in the snapshot.

The purpose of this change is to dedup the APEX and sdk definitions and
try and avoid some of the issues that we have been finding while
attempting to build against the prebuilts.

Two tests, one each for bootclasspath_fragment and
systemserverclasspath_fragment, have been refactored to compare the
output when adding the *fragment to the sdk directly of via the APEX.
That ensures switching to use the APEX will not change the sdk snapshot
unless it was previously missing a *fragment.

There was also a slight difference in where the hidden API flags were
copied from. That should have no impact on the output as the flags are
identical.

The sdk snapshot generation needed some tweaks to avoid generating a
prebuilt for the APEX.

Bug: 232401814
Test: m nothing
Change-Id: I7aaf16a3a0ab4bebf97765d1484215cc008dc4b8
2022-07-06 15:58:43 +00:00
William Escande
49bc23b601 Clear apex.go entries for bluetooth libs am: 89bca3f301
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/19111518

Change-Id: Ib43164dedb4fcd90addcecd570f195e08dc6428b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-30 00:55:59 +00:00
Xin Li
42307c80c7 Merge "Merge tm-dev-plus-aosp-without-vendor@8763363" into stage-aosp-master 2022-06-29 21:16:54 +00:00
Treehugger Robot
4f7d0eb241 Merge "Refactor apexBundle code." am: 114ad30d76 am: 7028b50308 am: a416730bf1 am: 05941e95e1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2138053

Change-Id: I41db417767906075c49c274bab766773e5cebab2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-29 09:17:56 +00:00
Treehugger Robot
a416730bf1 Merge "Refactor apexBundle code." am: 114ad30d76 am: 7028b50308
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2138053

Change-Id: I20c91b9425adffb44115dfc59e4b40cfa562b669
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-29 08:32:59 +00:00
Sasha Smundak
6f9e91d5e9 Refactor apexBundle code.
Move dependency walker out of GenerateAndroidBuildActions, reduce IDE
warnings.

Test: treehugger
Change-Id: I520c59772b1da7102d2a2364b2c56789455ea7fb
2022-06-28 22:47:43 -07:00
William Escande
89bca3f301 Clear apex.go entries for bluetooth libs
The module availability to Bluetooth is currently hard-coded in apex.go.
We are in the process of cleaning the apex.go by adding the availability
in each required module

Test: Build + TH + boot phone & use bluetooth
Bug: 216433795
Change-Id: I883a12f89a6d7eb43778e04ac50d6af38dd97116
2022-06-29 01:04:15 +00:00
William Escande
0ac940fab3 Merge "Clear apex.go entries for bluetooth libs" into tm-qpr-dev am: aec111952d
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18743691

Change-Id: Ied2610e2599dea44e338b3d3f51bd5e873bf3400
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-28 23:25:51 +00:00
William Escande
aec111952d Merge "Clear apex.go entries for bluetooth libs" into tm-qpr-dev 2022-06-28 23:09:56 +00:00
Oriol Prieto Gascó
cda10e187b Merge "Hard-code apex_available handling for the btservices apex" into tm-dev am: 3bb9d7a8d9 am: bb63423da1 am: 7b8cb64821
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18972588

Change-Id: I7742de88e124be497b0f60a73fd81852c464848d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 18:38:07 +00:00
Oriol Prieto Gascó
7d7bc5bef1 Merge "Hard-code apex_available handling for the btservices apex" into tm-dev am: 3bb9d7a8d9
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18972588

Change-Id: I5c6cc4bc32174ba0739d7ed6b42ae0b1685c4ef6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 17:43:25 +00:00
Oriol Prieto Gasco
8132fbf8c1 Hard-code apex_available handling for the btservices apex
Bug: 236192423
Test: TH
Change-Id: Ie095ae22704a80e0ec171b1bb3fdc995f95a1c64
2022-06-19 23:13:25 +00:00
Treehugger Robot
9f7fa50427 Merge "Restrict IsSanitizerEnabled() to android.Config()." am: 1c6502eba2 am: 7125d5d606
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2127446

Change-Id: Ie6b578793fa05304b869795af4e0ca4455b75d5b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 23:05:53 +00:00