Commit graph

6731 commits

Author SHA1 Message Date
Zyan Wu
b7550aa09a Don't panic if no certificates found
Getting the first certificate will panic if there are no certificates,
which can happen when AllowMissingDependencies is set and the
certificate property is a module reference to a missing module.
Only get the first certificate if the list is not nil.

Use mainCertificate since it handles the logic already.

Test: TestAppMissingCertificateAllowMissingDependencies
Bug: 283102635
Change-Id: I8b27f65aa7d071041171ad45ac52bf47fa31bf2b
2023-05-18 15:46:31 +08:00
Cory Barker
eaf7f5ecb9 Fix Soong code, remove dead code, and clean up code for Java fuzz
(cherry picked from commit fdf043a7b1)

Test: built fuzz targets locally and tested them with Jazzer
Change-Id: I3ff487ba4e34289e0f53f2077463f524f4bf4f11
2023-05-17 19:07:16 +00:00
Colin Cross
9801f9d7f7 Merge "Fix addrsig warnings" 2023-05-15 19:07:58 +00:00
Rico Wind
1f65e0d0a2 Merge "Ensure outputs correctly declared for proguard config in R8" 2023-05-15 03:41:30 +00:00
Jiakai Zhang
4abf2f4540 Merge changes from topic "boot-image-b280776428"
* changes:
  Dexpreopt ART jars and framework jars together.
  Unify installDirOnHost and installDirOnDevice.
  Remove the ability to install boot images by bootclasspath_fragments.
  Prepare tests for dexpreopt changes.
