Commit graph

77008 commits

Author SHA1 Message Date
Andus Yu
c917eb8207 Make sure RBE socket address is under character limit
Check that socket address paths are less than the character limit - 2 since absolute paths are prefixed with //, which is included in the character limit.

b/308986536

Change-Id: I3055b8bb8cdae00aafd66c51fdc8421b9cc5f21f
2024-03-06 21:54:57 +00:00
Ronald Braunstein
eefca7373c Merge "Test_Module_Config soong implementation" into main 2024-03-06 04:08:23 +00:00
Treehugger Robot
d3a0ea94ba Merge "enable exportable check" into main 2024-03-06 01:10:49 +00:00
Ronald Braunstein
fce431652d Test_Module_Config soong implementation
New soong module type `TestModuleConfig`

This module type allows to write:
   test_module_config {
    name: "DerivedFrameworks1",
    base: "FrameworksServicesTests",
    include_filters: ["com.android.server.accessibility.FingerprintGestureDispatcherTest"],
  }

This goal is to put the test options (include_fitler in this case) in
Android.bp rather than TEST_MAPPING to be able to name a set of options
and to allow the CI to more precise about which part of a TestModule
might be failing.
In general, it is recommended to split up tests rather than use this
approach, but that isn't always feasible.

More details on project here:  https://docs.google.com/document/d/1MpA4BS6mTr-1D-K9MVmzdHkSufAvIkkM4gPEUglNodk/edit?tab=t.0
Migration plan here: https://docs.google.com/document/d/1x3w-BvKO3E-GbY8YOSBuzJC6-pkLkuhfjSyZ1hJQBYM/edit?tab=t.0

Some details of final output:

   * All the [data] files from Derived are the same as base.
   * The apk names is changed to be the Module name
   * The test options are added to .config file
   * test-file-name in the .config file (for base.apk) is changed to be
     new apk.
   * module-info.json is hand inspected between base and derived.
   * I added a .manifest file so future tools know what base is, if they
     need it.

We are working a mechanism to use a CAS so the zip of the testcases
won't explode. (however the trident disk image will get bigger)

% tree -ls out/target/product/shiba/testcases/DerivedFrameworks1 out/target/product/shiba/testcases/FrameworksServicesTests
[       4096]  out/target/product/shiba/testcases/DerivedFrameworks1
├── [       4096]  arm64
│   └── [   72346281]  DerivedFrameworks1.apk
├── [      20887]  BstatsTestApp.apk
├── [       4096]  data
│   └── [        851]  broken_shortcut.xml
├── [       3157]  DerivedFrameworks1.config
├── [      12695]  JobTestApp.apk
├── [       8599]  MediaButtonReceiverHolderTestHelperApp.apk
├── [      16791]  SimpleServiceTestApp1.apk
├── [      16791]  SimpleServiceTestApp2.apk
├── [      16791]  SimpleServiceTestApp3.apk
├── [    1017540]  SuspendTestApp.apk
└── [         36]  test_module_config.manifest

[       4096]  out/target/product/shiba/testcases/FrameworksServicesTests
├── [       4096]  arm64
│   └── [   72346281]  FrameworksServicesTests.apk
├── [      20887]  BstatsTestApp.apk
├── [       4096]  data
│   └── [        851]  broken_shortcut.xml
├── [       2866]  FrameworksServicesTests.config
├── [      12695]  JobTestApp.apk
├── [       8599]  MediaButtonReceiverHolderTestHelperApp.apk
├── [      16791]  SimpleServiceTestApp1.apk
├── [      16791]  SimpleServiceTestApp2.apk
├── [      16791]  SimpleServiceTestApp3.apk
└── [    1017540]  SuspendTestApp.apk

