Commit Graph

3190 Commits

Author SHA1 Message Date
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
553a31be9d Support AllowMissingDependencies in prebuilt_apex modules
Arch-specfic prebuilt_apex modules may be missing prebuilts for new
architectures.  Mark the module as missing dependencies and allow
build analysis to continue when AllowMissingDependencies is set.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Change-Id: I79f0c20a0c9443fe443f9ed9bc846aa649f6b6a6
2022-10-04 16:38:14 -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
Treehugger Robot
649ca6995e Merge "Put base APK when AppSet is included in APEX" am: b5a04d7905 am: 361cfb2309 am: 8c15660653 am: 8abe2b3242
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2238204

Change-Id: Ifd26e31b97da1b16fed3f24c2ac531734b1d5a1f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-30 06:01:52 +00:00
Treehugger Robot
b5a04d7905 Merge "Put base APK when AppSet is included in APEX" 2022-09-30 03:44:21 +00:00
Jiyong Park
4169a25f54 Put base APK when AppSet is included in APEX
This change fixes a bug that base APK of an AppSet is not put into the
APEX.

Bug: 236299724
Test: m nothing
Change-Id: I1010ec66d8551fcc1e2d9119be7ecdba22186607
2022-09-29 21:30:25 +09:00
Treehugger Robot
06251a633f Merge "Tag apex_set's 'set' config with android:"path"" am: 76832f5b10 am: b56c637eef am: f8695c4a31 am: b5fcdcd286
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2232749

Change-Id: Id68674672047d67df93137ff256c06775822423b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-27 23:32:52 +00:00
Pranav Gupta
eba03b0935 Tag apex_set's 'set' config with android:"path"
This allows apex_set's set config to use other soong modules as a dependency

Bug:249169376
Change-Id: I8da20c6f474328d63d9aa3811f94e3e04b89ea4c
Test: Added a test case to check soong module assignment to the set field of an apks_set rule
2022-09-27 16:29:36 +00:00
Jiyong Park
492f71aba8 Merge "Use PackedAdditionalOutputs when reading apk_set for canned_fs_config" am: afc97f0209 am: 48f6bdf8c3 am: 2a0ae316be am: eced5a2c57
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2230649

Change-Id: I1c207b02eebb9a9d952ce37e65773a91ee60fe61
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-27 01:16:13 +00:00
Jiyong Park
e1b6914f58 Use PackedAdditionalOutputs when reading apk_set for canned_fs_config
When an app_set module is included in an APEX, we don't use its
`builtFile` which is the main APK, , but `PackedAdditionalOutputs()`
which is the zip file where all APK files (main + additional) files are
packed. We then unzip them into the corresponding directory inside the
APEX.

However, `buildFile` still has been used when constructing
canned_fs_config whose content should match with what are actually
included in the APEX. Fixing the bug by using
`PackedAdditionalOutputs()` instead.

Bug: 236299724
Test: m nothing (apex_test.go amended)
Test: follow https://buganizer.corp.google.com/issues/236299724#comment34
* mkdir for-236299724
* cd for-236299724
* repo init -u https://android.googlesource.com/platform/manifest -b
* master --partial-clone --clone-filter=blob:none
* repo sync -c -j8
* unzip -l ~/Downloads/mainline_t_2022_jun_t1004275.zip | cut -c31- | grep | xargs rm -f
* unzip ~/Downloads/mainline_t_2022_jun_t1004275.zip
* source build/envsetup.sh
* choosecombo 1 aosp_arm64 userdebug
* m com.android.extservices.gms

Change-Id: If9752c07748300dbb963568de4e879b041b0a206
2022-09-26 14:55:35 +09:00
Treehugger Robot
2eade656df Merge "Remove obsolete com.android.bluetooth apex" 2022-09-16 05:28:06 +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
Sam Delmerico
a75a69556f Merge "add jacocoagent by default to Java modules" am: 43c0eb17ae am: 7fd3c3b1f9 am: ea13cbadd0 am: bdbf431271
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2208216