2023-05-12 10:48:44 +00:00
Rico Wind
b565f2f0df Ensure outputs correctly declared for proguard config in R8
Bug: 281081834
Test: manually inspect the file
Change-Id: Iaa8a99f1f1ae62b853e2a8dad613c2c6c886ff48
2023-05-12 12:30:07 +02:00
Jiakai Zhang
c08c162b5a Dexpreopt ART jars and framework jars together.
Bug: 280776428
Test: atest art_standalone_dexpreopt_tests
Test: -
  1. m
  2. Check .invocation file (http://gpaste/6498044089466880)
  3. Check files in $ANDROID_PRODUCT_OUT/system/framework/x86_64
Test: -
  1. m dist
  2. Check files in out/dist/boot.zip
Test: -
  1. art/tools/buildbot-build.sh --host
  2. m test-art-host-gtest
  3. art/test/testrunner/testrunner.py --host
Test: m build-art-target-golem
Change-Id: I89490252e56a05edab03fdddc6539fa4d7f79756
2023-05-11 19:04:17 +01:00
Jiakai Zhang
09d88df040 Unify installDirOnHost and installDirOnDevice.
These two fields never do what they are described to do. This CL unifies
them to avoid the confusion.

Bug: 280440941
Test: m
Change-Id: I3652d73a50832a2e494d9f5cae750f5fc38293b4
2023-05-11 18:25:18 +01:00
Jiakai Zhang
b47caccbc0 Remove the ability to install boot images by bootclasspath_fragments.
We don't need this anymore because we are going to compile ART jars and
framework jars together.

Bug: 280776428
Test: m
Change-Id: I070157530449a1bb5779e25984c367df3dde7b36
2023-05-11 18:25:18 +01:00
Jiakai Zhang
b95998be73 Prepare tests for dexpreopt changes.
After this change, there is a clear separation between tests that are
related to dexpreopt and tests that are not. The former uses
PrepareForTestWithDexpreopt, while the latter uses
PrepareForTestWithJavaDefaultModules. The benefit is that the latter
will no longer affected by any dexpreopt changes.

Bug: 280776428
Test: m nothing
Change-Id: Ib957765b9287d51c082e0a33cee17a6bb56daeef
2023-05-11 18:24:44 +01:00
Alix Espino
98b86f76b1 Merge "Delete android/rules.bzl file" 2023-05-11 15:19:35 +00:00
Alix Espino
ea4b67d72c Merge "Delete kotlin/rules.bzl file" 2023-05-11 13:34:26 +00:00
Treehugger Robot
a321926546 Merge changes from topic "remove_suffixes"
* changes:
  Propagate shared library destination path through FilesToZip
  Add -e argument to soong_zip to allow setting an explicit filename
  Support removing suffix for device specific prebuilt during build
2023-05-10 20:30:11 +00:00
Romain Jobredeaux
ea48fdc6f8 Merge "Map prebuilt_apis labels to Bazel's manually generated ones." 2023-05-10 18:23:51 +00:00
Treehugger Robot
26446238d6 Merge "Don't translate "required" to unsupported "data" in android_app." 2023-05-10 18:14:52 +00:00
Alix
a381cd1973 Delete android/rules.bzl file
Bug: 277800767
Test: treehugger
Change-Id: I578bf63e33d15219812c2c17117186c74323d8d3
2023-05-10 15:33:10 +00:00
Colin Cross
80462dc040 Propagate shared library destination path through FilesToZip
Shared libraries in fuzz zip files may have a different filename than
their source file, for example when the source file is a prebuilt in
the source tree.  Propagate the computed library name through
FilesToZip to soong_zip to use the correct name in the zip file.

Bug: 254867347
Test: builds
Change-Id: Ib0def8decdbec7842b8e1a9056fac373d743bac0
2023-05-09 23:19:31 +00:00
Romain Jobredeaux
56d41d0725 Don't translate "required" to unsupported "data" in android_app.
Bug: 228514588
Test: Presubmits
Change-Id: Ib964073d24f03cc3cdd389ba28b44ed96b61d841
2023-05-09 16:37:23 -04:00
Alix Espino
9241da9662 Merge "Delete java/rules.bzl file" 2023-05-09 20:18:36 +00:00
Jiakai Zhang
90c69f71c4 Merge changes from topic "revert-2580631-revert-2574032-XXTWCJDTDQ-YJWXHQZNPJ"
* changes:
  Revert^2 "Generate app profiles even if dexpreopt is disabled."
  Revert^2 "Generate boot image profiles even if dexpreopt is disabled."
2023-05-09 13:50:55 +00:00
Jared Duke
fda5890f24 Merge "Fix Proguard configuration output from R8 invocation" 2023-05-08 22:20:11 +00:00
Jiakai Zhang
cf61e3c591 Revert^2 "Generate app profiles even if dexpreopt is disabled."
Revert submission 2580631-revert-2574032-XXTWCJDTDQ

Reason for revert: Fixed build breakages

Reverted changes: /q/submissionid:2580631-revert-2574032-XXTWCJDTDQ

Bug: 280440941
Test: lunch aosp_cf_riscv64_minidroid-userdebug && m UNSAFE_DISABLE_HIDDENAPI_FLAGS=true dist
Test: Disable dex2oat on host (to simulate macOS) and build
Change-Id: I6090b4b74cedb6d129fcbeef58d075c8ccdcc4e2
2023-05-08 21:29:23 +01:00
Jiakai Zhang
bc698cd28a Revert^2 "Generate boot image profiles even if dexpreopt is disabled."
Revert submission 2580631-revert-2574032-XXTWCJDTDQ

Reason for revert: Fixed build breakages

Reverted changes: /q/submissionid:2580631-revert-2574032-XXTWCJDTDQ

Bug: 280440941
Test: lunch aosp_cf_riscv64_minidroid-userdebug && m UNSAFE_DISABLE_HIDDENAPI_FLAGS=true dist
Test: Disable dex2oat on host (to simulate macOS) and build
Change-Id: I5f7f746ca1d4da660fe0c40115e6c71750dfdccc
2023-05-08 21:28:13 +01:00
Romain Jobredeaux
8242b43df8 Map prebuilt_apis labels to Bazel's manually generated ones.
Change-Id: I5bec807da9b39e2b166af1bd83da43df91f997ef
Bug: 237810289
Test: check that android-non-updatable.stubs.module_lib uses manual
bazel target for its sdk_system_current_android dependency

Change-Id: I6f5fb348e1dcaad10eb756382359f34de792b6e0
2023-05-08 15:26:43 -04:00
Alix
a28acb5a16 Delete kotlin/rules.bzl file
Bug: 277800767
Test: treehugger
Change-Id: I5cff1e4bbb18b9145335169bc4edb0d569525b35
2023-05-08 18:02:01 +00:00
Jared Duke
34c6d7d56f Fix Proguard configuration output from R8 invocation
The output when using `--pg-conf-output` seems to be flaky. In the
meantime, use `-printconfiguration` to generate full config summaries
for each R8 invocation.

Bug: 281081834
Test: m && \
      find $ANDROID_BUILD_TOP/out -name proguard_configuration -empty
Change-Id: I0c8c36212e338b50505184076f4c470a5d3d9b94
2023-05-05 21:05:33 +00:00
Qiao Yang
7081aaf874 Merge changes from topic "revert-2574032-XXTWCJDTDQ"
* changes:
  Revert "Generate boot image profiles even if dexpreopt is disabled."
  Revert "Generate app profiles even if dexpreopt is disabled."
2023-05-05 16:43:45 +00:00
Qiao Yang
8d8c660710 Revert "Generate boot image profiles even if dexpreopt is disabled."
Revert submission 2574032

Reason for revert: DroidMonitor-triggered revert due to breakage <https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=aosp_cf_riscv64_minidroid-userdebug&lkgb=10069333&lkbb=10075041&fkbb=10071083>, bug <b/280902279>

Reverted changes: /q/submissionid:2574032

Change-Id: I8e99f8231639198b149ea8d822ee7f9a5b391a89
BUG: <280902279>
2023-05-05 15:03:24 +00:00
Qiao Yang
3d08c388b9 Revert "Generate app profiles even if dexpreopt is disabled."
Revert submission 2574032

Reason for revert: DroidMonitor-triggered revert due to breakage <https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=aosp_cf_riscv64_minidroid-userdebug&lkgb=10069333&lkbb=10075041&fkbb=10071083>, bug <b/280902279>

Reverted changes: /q/submissionid:2574032

Change-Id: Ia9d05f3b7439604eb4a4b4100f46879fe11f5820
BUG: <280902279>
2023-05-05 15:03:24 +00:00
Treehugger Robot
c144c08d2a Merge "Provide a resource_prefix_strip for java_resources in bp2build." 2023-05-05 01:44:03 +00:00
Treehugger Robot
ee6bd5a7b2 Merge "Enable prebuilt apk checks" 2023-05-05 01:30:35 +00:00
Treehugger Robot
da8ebf235c Merge "Add genrule to build *.latest.version build target." 2023-05-05 01:00:32 +00:00
Jiakai Zhang
dbfcf85c53 Merge changes I4e721b47,I1bf05ade
* changes:
  Generate app profiles even if dexpreopt is disabled.
  Generate boot image profiles even if dexpreopt is disabled.
2023-05-04 22:13:08 +00:00
Gurpreet Singh
daa314ac97 Add genrule to build *.latest.version build target.
Build a new target *.latest.version which will contain a text file
containing the last finalized version.

Bug: 242316893
Test: atest prebuilt_apis_test
Change-Id: I41fa91c9ec273f342b7807c66c4d65ba13260124
2023-05-04 21:02:47 +00:00
Cole Faust
ccb20f47d5 Enable prebuilt apk checks
Now that existing violations set the skip flag.

Bug: 185811447
Test: Presubmits
Change-Id: Ia513b71be1cd878f36fdb28c94ef3cdc3f2a6bc6
2023-05-04 12:38:24 -07:00
Romain Jobredeaux
d5fe133077 Provide a resource_prefix_strip for java_resources in bp2build.
Although paths to resource files in a Bazel java_library should be
relative to the package, the directory structure in the resulting jar
will have resources under the full path from the top-level of the
workspace, e.g. if a library in "a/BUILD" has java_resouces as
"res/res.txt" then by default the res.txt file would appear under
"a/res/res.txt".
Fix this by adding a resource_strip_prefix in that case.

Test: Unit tests
Change-Id: If4325126f5c19a2a8fb83ee09bc3a95a18673fe3
2023-05-04 14:54:45 -04:00
Alix
83a8bc47d2 Delete java/rules.bzl file
Bug: 277800767
Test: treehugger
Change-Id: Idc80cd51317d167fca8d5543bb53c585adeaddad
2023-05-04 18:03:23 +00:00
Sam Delmerico
717840fdfc Merge changes from topic "privapp_allowlist_prop"
* changes:
  add privapp_allowlist property to android_app
  Add script for modifying privapp permission allowlists
2023-05-04 13:57:17 +00:00
Jiakai Zhang
7b845e808f Generate app profiles even if dexpreopt is disabled.
Bug: 280440941
Test: -
  1. Patch ag/22302622 to disable dexpreopt.
  2. lunch aosp_cf_x86_64_phone-userdebug && m
  3. See app profiles still generated.
Test: -
  1. Patch ag/20592051 to enable profile for service-art.
  2. banchan com.android.art x86_64 && m
  3. See the profile for service-art generated.
Change-Id: I4e721b475b84a2f667bbccc030a8947078f26bb0
2023-05-04 13:53:22 +01:00
Andrei Onea
580636bdd2 add privapp_allowlist property to android_app
This change allows override_android_app to use the same
privapp_allowlist as the non-override module so that they will always
remain in sync.

Test: go test ./java -v -run TestPrivappAllowlist
Test: go test ./apex -v -run TestApexWithApps
Test: m com.android.permission com.google.android.permission and verify
  manually that apex_payload.img contains correct privapp_allowlist
Test: m com.android.permission before and after change &&
  `diffoscope apex_payload_reference.img apex_payload_with_change.img`
  && verify that there are no semantic changes
Bug: 242509786
Change-Id: Ifdcb28af40763aed7a4aac9a7f681153554bc256
2023-05-03 15:03:34 +00:00
Jiakai Zhang
b95f8345c8 Generate boot image profiles even if dexpreopt is disabled.
Bug: 280440941
Test: -
  1. Patch ag/22302622 to disable dexpreopt.
  2. See boot image profiles still generated.
Change-Id: I1bf05ade53fa83f3dba46f28a8f9246ba1fdf664
2023-05-03 15:25:18 +01:00
Cole Faust
9e4c6c9cc7 Merge "Use api_levels_released_versions from starlark" 2023-05-02 21:55:15 +00:00
Jeongik Cha
30208863b4 Merge "Get rid of DeviceName() from path related to dexpreopt" 2023-05-02 05:07:03 +00:00
Cole Faust
3486740cc5 Use api_levels_released_versions from starlark
Instead of exporting it to soong_injection.

Bug: 279095899
Test: m nothing
Change-Id: I7b93af233b7450848a475512b5f5682ece773c09
Merged-In: I7b93af233b7450848a475512b5f5682ece773c09
2023-05-02 01:05:07 +00:00
Spandan Das
934d5047ef Merge changes from topic "bp2build-ignore-test-apex-tags"
* changes:
  Ignore test apexes from bp2build generated tags
  Ignore test apexes from bp2build generated tags
2023-05-01 16:05:38 +00:00
Treehugger Robot
e605b39e61 Merge "target_sdk_version replacement should respect REL branches" 2023-04-28 23:18:16 +00:00
Spandan Das
fb6a1ee68b target_sdk_version replacement should respect REL branches
Currently, target_sdk_version of MTS tests were being set to 10000 even
in release branches. This should only happen in active branches.

Test: Unit test
Test: aapt2 on CtsContentTestCases in udc-dev and verified
targetSdkVersion is 34
Bug: 279507428

Change-Id: Ib79318febc0f6e771b3679c0281a97357930ec56
2023-04-28 16:23:53 +00:00
Jeongik Cha
4753b39cca Get rid of DeviceName() from path related to dexpreopt
As-is, dexpreopt config and bootjar is in the dir including
DeviceName(). It causes unnecessary dexpreopt invocation when target is
changed repeatly. To avoid it, rename dir to common name.

Bug: 278833696
Test: m
Change-Id: I2818d9ae09e6c22ca6989cc8efdb70b470ec502c
2023-04-28 11:50:18 +09:00
Spandan Das
39b6cc5336 Ignore test apexes from bp2build generated tags
Soong does not enforce apex_available on the contents of test apex. To
prevent special-casing test apexes in the apex validation aspect in
Bazel, drop the test apexes from the tags altogether.

( The core problem I am trying to solve is making sure that stub
libraries in Bazel have a single apex available. apex validation happens
to be a nice side benefit)

Bug: 277651159
Test: go test ./bp2build
Change-Id: Ibb3cfedb5c0f2cda0464bf3758c70b67cb5885d1
2023-04-27 23:24:49 +00:00
Cole Faust
03cf3181d3 Merge "Expand preprocessed flag to work on android_app_imports" 2023-04-27 17:18:59 +00:00