Fixes: 314148134
Test: atest DerivedFrameworks1 DerivedFrameworks2
Test: m blueprint_tests
Change-Id: Ib73a3404557e0bd583b065f0cf2fd55fba9ccdbe
2024-03-06 00:38:56 +00:00
Treehugger Robot
dc2b51f2ba Merge changes from topic "revert-2929615-JHGJGJFRRX" into main
* changes:
  Revert "Additional cleanup prior to adding the runtime stubs"
  Revert "Generate runtime stubs in droidstubs"
2024-03-05 22:55:29 +00:00
Zhi Dou
e11319d466 enable exportable check
If a library is built to mode exported, the flag declaration has to be
set with exportable true. The reason for this requirement is only flags
in the exportabel declarations will be repackaged. To prevent forgetting
adding this attribute, this exportable attribute is required to be set
for all exportable declarations.

Test: m
Bug: 310504781
Change-Id: I3ddafe0b212dabe86aa5000b1b76c7c412acc93c
2024-03-05 22:21:03 +00:00
Jihoon Kang
a11d679da2 Revert "Additional cleanup prior to adding the runtime stubs"
Revert submission 2929615

Reason for revert: b/328225000

Reverted changes: /q/submissionid:2929615

Merged-In: I29c605adb9401c9cb8b58646f2ae7b53b9a758e9
Change-Id: I29c605adb9401c9cb8b58646f2ae7b53b9a758e9
2024-03-05 21:34:18 +00:00
Jihoon Kang
d40c591487 Revert "Generate runtime stubs in droidstubs"
Revert submission 2929615

Reason for revert: b/328225000

Reverted changes: /q/submissionid:2929615

Merged-In: Ifbec11417103c96b37a4da18dfc9fda73f654d8f
Change-Id: Ifbec11417103c96b37a4da18dfc9fda73f654d8f
2024-03-05 21:27:53 +00:00
Spandan Das
972917d794 Support partial module variants with apex_contributions
Some libraries like `libnativehelper_compat_libc++` only exist as shared
library in module sdk. When prebuilt of this library is selected using
apex_contritbutions, only shared linkages should be redirected to the
prebuilt version. The static linkage should come from source.

Test: Added a unit test
Bug: 322175508

Change-Id: Ic65d376b2354b4a42c7b9ea3ed1cd80c37e2840f
2024-03-04 08:39:20 +00:00
Spandan Das
f2c1057586 Fix non-determinism in prebuilt selection
This relands aosp/2978137 with acknowledgement of soong namespaces.

If multiple versions of the prebuilt module sdk share the same soong
config namespace, then PrebuiltPostDepsMutator rewrites rdeps to one of
those prebuilts in a non-deterministic way.

This CL uses apex_contributions to make this deterministic. Multiple
prebuilts will not be allowed to have their prefer evaluate to true. If
this happens, one of the prebuilts must be explicitly declared in
apex_contributions.

This CL also fixes the special-casing of the top-level
java_sdk_library_import in ReplaceDirectDependencies. For
framework-foo.v2, it will use BaseModuleName framework-foo instead of
SdkLibraryName framework-foo.v2 to determine if the source module has
been selected.

Test: ran the previously failing cmd of b/327552112
Test: Added a unit test
Test: aninja -t query
    out/soong/.intermediates/packages/modules/Permission/SafetyCenter/Config/safety-center-config/android_common/javac/safety-center-config.jar
    | grep module_sdk is empty (should not cause a regression for
    323454855)
Change-Id: Id484a41192085c50b7e34ad415c6e195edb0d006
2024-03-04 07:59:34 +00:00
Spandan Das
1c96fab7d0 Merge changes I177441bc,I32daefbd into main
* changes:
  Use BaseModuleName for LOCAL_MODULE
  Disable source javalib dexpreopt when using prebuilt apex
2024-03-04 07:59:06 +00:00
Spandan Das
614a6f2b41 Use BaseModuleName for LOCAL_MODULE
This CL uses OverrideName to ensure that the LOCAL_MODULE does not
contain any version information.

Test: Created CaptiveLoginPortalGoogle.v2, and checked that its
LOCAL_MODULE is CaptiveLoginPortalGoogle

