Commit Graph

83897 Commits

Author SHA1 Message Date
Colin Cross
fdaa672ad1 Remove obsolete robolectric test runner integration
The `m Run*RoboTests` test runner is no longer supported, remove the
code to generate the Make rules for it.

Also reduce the number of combining steps by passing the extra jars
that need to be combined into the compile step.

This relands Icf05079bf570bed7a10962cbf03459bd53c51f99 with a fix to
reorder the instrumented app classes after dependency classes.

Test: atest --host SystemUiRoboTests
Flag: EXEMPT refactor
Change-Id: I174ceb95af5557e1859eeb12a2f5fac2332975a8
2024-09-04 15:47:11 -07:00
Yu Liu
c55b25f125 Merge "Move the caching/restoring code from soong to blueprint to fully skip build actions." into main 2024-09-04 22:01:33 +00:00
Treehugger Robot
b94fef7278 Merge "Revert "Remove obsolete robolectric test runner integration"" into main 2024-09-04 21:36:08 +00:00
Priyanka Advani (xWF)
72853677e8 Revert "Remove obsolete robolectric test runner integration"
This reverts commit ef5739ed64.

Reason for revert: Droidmonitor created revert due to b/364665936.

Change-Id: Ia18f642492eafdbe2e78d9f753d87f243d529037
2024-09-04 20:15:58 +00:00
Yu Liu
26a716d5e5 Move the caching/restoring code from soong to blueprint to fully skip build actions.
Bug: 358425833
Test: Manually verified the generated ninja and mk files and CI.
Change-Id: Ieebb822c46f37c0ff55fad08531e9870a76cbd7b
2024-09-04 19:59:55 +00:00
Steven Moreland
56aed2b0e8 Merge changes from topic "libbinder_ndk-remove-cpp-headers" into main
* changes:
  ndk_library: limit exports
  Reland "Truely re-export export_header_libs from ndk_library"
  ndk_library depends on the correct arch variant of cc_library_headers
2024-09-04 18:23:19 +00:00
Colin Cross
13d8e82c5e Merge "Rename collectTransitiveHeaderJars and friends to mention R8" into main 2024-09-04 17:34:03 +00:00
Colin Cross
b09e8ec23c Merge "Remove obsolete robolectric test runner integration" into main 2024-09-04 17:21:47 +00:00
Colin Cross
ca3bf2be39 Merge "Move checkbuild targets of Soong modules into Soong" into main 2024-09-04 17:12:03 +00:00
Treehugger Robot
19b81d777d Merge "apex: run host_apex_verifier" into main 2024-09-04 17:07:45 +00:00
Cole Faust
b9e7915f6f Merge "Add tests for configurable PostProcessors" into main 2024-09-04 16:49:32 +00:00
Treehugger Robot
2b5dd203d4 Merge "Revert^2 "Add an explanation to ndk_library."" into main 2024-09-04 16:31:05 +00:00
Colin Cross
a158a71d25 Revert^2 "Add an explanation to ndk_library."
This reverts commit a27204273d.

Reason for revert: unrelated to breakage

Change-Id: Ic7cb64acd72ee8502e608609c0e197fba6a27bf2
2024-09-04 15:33:04 +00:00
Pechetty Sravani (xWF)
53aaadff61 Merge "Revert "Add an explanation to ndk_library."" into main 2024-09-04 06:30:57 +00:00
Pechetty Sravani (xWF)
a27204273d Revert "Add an explanation to ndk_library."
This reverts commit ba9f9262a3.

Reason for revert: DroidMonitor created revert due to b/364440900.