Change-Id: I10879601459847b2b7cd4b4d75b7353e96188e52
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-12 17:04:19 +00:00
Sam Delmerico
1e3f78f866 add jacocoagent by default to Java modules
On coverage builds, R8 will fail to properly optimize and fail the build
if ignore_warnings: false, because jacoco injects dependencies on
jacocoagent classes, but the jacocoagent library is not part of the
classpath libraries passed in to R8 in its arguments.

Instead we can add jacocoagent as a libs dependency for these modules so
that it will get pulled into the r8 flags.

Bug: 243903417
Test: m
Change-Id: Icc24cc260b896fc800125a0318308d823ccf7a83
2022-09-09 16:50:38 -04:00
Sam Delmerico
1b332cd0c3 Merge "jacoco libs dependency for instrumented libraries" am: 3dca115dda am: 882253d037 am: 370f703987 am: a8b4516b59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2201682

Change-Id: I1e2ece9e538ed7615ad396b3a3ed3e48af80b7e6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-02 21:49:35 +00:00
Sam Delmerico
c75937264b jacoco libs dependency for instrumented libraries
On coverage builds, R8 will fail to properly optimize and fail the build
if ignore_warnings: false, because jacoco injects dependencies on
jacocoagent classes, but the jacocoagent library is not part of the
classpath libraries passed in to R8 in its arguments.

Instead we can add jacocoagent as a libs dependency for these modules so
that it will get pulled into the r8 flags.

Bug: 243903417
Test: add optimize.ignore_warnings: false to NetworkStackAppDefaults &&
  make SKIP_ABI_CHECKS=true PRODUCT=cf_x86_phone-userdebug \
  EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true \
  CLANG_COVERAGE=true COVERAGE_PATHS="" \
  TARGET_USERDATAIMAGE_PARTITION_SIZE=17179869184 \
  SKIP_BOOT_JARS_CHECK=true \
  NetworkStack
Change-Id: I71313b1fd35437ec52890f5c30b3fd1381c7c3d2
2022-08-31 16:15:27 -04: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
Paul Duffin
dd9ff24dcd Merge "Reformat build/soong for go 1.19" am: 29d1667846 am: e20a796b76 am: d1d37b3056 am: 72b685eb29
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2186600

Change-Id: Ib42f4bbda790f2e32bcb27c1acacb6412d07d2ef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 12:23:09 +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
Colin Cross
d079e0b270 Reformat build/soong for go 1.19
Test: none
Change-Id: I132368f0fcbdb5ea088b5b84dbe4ccfdd9e94cad
2022-08-17 10:43:13 -07:00
Treehugger Robot
9e5b2e06af Merge "Introduce cc_api_library" am: 3a4088dfd1 am: d03ea3d4f1 am: 9076168ab5 am: 560087b69e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2162587

Change-Id: I9560f854f30e2a42e506e8c357d9d614872f2db2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 06:03:34 +00:00
Treehugger Robot
d03ea3d4f1 Merge "Introduce cc_api_library" am: 3a4088dfd1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2162587

Change-Id: I0902c1a7757db36b7fd4564c356f5f6046d3d1af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 04:35:55 +00:00
Treehugger Robot
3a4088dfd1 Merge "Introduce cc_api_library" 2022-08-10 04:12:32 +00:00
Kiyoung Kim
487689eaee Introduce cc_api_library
Introduce cc_api_library, which reflects imported API from other
inner-tree. This cc_api_library module type will later refer from
the other ninja module which generates stub library from the interface
description.

Tested environment :
* original libc definition has been removed temporarily, to ensure that
  imported api stub library is being used from build
* Added new definition of libc as below
 cc_api_library {
  name: "libc",
  arch: {
    x86: {
      src: "libs/x86/libc.so",
    },
    x86_64: {
      src: "libs/x86_64/libc.so",
    },
  },
  header_libs: [
    "libc_headers",
  ],
  export_header_lib_headers: ["libc_headers"],
  min_sdk_version: "9",
  vendor_available: true,
 }