Change-Id: I177441bcd55ca538759b69aafb73d0a8b7261179
2024-03-04 07:57:59 +00:00
Spandan Das
a8afdcb307 Disable source javalib dexpreopt when using prebuilt apex
The apex_contributions in next builds use prebuilt apexes with source
java_sdk_library for javac. The dexpreopt rules of the source
java_sdk_library are disabled via
RELEASE_DEFAULT_MODULE_BUILD_FROM_SOURCE coupled with some complicated
special-casing in android/prebuilt.go

This special-casing breaks if we want to use prebuilts of some modules,
and sources of other modules. To enable per mainline module
toggelability, explicitly disable dexpreopt of source variant of
java_sdk_library if we use prebuilt of the containing apex.

Test: In internal, updated trunk_staging.scl's
RELEASE_APEX_CONTRIBUTIONS_ADSERVICES to use prebuilt followed by m
nothing

Change-Id: I32daefbd38338b396d6f07b899826b2869d8f8e1
2024-03-04 07:57:59 +00:00
Stephen Hines
0684c5fc11 Merge "Allow clippy::disallowed_names since it can be used for debugging" into main 2024-03-01 00:51:07 +00:00
Treehugger Robot
e9f270a61f Merge "Add the build flags for apex contribution contents" into main 2024-02-29 23:34:15 +00:00
Ryan Prichard
45ac47edab Merge changes I34385c48,I1e48947c into main
* changes:
  disablePrebuilt: also clear sanitizer-dependent Srcs
  Define libc++ config macros to nothing
2024-02-29 20:51:48 +00:00
Treehugger Robot
7c8cf91ff8 Merge "Remove --multitree-build" into main 2024-02-29 20:13:48 +00:00
Colin Cross
4b6a3ae65c Merge "Use R.txt files from aar files directly" into main 2024-02-29 18:55:17 +00:00
Colin Cross
5d55b66861 Merge changes I8d060594,I2b6a57ae into main
* changes:
  Put extraCombinedJars after the compiled jars
  Use RSP file for long classpaths
2024-02-29 18:46:46 +00:00
Stephen Hines
5f8dae514b Allow clippy::disallowed_names since it can be used for debugging
https://rust-lang.github.io/rust-clippy/master/index.html#/disallowed_names

The current list is extremely short ("foo", "baz", "quux"), and thus
this really just prevents people from temporarily using `foo` to debug
code. In the spirit of improving productivity and reducing frustration,
it's easier to just allow this.

Bug: N/A
Test: TH
Change-Id: I50b65486ed2b58bfd2cf699ee3b43b936d25f2cb
2024-02-29 10:12:19 -08:00
Yu Liu
6c2cd90232 Merge "Some tweaks to the aconfig flag collection logic" into main 2024-02-29 17:55:53 +00:00
Spandan Das
5354483c12 Merge "Revert "Fix non-determinism in prebuilt selection"" into main 2024-02-29 17:49:45 +00:00
Spandan Das
06c64f0f12 Add the build flags for apex contribution contents
This will be used for source vs prebuilt selection of Google apps

Test: go build ./android
Bug: 326995930

Change-Id: Idb535c468534ed691431315edcf7a279024dc7f1
2024-02-29 15:36:20 +00:00
Spandan Das
efa146577f Add a source_module_name to android_app
For multiple mainline prebuilts, we will have multiple versioned
prebuilt apps in the tree. The soong name of these prebuilts will have a
version prefix to prevent name collisions (e.g. MyGoogleApp.v2).

This CL introduces a source_module_name property in android_app_imoprt.
This property will be used for the following
1. Determining installation path. This should be
/system/app/MyGoogleApp/MyGoogleApp.apk
and not
/system/app/MyGoogleApp.v2/MyGoogleApp.apk
(filename prop determines the filename and not the dir name)

2. Preventing duplicate installation rules: This property will be used
   to create a dependency to the source app, and call HideFromMake on
   all the unflagged apps