Change-Id: I8661cdce1a1187459b6a0acde4c64a5aa70dcc87
2024-09-04 04:47:25 +00:00
Treehugger Robot
2f33c04a97 Merge "Sandbox environment variables" into main 2024-09-04 02:26:58 +00:00
Jooyung Han
0a9eb7f657 Merge changes Ia9f2186e,Ibe567d3b into main
* changes:
  Refactor around apex aconfig files (#2)
  Refactor around apex aconfig files
2024-09-04 01:23:31 +00:00
Treehugger Robot
28b190bc83 Merge "Add an explanation to ndk_library." into main 2024-09-04 01:14:59 +00:00
Yihan Dong
a596b12878 Merge "Apply apimapper instrument tool on android tests" into main 2024-09-04 00:52:09 +00:00
Jiyong Park
b11c99d084 Merge "Make overrides work in Soong" into main 2024-09-04 00:03:20 +00:00
Cole Faust
63ea1f966e Sandbox environment variables
So that the build can't access extra information unintentionally.
Particuarly ANDROID_BUILD_TOP is dangerous.

In the future PATH should be locked down as well.

Bug: 307824623
Test: Added a all_genrules target and built that
Change-Id: I88bb0efb0a82529a1c85875a53cf20c8384d07fe
2024-09-03 16:38:28 -07:00
Dan Albert
ba9f9262a3 Add an explanation to ndk_library.
Bug: http://b/357711733
Test: None
Change-Id: I56fde036f7fe49ccf8b3a47a4eaaa4abac008fc7
2024-09-03 23:05:46 +00:00
Steven Moreland
0db999c45e ndk_library: limit exports
The NDK should stand alone, and the libbinder_ndk case
is created because libbinder_ndk in the NDK used to
contain extra C++ headers, but these were moved into
the SDK to be next to AIDL. Since many modules depend
on these headers, exports are only allowed for this case.

Bug: 357711733
Test: build with neverallow breaking, for instance:

error: frameworks/wilhelm/Android.bp:56:1: module "libOpenSLES.ndk" variant "android_x86_64_silvermont_sdk_shared_21": violates neverallow requirements. Not allowed:
        module types: ["ndk_library"]
        properties matching: "Export_header_libs" matches: .is-set
        EXCEPT in dirs: ["frameworks/native/libs/binder/ndk/"]

Change-Id: I9a32d3cb7f644fb5dbc1e8072894f2f585b2cd6d
2024-09-03 23:03:37 +00:00
Treehugger Robot
aebccc735a Merge "Fix End() of Rule" into main 2024-09-03 22:18:51 +00:00
Steven Moreland
bedc997c40 Reland "Truely re-export export_header_libs from ndk_library"
This reverts commit 7f1ae59d94.

Reason for revert: b/357711733, reland with allowlist

Bug: 357711733
Change-Id: I11864eb2168c4333ad5759d0d057fda8529da24e
Test: build
2024-09-03 21:52:29 +00:00
Colin Cross
ef5739ed64 Remove obsolete robolectric test runner integration
The `m Run*RoboTests` test runner is no longer supported, remove the
code to generate the Make rules for it.

Also reduce the number of combining steps by passing the extra jars
that need to be combined into the compile step.

Test: atest --host SystemUiRoboTests
Flag: EXEMPT refactor
Change-Id: Icf05079bf570bed7a10962cbf03459bd53c51f99
2024-09-03 14:52:26 -07:00
Colin Cross
9ffaf28f5f Rename collectTransitiveHeaderJars and friends to mention R8
collectTransitiveHeaderJarsForR8 visits direct dependencies and collects
all transitive libs and static_libs header jars.  The semantics of the
collected jars are odd (it collects combined jars that contain the static
libs, but also the static libs, and it collects transitive libs dependencies
of static_libs), so these are only used to expand the --library arguments
to R8.  Rename the method and all the fields it uses with a "ForR8"
suffix to avoid confusion when more transitive header jar collection is
added to support transitive classpaths.

Bug: 308016794
Test: all soong tests pass
Change-Id: I291a86fbbc2e2f088598fb309d1b992080d60941
2024-09-03 14:52:26 -07:00
Colin Cross
a6182ab2fa Move checkbuild targets of Soong modules into Soong
Pass the name of Soong's checkbuild target for each module to
Make so that it can depend on it from the main checkbuild rule.
This will give better control over which files get built, allowing
checkbuild to skip the jar combining step when transitive classpath
jars are enabled.  The per-module checkbuild targets are passed to
make instead of added directly as a dependency of checkbuild in order
to maintain the existing behavior of only building modules exposed
to make in checkbuild.

Also tweak the existing calls to CheckbuildFile and add
InstallFileWithoutCheckbuild to match the files that are
in the Make-based checkbuild.

Bug: 308016794
Test: m checkbuild
Change-Id: Ic5140819381d58f4d00f23a7a12447950c4cf268
2024-09-03 14:52:19 -07:00
Jiyong Park
f8fab9b8c6 ndk_library depends on the correct arch variant of cc_library_headers
Previously before aosp/3249712, ndk_library was assumed to depend only
on ndk_headers, which do not have any variants.

As ndk_library can now depend on cc_library_headers which has many
variants for arch, sdk, and more, the previous assumption no longer
holds.

Therefore, when ndk_library makes a dependency to its
export_lib_headers, it now uses either AddFarVariationDependency with
(for ndk_headers) or AddVariationDependency (for others) depending on
which module type it depends on.

Bug: 357711733
Test: build with  https://r.android.com/q/topic:%22no-cpp-in-ndk-2%22
Change-Id: Id0957e82736bd458e15674ffc45ca32b1e3a7250
2024-09-03 21:52:12 +00:00
Dan Albert
fc4607a412 Merge "Revert "Truely re-export export_header_libs from ndk_library"" into main 2024-09-03 21:07:54 +00:00
Dan Albert
7f1ae59d94 Revert "Truely re-export export_header_libs from ndk_library"
This reverts commit 88c768dd7f.

Reason for revert: not how this module type is supposed to be used

Change-Id: Iced1ad336c5fe5d630bb8e268b08d652e80f262d
2024-09-03 19:55:06 +00:00
Spandan Das
c965be6ca2 Merge "HideFromMake in apexTransitionMutator should respect special cases" into main 2024-09-03 16:32:29 +00:00
Min Yun
e9cc403553 Fix End() of Rule
If a directive appears in the middle of a Rule,
the Rule does not reflect its length.
This must be reflected to obtain the correct End() position of the Rule.

Change-Id: I67a78f95487829c639b0c1414ac4cc096faa6363
2024-09-03 20:36:47 +09:00
Jooyung Han
a3fddf40ca Refactor around apex aconfig files (#2)
Aconfig files are treated like other files in APEX. This way, we can
dedup the code hanlding those files (copy commands, fs_config, etc).

Bug: n/a
Test: m nothing --no-skip-soong-tests
Change-Id: Ia9f2186e4e54e92ad90c7a9c00474cb0f7519a31
2024-09-03 13:22:21 +09:00
Jooyung Han
6186ef9004 Refactor around apex aconfig files
We can iterate over the collection of apex file.

Bug: n/a
Test: m nothing --no-skip-soong-tests
Change-Id: Ibe567d3b251c54d656793dc443eb68fb9137f42f
2024-09-03 11:14:19 +09:00
Jiyong Park
a574d535b5 Make overrides work in Soong
This change adds `overrides` property to all module types. It is used
to prevent another module (or modules) from being installed or packaged.

Bug: 330141242
Test: go test ./...

Change-Id: I4f05c603f0c5dbb699d00327882c7498472b59de
2024-09-02 19:58:38 +09:00
PODISHETTY KUMAR (xWF)
cdd70d268a Merge "Revert "Clean environment variables to account for sandbox work directory."" into main 2024-09-02 06:57:34 +00:00
Jooyung Han
2adba487bb apex: run host_apex_verifier
For now, the tool checks .rc files:
- .rc files are okay.
- services should run binary in apex.

Bug: 223896570
Test: m <apex>
Change-Id: I469c20afeff01cf10955ff2419113d6ac2d4cf45
2024-09-02 15:30:15 +09:00
PODISHETTY KUMAR (xWF)
9543d19b4b Revert "Clean environment variables to account for sandbox work directory."
This reverts commit 0af8ea14fc.

Reason for revert: <Droidmonitor created revert due to b/363848580. Will be verifying through ABTD before submission.>

Change-Id: Iafba28897ad27df67ef8ae8904454196c482216d
2024-09-02 03:54:36 +00:00
Yihan Dong
8be09c2075 Apply apimapper instrument tool on android tests
Apimapper is a tool to instrument android tests to log potentail API calls at the run time.

The real tool is developed internally. We use a placeholder binary in
AOSP before the real tool is ready.

The tool will only take affect when the enviroment var EMMA_API_MAPPER
is set to true.

Test: m cts
Bug: 328699028

Change-Id: Iece53b8afdb9803334b7393527f4fa24e22f71a8
2024-09-02 09:02:08 +08:00
Taylor Santiago
3cd732bcd1 Merge "Clean environment variables to account for sandbox work directory." into main 2024-08-31 04:04:22 +00:00
Spandan Das
afa3add57e HideFromMake in apexTransitionMutator should respect special cases
At ToT, platform variants of modules are hidden from make, unless the module
has `//apex_available:platform` in its Android.bp file. However, there
are special cases which always require the platform variant to be
visible to make - e.g. bootstrap bionic libraries.

`markPlatformAvailability` handles these special cases. This CL updates
the subsequent apexTransitionMutator to hide the platform variant when
module.NotAvailableForPlatform is true in addition to the existing
module type specific `AvailableFor` check

Test: no diff in file_list.txt
Bug: 281077552
Change-Id: Ie9d7341e206276ff96d3d64fec21b8f5dcfd6ceb
2024-08-31 02:26:35 +00:00
Steven Moreland
729c770b02 Merge "Truely re-export export_header_libs from ndk_library" into main 2024-08-30 22:02:30 +00:00
Jihoon Kang
7344482ff3 Merge "Revert^4 "Implement detecting container violations."" into main 2024-08-30 20:18:53 +00:00
Cole Faust
b93f7fe73c Add tests for configurable PostProcessors
Bug: 362579941
Test: m nothing --no-skip-soong-tests
Change-Id: Iaaff66844ebe0b2fb19148bd07562785b12cd7e9
2024-08-30 13:04:37 -07:00
Paul Duffin
c540beef74 Retry: Allow modules to override --error-when-new UnflaggedApi
Some `java_sdk_library` and `droidstubs` modules already specify
`--error UnflaggedApi` but they are currently ignored because they are
added before the `--error-when-new UnflaggedApi` automatically added by
Soong and Metalava uses the last setting. That means adding
`--error-when-new UnflaggedApi` in change https://r.android.com/3248013
actually reduced the severity of the issue for those modules making it
more likely that they would be missed.

This change only adds the `--error-when-new UnflaggedApi` if it does
not already appear in the metalava command.

Bug: 361582214
Test: m checkapi
Change-Id: I7228bf9794b1c7e27d7acf7a461956b30f3335f5
2024-08-30 15:27:07 +01:00
Jiyong Park
88c768dd7f Truely re-export export_header_libs from ndk_library
Bug: 357711733
Test: m CtsNdkBinderTestCases
Change-Id: If498f42cb93904c117129cd96286b437607d6b0a
2024-08-30 11:41:45 +09:00
Treehugger Robot
7a2a25492a Merge "Add aconfig_storage_reader_java to the global container violation allowlist" into main 2024-08-29 23:26:15 +00:00
Pirama Arumuga Nainar
7bab95be6c Merge "Revert^2 "Enable -Wsingle-bit-bitfield-constant-conversion"" into main 2024-08-29 20:49:57 +00:00
Taylor Santiago
0af8ea14fc Clean environment variables to account for sandbox work directory.
Unset HOME to prevent username leak.

Bug: 363037195

Change-Id: I7a8694f746d58de8f6e41adb6ad52abbaf955ef4
2024-08-29 20:12:35 +00:00