Commit graph

76832 commits

Author SHA1 Message Date
Aditya Kumar
d18128fa12 Merge "Add Wno-ambiguous-reversed-operator to get around the operator== lookup issue in clang" into main 2024-02-08 12:17:05 +00:00
Stephen Hines
728bb716b6 Temporarily remove toolchain/ from androidmk_denylist.go
There are defensive `Android.mk` files present in several top-level
toolchain/ projects. Enforcing the denylist strictly breaks several
builds, so this change temporarily relaxes that by removing our
directories from the list.

Test: Run Rust's test_compiler.py
Change-Id: Ic00a305b78485543d098aeea42c2d2b93f979430
2024-02-08 01:37:34 -08:00
Treehugger Robot
45fd693433 Merge "Add GatherPackagingSpecsWithFilter" into main 2024-02-08 08:11:14 +00:00
Treehugger Robot
900c8512cd Merge "Add property Exportable to aconfig_declarations" into main 2024-02-08 07:43:12 +00:00
Treehugger Robot
3be6f3fa58 Merge "Add //visibility:any_partition" into main 2024-02-08 07:34:33 +00:00
Zi Wang
0e5d16c6f0 Add property Exportable to aconfig_declarations
Only when aconfig_declarations explicitly set this property true,
its flags will be repackaged.

If a java_aconfig_library has mode "exported", its corresponding
aconfig_declarations must have exportable prop set to true.

Test: Added unit tests and CI

Bug: 310504781

Ignore-AOSP-First: this change will be cherry picked to aosp
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e4527f3010b3fd6f33948a15a9b4fdc944da34f0)
Merged-In: Ie9526e3755a6e7d142b377d5dd85a1bc60ffabc5
Change-Id: Ie9526e3755a6e7d142b377d5dd85a1bc60ffabc5
2024-02-08 06:19:34 +00:00
Ikjoon Jang
62e3c24757 Merge "Revert "Remove unused ToTSepolicyVersion"" into main 2024-02-08 04:47:20 +00:00
AdityaK
839eda517e Add Wno-ambiguous-reversed-operator to get around the operator== lookup issue in clang
Bug: b/323152930
Change-Id: Iee1bc4dd9db9a0fe38d7cf871c34abb638abc092
2024-02-07 20:30:55 -08:00
Ikjoon Jang
a1448e072e Revert "Remove unused ToTSepolicyVersion"
Revert submission 2952245-vfrc_as_tot_sepolicy

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/builds/quarterdeck?branch=git_main&target=mainline_modules_arm64-mainline-userdebug&lkgb=11421838&lkbb=11421957&fkbb=11421841, b/324335916

Reverted changes: /q/submissionid:2952245-vfrc_as_tot_sepolicy

Bug: 324335916
Change-Id: I803ccc4c2d1e96f9e36b9d91eebc3e18e50b238f
2024-02-08 02:54:43 +00:00
Jeongik Cha
54bf875c97 Add GatherPackagingSpecsWithFilter
android_system_image used GatherPackagingSpecs and then filter only
system modules. But some modules were omitted in this logic because
there are modules which has the same relative path, so the later one is
ignored even though its partition info is what we're looking for. So add
filter logic in GatherPackagingSpecs to avoid this problem

Bug: 323793487
Test: build android_system_image, and then check if it contains every
module we want

Change-Id: Iec8ae920736d3d1920eecad71ba0f8f2fe848e6c
2024-02-08 11:14:43 +09:00
Jooyung Han
47f87dddb3 Merge "apex: skip apex_sepolicy_tests for test apex" into main 2024-02-08 01:33:07 +00:00
Inseob Kim
5712af4792 Merge "Remove unused ToTSepolicyVersion" into main 2024-02-08 01:12:47 +00:00
Zi Wang
5eab6d0a31 Merge "Ignore proguardRaiseTag in jarjar repackage" into main 2024-02-07 23:58:23 +00:00
Elliott Hughes
5897fd6a5e Merge "Remove __STDC_FORMAT_MACROS." into main 2024-02-07 23:50:37 +00:00
Wei Li
070e4d47d2 Merge "Show error message when Android.mk files are found in directories in the deny list." into main 2024-02-07 23:15:53 +00:00
Treehugger Robot
dafc1c53e0 Merge "Remove macros that Darwin never used." into main 2024-02-07 22:59:47 +00:00
Elliott Hughes
1c80585cd6 Remove __STDC_FORMAT_MACROS.
Our mingw doesn't use this. (It does however still use
__STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS.)