Test: presubmits
Test: locally # Created CaptivePortalLoginGoogle.v2 and selected it
using one of the RELEASE_APEX_CONTRIBUTION_* flags

Bug: 326995930
Change-Id: If4ab9f9bd295117c96eb062cf3b3d2efc8bfed12
2024-02-29 14:33:16 +00:00
Spandan Das
af66212522 Revert "Fix non-determinism in prebuilt selection"
This reverts commit 2d8884a377.

Reason for revert: Build breakage https://groups.google.com/a/google.com/g/android-build-police-core/c/00mM-B9unVg/m/0FxBxpMbAwAJ. The validation does not check for namespace isolation which breaks libtonemap

Change-Id: Ieb4d3bc4f3ade856877ebb62a567620f5a1ed08c
2024-02-29 08:57:08 +00:00
Spandan Das
2d8884a377 Fix non-determinism in prebuilt selection
If multiple versions of the prebuilt module sdk share the same soong
config namespace, then PrebuiltPostDepsMutator rewrites rdeps to one of
those prebuilts in a non-deterministic way.

This CL uses apex_contributions to make this deterministic. Multiple
prebuilts will not be allowed to have their prefer evaluate to true. If
this happens, one of the prebuilts must be explicitly declared in
apex_contributions.

This CL also fixes the special-casing of the top-level
java_sdk_library_import in ReplaceDirectDependencies. For
framework-foo.v2, it will use BaseModuleName framework-foo instead of
SdkLibraryName framework-foo.v2 to determine if the source module has
been selected.

Test: Added a unit test
Test: aninja -t query
    out/soong/.intermediates/packages/modules/Permission/SafetyCenter/Config/safety-center-config/android_common/javac/safety-center-config.jar
    | grep module_sdk is empty (should not cause a regression for
    323454855)

Bug: TODO
Change-Id: I7191200c330c5bcb9d5532006d3c573a60db61cc
2024-02-29 06:34:49 +00:00
Ryan Prichard
21e2c10cd2 disablePrebuilt: also clear sanitizer-dependent Srcs
The new libc++ prebuilt has HWASan and non-HWASan variants for arm64.

Bug: 175635923
Test: checkout use-prebuilt-libcxx topic, build libc++demangle, verify
  that libc++demangle-install is not a valid build target

Change-Id: I34385c48aa7ad1401e2547d65d30a14fa342e304
2024-02-28 19:14:59 -08:00
Ryan Prichard
718cf5bf19 Define libc++ config macros to nothing
libc++[abi] always check whether one of these macros is defined, not
the value the macro is defined to. With the new libc++, there is a
Windows __config_site header that automatically defines
_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS and _LIBCPP_HAS_THREAD_API_WIN32
to nothing, so these definitions need to match to avoid a redefinition
error.

Bug: 175635923
Test: treehugger
Test: m adb
Change-Id: I1e48947c3b45e59804cdacd48776c7f3bd9a18c6
2024-02-28 19:14:24 -08:00
Inseob Kim
688f824e1a Merge "Sort jarjar rename keys before using" into main 2024-02-29 01:04:40 +00:00
Cole Faust
331b27f511 Remove --multitree-build
Multitree has been discontinued.

Test: m nothing --no-skip-soong-tests
Change-Id: Ie4d96a11279bf0f20a5e1a49837d9df4b24b1662
2024-02-28 15:35:49 -08:00
Jihoon Kang
641bd9daee Merge "Enable non-"everything" stubs generation in java_api_library" into main 2024-02-28 22:38:52 +00:00
Yu Liu
ab31c828d7 Some tweaks to the aconfig flag collection logic
1. Output the aconfig flags pb and storage files to /etc
2. Fix a bug where aconfig flags were not collected for java_sdk_library