Bug: 236087698
Test: `ALLOW_MISSING_DEPENDENCIES=true m vendorimage` succeeded
Change-Id: I67070b0f3561aa2afd73b6c1c0fdf4255218baac
2022-08-10 10:12:18 +09: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
f31eb7ded3 Merge "Remove obsolete notice property." am: 0ea404eb36 am: 13d06a134f am: 941ca2a81d am: 054a7691c7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2156349

Change-Id: I45e40a639aac2b0de6ce07e69a19ad3f64f63ca7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 18:53:54 +00:00
Treehugger Robot
13d06a134f Merge "Remove obsolete notice property." am: 0ea404eb36
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2156349

Change-Id: Ib08598705dbf4904d50f18b1b1c5c206557cf197
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 17:46:17 +00:00
Treehugger Robot
0ea404eb36 Merge "Remove obsolete notice property." 2022-08-02 17:22:42 +00:00
Jingwen Chen
c71569ef5d Export default apex version from updatable_modules.go to Bazel's am: 7810e17e54 am: 88516533e1 am: 0e0dd7d4c7 am: 08f1333ec8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2168944

Change-Id: I56bc811860f0953652de4fb1ca90e9a9d0adb3c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 13:20:34 +00:00
Jingwen Chen
88516533e1 Export default apex version from updatable_modules.go to Bazel's am: 7810e17e54
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2168944

Change-Id: Ic5fde55e1dc90d60772635458f16e5626cf8b41c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 12:21:45 +00:00
Alexei Nicoara
f99fac8f5a Merge "Moving default version outside of apex package" am: 21b027dca8 am: 18ecb86247 am: 65e6a8c7b9 am: 4e1ef5f5b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2167105

Change-Id: I262912a958483563fe88a66d1fec600fc36b3617
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 11:21:46 +00:00
Jingwen Chen
7810e17e54 Export default apex version from updatable_modules.go to Bazel's
apex_toolchain through soong_injection.

This is necessary to keep both Bazel and Soong in sync.

Test: presubmit
Bug: 238723069
Fixes: 238153998

Change-Id: Ibf4a8ed91d358dc7800c10e4112485a52f0606bb
2022-08-02 10:11:36 +00:00
Alexei Nicoara
18ecb86247 Merge "Moving default version outside of apex package" am: 21b027dca8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2167105

Change-Id: I92100d519f4744678a4c1082c460daddc085cb56
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 09:18:23 +00:00
Alexei Nicoara
7579b67ef9 Moving default version outside of apex package
The default version needs to be used by both apex and apk updatable
modules. Moving it to android package so it can be accessed without
circular dependencies.

Test: presubmit
Bug: 231691162

Change-Id: Icafd50d0b065e89a115ae9c9b6ea55adf2730b49
Merged-In: Icafd50d0b065e89a115ae9c9b6ea55adf2730b49
2022-08-01 16:28:48 +01: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
Treehugger Robot
88e7512572 Merge "Implement mixed builds for apex modules, take 2." 2022-07-29 22:43:19 +00:00
Bob Badour
0cc5facf79 Remove obsolete notice property.
Bug: 192434786

Test: m droid dist

Change-Id: I0f384ae895cebab9732448b82db600c67eb8f711
2022-07-29 17:54:40 +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
Ken Chen
adc07dce61 Merge "Disallow '_' in bpf source name" am: d8cded58fe am: 9b259932f7 am: 8219d90a58 am: 318d8c51f2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2147825

Change-Id: Ib33a7069c9301d4836694f16fb5926f6ec5d8415
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-28 08:50:51 +00:00
Ken Chen
9b259932f7 Merge "Disallow '_' in bpf source name" am: d8cded58fe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2147825

Change-Id: Ia3ea5b08ccd37f096ad7d9cd053a45b25b045ba3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-28 07:21:56 +00:00
Ken Chen
d8cded58fe Merge "Disallow '_' in bpf source name" 2022-07-28 07:00:12 +00: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