Test: treehugger
Change-Id: I415017093b9ccffd21fd41f17a2f4387839a0f53
2024-02-07 20:45:25 +00:00
Cole Faust
c99c52f977 Merge "Revert^2 "Enforce that soong config variables are identifiers"" into main 2024-02-07 20:25:00 +00:00
Cole Faust
894bb3b530 Add //visibility:any_partition
When we convert the partitions to be built with soong, there will
likely be separate partition modules per product. This means that a
lot of installable modules will have to be visible to a lot of
partitions. To make this easier, add the //visibility:any_partition
visibility spec, which allows the module to be used from any module
of type android_filesystem or android_system_image.

Fixes: 321000103
Test: go test
Change-Id: Iea1f1ab7d88dfdb1fd00f19eb8c9941693a2375f
2024-02-07 12:03:32 -08:00
Zi Wang
bacee38680 Ignore proguardRaiseTag in jarjar repackage
Test: CI

Bug: 310504781

Ignore-AOSP-First: Will cp to aosp
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ffd200a12546237b1ac0f615c73cb3c9614a8237)
Merged-In: I1c926f374cc6e0f963c32d049ea120b8fbf18eb1
Change-Id: I1c926f374cc6e0f963c32d049ea120b8fbf18eb1
2024-02-07 19:57:14 +00:00
Elliott Hughes
ac43c55656 Remove macros that Darwin never used.
Test: treehugger
Change-Id: I4b31c1f40142c0346ac2d2c9e9b831954c4d9468
2024-02-07 18:30:22 +00:00
Ziwei Zhang
617b3e288a Merge "Generate ATS 2.0 config for Mobly test." into main 2024-02-07 07:38:39 +00:00
Jooyung Han
1f4531e768 apex: skip apex_sepolicy_tests for test apex
Test apexes are often configured incorrectly intentionally.

Bug: 324005965
Test: m
Change-Id: Ifddbca71b46a42cffa9923b0dd66cd5e2d8024e4
2024-02-07 16:27:57 +09:00
Ziwei Zhang
3dfec5a2c6 Generate ATS 2.0 config for Mobly test.
- Support test_config and test_config_template
- The `config` file extension is widly used by TF. Use `configv2` for
  ATS 2.0 tests to avoid configuration errors in TF.
- Add `mobly` tag to support atest

Test: m CtsBluetoothMultiDevicesTestCases (with `runner = "mobly"`)
Bug: 299850687
Change-Id: Idbed90ab30e35aeed8cdeeb0aa0aa7adb75a3cd9
2024-02-07 10:29:29 +08:00
Cole Faust
d92430e569 Revert^2 "Enforce that soong config variables are identifiers"
This reverts commit 149b5d003a.

Reason for revert: The variable that was causing issues before has been renamed

Change-Id: Ie0ffe9bf978332a2c921d21ccdf639b603fae39c
2024-02-07 01:02:04 +00:00
Spandan Das
f8c004263a Merge changes Ia899d75e,I9f885ffa into main
* changes:
  Use source_module_name to determine the contents of prebuilt apexes
  Support mechanism to select a specific version of module sdk prebuilt
2024-02-07 00:54:43 +00:00
Jihoon Kang
d2e49a9261 Merge "Introduce make var ANDROID_PUBLIC_EXPORTABLE_STUBS" into main 2024-02-06 21:59:11 +00:00
Spandan Das
161e468774 Use source_module_name to determine the contents of prebuilt apexes
There are a couple of instances in apex/ and java/ that rely on the naming
convention that the jars exported by prebuilt apexes follow the name of
the java_sdk_library_import, minus the prebuilt_ prefix. With muliple
module sdk prebuilts in trunk stable, this naming convention might not
be valid. Use `source_module_name` instead.

```
prebuilt_sscp_fragment {name: "", contents: ["service-foo.v2"]}
java_import {name: "service-foo.v2", source_module_name: "service-foo"},
```

We should use service-foo and not service-foo.v2 because
1. The prebuilt apex contains service-foo.dex
2. PRODUCT_*JARS will contain service-foo and not service-foo.v2

For clarity, this CL does not drop the current mechanism where prebuilt bcp
fragments create a dependency edge to prebuilt java or java_sdk_library
imports. There is still some discussion around whether we can remove
that completely (b/320711431). If we were to do that, then the
Android.bp files will become

```
prebuilt_sscp_fragment {name: "", contents: ["service-foo"]}
```

Bug: 322175508

Test: Added a unit test