Bug: None
Test: manual and unit tests.
Change-Id: I0896e91918c1b53c98ac9dc0f4a636f158200891
2024-02-28 22:21:31 +00:00
Colin Cross
bb77d8e948 Use R.txt files from aar files directly
Use the R.txt files from aar imports directly instead of recreating
one using aapt2 from the embedded resources.  Fixes an issue with
com.google.android.material where the jar was referencing
com.google.android.material.R.attr.theme, aapt2 was not producing
"int attr theme 0x0" in R.txt, but the aar's R.txt had it.

Bug: 294256649
Test: builds
Change-Id: Ibe1e5535a75eed59f3b8dbbc12eff9c07af51d37
2024-02-28 11:54:48 -08:00
Colin Cross
fd620b2b44 Put extraCombinedJars after the compiled jars
extraCombinedJars contains the R.jar generated by
ResourceProcessorBusyBox for apps.  It needs to go before any
static_libs dependencies so that the finalized R values take
precedence over any non-final R values that may have been included
in the dependencies.  Moving after the javac and kotlinc compiled
jars helps minimize differences when turning on use_resource_processor
by default by using the MANIFEST.MF generated by soong_zip instead of
the one generated by ResourceProcessorBusyBox, which contains a
different Created-By field.

Bug: 294256649
Test: m javac-check
Change-Id: I8d060594404121fd36ef650ac317f0c5d5f92b23
2024-02-28 11:54:48 -08:00
Colin Cross
c52d523327 Use RSP file for long classpaths
Setting use_resource_processor: true can increase the length of the
classpath enough to trigger "command line too long" errors.  There are
clockwork libraries with 546 transitive android_library dependencies.
Write classpaths longer than 64kB to a separate file and add them
to the javac and turbine command lines with the @file syntax.

Bug: 294256649
Test: m checkbuild
Change-Id: I2b6a57ae30de03347db3221e9c9a4b2efb490115
2024-02-28 11:54:48 -08:00
Aditya Kumar
592b54c443 Merge "Update unaligned-vector-mem to -munaligned-access" into main 2024-02-28 19:35:39 +00:00
Spandan Das
4dc449593a Merge "Use BaseModuleName of dep when writing to make" into main 2024-02-28 18:03:41 +00:00
Spandan Das
3faa792093 Use BaseModuleName of dep when writing to make
Since BaseModuleName of the dep becomes its LOCAL_MODULE name in the
generated mk file, we should also use BaseModuleName of dep for populating
properties such as LOCAL_SHARED_LIBS of rdeps

Test: m nothing --no-skip-soong-tests
Bug: 322175508

Change-Id: I6b47112faa63f85d19b5b71e0e102cea0ab68e3b
2024-02-28 18:03:00 +00:00
Jihoon Kang
5d701272e4 Enable non-"everything" stubs generation in java_api_library
This change adds support to generate non-"everything" (i.e. "runtime"
and "exportable") stubs in java_api_library, which generates the stubs
from the api signature files.

Unlike droidstubs module that generates "everything", "exportable" and
"runtime" stubs in a single module, java_api_library generates a single
set of stubs per module, which is set by the default-"everything"
property `stubs_type`. This is because java_api_library is responsible
for both generation and the compilation of the stubs srcjar, and
compilation of the stubs srcjar are done in separate java_library
modules for from-source stubs.

Utilization of this feature will be done in a follow up change that
generates the "exportable" java_api_library modules in java_sdk_library.

Test: m nothing --no-skip-soong-tests
Bug: 318009570
Change-Id: I1051544ac3bcdb3ba1f78bfec28eba4e9fad9c2d
2024-02-28 07:55:32 +00:00
AdityaK
2c90a92d77 Update unaligned-vector-mem to -munaligned-access
Latest compiler has merged both unaligned access flags into one.

TODO:  This is needed until we change clang driver to enable -munaligned access by default.for Android b/327307773

Bug: 326790418
Change-Id: Ia8c29dc56104d2cffb8ac41aae6eeacccae68e61
2024-02-28 06:14:57 +00:00
Inseob Kim
3c0c9d7816 Sort jarjar rename keys before using
To make it deterministic