Test: In internal, lunch cf_x86_64_only_phone-next-userdebug && m
nothing # .ninja files identical

Test: In internal, created a parallel set of v2 prebuilts of
java_sdk_library_import and prebuilt_bcp_fragments for adservices && m
nothing # build passes

Change-Id: Ia899d75e826fa1a559368d706eaa65835f748d40
2024-02-06 21:56:05 +00:00
Spandan Das
cc53063b07 Support mechanism to select a specific version of module sdk prebuilt
This CL is the java_system_modules_import equivalent of aosp/2928483.

With trunk stable, we will have multiple versions of art prebuilt apex
in the tree. Each art apex will contribute its own module sdk, i.e. its
own prebuilt system_modules to the build. This CL introduces a mechanism
to selelect a specific version of prebuilt system modules using
apex_contributions.

Implementation details: Create a new source_module_name property to
identify the root module. rdeps referring to the root module will get
redirected if necessary.

Bug: 322175508

Test: Added a unit test
Change-Id: I9f885ffa5afea96d2e6ce077264d3b207ed7e80d
2024-02-06 21:55:50 +00:00
Wei Li
d0a2e324df Show error message when Android.mk files are found in directories in the deny list.
Bug: 318567881
Test: CIs
Test: add a Android.mk file in a blocked directory(e.g. cts/) and 'm nothing', an error message should be displayed and build process is stopped.
Change-Id: I3e1f63a13a20f77576b0e7424304a661f144df53
2024-02-06 11:54:55 -08:00
Jihoon Kang
7cf2c0cce7 Introduce make var ANDROID_PUBLIC_EXPORTABLE_STUBS
ANDROID_PUBLIC_STUBS currently has multiple usages in the build, in
multiple .mk files.

Instead of modifying the current functionality of ANDROID_PUBLIC_STUBS
by replacing its value from "android_stubs_current" to
"android_stubs_current_exportable", this change introduces
ANDROID_PUBLIC_EXPORTABLE_STUBS, which evaluates to
"android_stubs_current_exportable" and used only when generating the
`full_target` in `development/build/Android.mk`.

Test: patch in git_main, lunch aosp_arm-ap31-eng && m sdk dist && inspect android.jar outputs
Bug: 323261972
Change-Id: Ic2b03a5a4afdefb459d89f8104916446599eaf31
2024-02-06 18:51:19 +00:00
Spandan Das
7870d329a5 Merge "Mechanism to select a specific version of java_sdk_library_import" into main 2024-02-06 17:54:58 +00:00
Treehugger Robot
d7e6bd8a04 Merge "Revert "Enforce that soong config variables are identifiers"" into main 2024-02-06 10:50:10 +00:00
Almaz Mingaleev
149b5d003a Revert "Enforce that soong config variables are identifiers"
This reverts commit d7c32db93d.

Reason for revert: breaks builds b/323989166

Change-Id: I6937f2cbecbde39fcfe605937861510329ba44c3
2024-02-06 09:13:50 +00:00
Ke-Yu Lu
196d9493c4 Merge changes from topic "revert-2925209-KVPWEBRQHT" into main
* changes:
  Revert "Convert AFDO mutators to TransitionMutator"
  Revert "Remove fdoProfileMutator"
2024-02-06 05:46:07 +00:00
Spandan Das
23956d12ab Mechanism to select a specific version of java_sdk_library_import
This CL is the java_sdk_library_import equivalent of aosp/2928483.

With trunk stable, we will have multiple apex prebuilts in the tree.
Each apex prebuilt will have its own module sdk. This means that it is
possible to have mutliple versions of `framework-foo` in the tree. This
CL introduces a mechanism to select a specific versioned
java_sdk_library prebuilt.

Implementation details
- Add a `source_module_name` property to java_sdk_library_import. This
  will identify the source equivalent of the jsl in packages/modules.
  This used to be implicit - i.e. the name without the prebuilt_ prefix.
  With multiple prebuilts, this has to become explicit.
- Set appropriate `source_module_name`(s) in the dynamically created
  child modules. e.g. the source_module_name on sdklib.v1.stubs and
  sdklib.v2.stubs will both be sdklib.stubs, assuming
  `source_module_name` on the top-level jsl_import is sdklib
- Add a private Created_by_java_sdk_library_name property to java_import
  and prebuilt_stubs_sources modules. This will be used to idenfity the
  top level java_sdk_library_import that was used to create these child
  modules. This is necessary because java_sdk_library_imoprt is a macro
  that creates 1:many modules. However, to avoid toil, only the
  top-level java_sdk_library_import will be listed in
  `apex_contributions`. This new property will be used for
  source/prebuilt selection in android/prebuuilt.go