Bug: 327302642
Test: compare build commands among different targets
Change-Id: I890dcd67c62db58938a6e6d1c4e3fbd323c72b18
2024-02-28 14:28:59 +09:00
Riya Thakur
88c21f567f Merge "Add sh_binary dependencies to primary abi of the target" into main 2024-02-28 02:37:09 +00:00
Jihoon Kang
60bdd05b21 Merge changes I14928b7b,Ia009df3d into main
* changes:
  Generate runtime stubs in droidstubs
  Additional cleanup prior to adding the runtime stubs
2024-02-28 00:29:08 +00:00
Riya Thakur
654461cde9 Add sh_binary dependencies to primary abi of the target
If compile_multilib is set to 'both' for an apex having a sh_binary
dependency for which compile_multilib is not set, then the sh_binary
dependency should be added for the primary ABI of the target

Bug: 325628733,326985291
Test: m
Change-Id: Ie9cd12d49f6854c33af3724cb8e2fc3d8b7627a0
2024-02-27 07:23:45 +00:00
Treehugger Robot
8bf3013844 Merge "Support new property "arch_dpi" for android_import" into main 2024-02-27 02:56:45 +00:00
Jihoon Kang
ca2f9e8bf4 Generate runtime stubs in droidstubs
Similar to how the exportable stubs are generated in droidstubs, this
change adds the rule to generate the runtime stubs in droidstubs. Unlike
the exportable stubs, which the artifacts are dist'ed during the sdk
build, the runtime stubs will only used in the hiddenapi flags
generation. Therefore, only the stubs are generated and no other
artifacts are generated during the "runtime" metalava invocation. When
`aconfig_declarations` property is not defined (i.e. no flags are
enabled, thus the exportable and the runtime stubs are identical), the
runtime stubs are simple copied from the exportable stubs.

Note that the runtime stubs are not a dependency of `droid` as of now.
The dependency of the hiddenapi flags will be replaced to the runtime
stubs in the child CL.

Test: m nothing --no-skip-soong-tests && m api-stubs-docs-non-updatable
Bug: 319162970
Change-Id: I14928b7b5619522c4caab1dfc795bc9c7e929639
2024-02-27 01:51:05 +00:00
Jihoon Kang
6b93b38e34 Additional cleanup prior to adding the runtime stubs
This change performs additional cleanups in the build rules of the
droidstubs module, specifically optionalizing annotationFlags(...) and
apiLevelsAnnotationsFlags(...). This is required as "runtime" stubs
would not generate other artifacts than the stubs, and thus
`stubsArtifacts` would not be generated for "runtime".

Test: m nothing
Bug: 319162970
Change-Id: Ia009df3d01f49841d5041fb2dfdfa7ef8671bf18
2024-02-27 01:01:44 +00:00
Spandan Das
bffd7fbaba Ignore prebuilt apex_contributions in coverage builds
This CL unsets the prebuilt contents of a selected apex_contribution
in coverage builds. The effect of this will be that mainline modules
will be built from source with the following in coverage builds
1. Instrumentation turned on
2. RELEASE_ACONFIG_VALUE_SETS for that release config

Test: Added a unit test
Test: lunch cf_x86_64_phone-next-userdebug && EMMA_INSTRUMENT=true m nothing (with ag/26298763)
Bug: 325666427
Change-Id: Ic4e1f0612072377261602842dfd303c064095035
2024-02-26 10:07:45 +00:00
Mårten Kongstad
50bfc34894 Merge "Include all_aconfig_declarations in droid dist" into main 2024-02-26 07:12:36 +00:00
Herbert Xue
04354ae88b Support new property "arch_dpi" for android_import
Support the feature with new property combined with architecture and dpi
resolution.

Bug: 319381869
Test: go test -run TestAndroidAppImport_ArchVariants
Change-Id: Ib43cbae8868fc35701e6666867b2325f5abbb2c7
2024-02-26 10:46:18 +08:00