- Rename BaseModuleName in commonSdkLibraryAndImportModule to
  RootLibraryName. This is necesssary because the former is now reserved
  to identify the source equivalent of a prebuilt module (maybe we
  should rename it?)

Bug: 322175508

Test: Added a unit test
Change-Id: If6aa6b0e939a07f8263874941413908383c81a78
2024-02-06 04:14:59 +00:00
Ke-Yu Lu
0be9d6034e Revert "Convert AFDO mutators to TransitionMutator"
Revert submission 2925209

Reason for revert: b/323975183

Reverted changes: /q/submissionid:2925209

Change-Id: Ie907d23081817d601a1a2083347b5f683829a36c
2024-02-06 02:15:03 +00:00
Ke-Yu Lu
351d36490d Revert "Remove fdoProfileMutator"
Revert submission 2925209

Reason for revert: b/323975183

Reverted changes: /q/submissionid:2925209

Change-Id: I33b2e71ba7b36e12e5c491e0ad14a7f7df3edd78
2024-02-06 02:15:03 +00:00
Cole Faust
f7757f1246 Merge "Enforce that soong config variables are identifiers" into main 2024-02-06 02:04:29 +00:00
Kiyoung Kim
e5b8b97322 Merge "Reapply "Rename LOCAL_USE_VNDK"" into main 2024-02-06 00:57:21 +00:00
Zi Wang
4f0b9b4289 Merge "Automatically propagate jarjar rules for aconfig libraries" into main 2024-02-06 00:04:07 +00:00
Cole Faust
d7c32db93d Enforce that soong config variables are identifiers
I want to be able to use certain characters to separate a namespace
from a variable, but currently it's possible for soong config namespaces
and variables to have any character in them.

Restrict them to just identifiers, which should cover all of our
existing usages.

Bug: 323382414
Test: Presubmits
Change-Id: I6d55dd3378ac4d257efde450189b81a4aa3932c3
2024-02-05 16:01:18 -08:00
Treehugger Robot
87177f21b4 Merge "Fix non-determinism in all_teams.pb" into main 2024-02-05 23:29:14 +00:00
Colin Cross
6c392749d5 Merge changes Ied8fd7b5,Ib0584545 into main
* changes:
  Remove fdoProfileMutator
  Convert AFDO mutators to TransitionMutator
2024-02-05 23:03:49 +00:00
Joe Onorato
349ae8dd6b Automatically propagate jarjar rules for aconfig libraries
Test: treehugger
Bug: 310504781
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:97c03a6dc659102ff40793759fb3f0f18164a85b)
Merged-In: I639d12ff33175b7bed7e7d0595a40dd9b0d99367
Change-Id: I639d12ff33175b7bed7e7d0595a40dd9b0d99367
2024-02-05 22:46:00 +00:00
Spandan Das
2268cd8b8b Fix non-determinism in all_teams.pb
this.teams_for_mods uses a dictionary and `range` yields a
non-deterministic ordering. This would cause all_teams.pb to be
non-determinisitic. Since this file is created during Soong analysis, it
would cause the .ninja file to also be non-deterministic.

Use SortedKeys to do the iteration instead.

Test: go build ./android
Test: m nothing a couple of times and checked that the .ninja files are
identical

Change-Id: Ife2d2520d118ef25639f86390912d98b5f057655
2024-02-05 22:11:28 +00:00
Spandan Das
bb0d5866c5 Merge "Sort the inputs to mergedAconfigFilesRule" into main 2024-02-05 21:16:54 +00:00
Colin Cross
6b2b493bf3 Merge "Follow signature update to ExtendMatchingProperties" into main 2024-02-05 21:02:02 +00:00
Colin Cross
2a28cd3c5e Merge changes I64a5f3c9,I1ed0a380 into main
* changes:
  Optimize mutator contexts
  Optimize InstallPath.String()
2024-02-05 20:22:20 +00:00
Spandan Das
4d4edfb8d8 Sort the inputs to mergedAconfigFilesRule
The aconfig files are collected by visiting the direct deps of the
module. VisitDirectDeps does not guarantee ordered traversal. To prevent
non-determinism in the generated ninja file, sort the inputs.

Test: go build ./android
Change-Id: Ic67fc0859bf18de62b6297ed502d1d495cc3a780
2024-02-05 19:34:48 +00:00