Commit Graph

83874 Commits

Author SHA1 Message Date
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
Treehugger Robot
aebccc735a Merge "Fix End() of Rule" into main 2024-09-03 22:18:51 +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
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
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
Priyanka Advani (xWF)
2075155076 Merge "Revert "Allow modules to override --error-when-new UnflaggedApi"" into main 2024-08-29 18:56:17 +00:00
Jihoon Kang
bf65d1b631 Add aconfig_storage_reader_java to the global container violation allowlist
The module is implicitly added as a dependency for all
java_aconfig_library modules, but does not generate the stubs.

Test: CI
Bug: 338660802
Change-Id: I6ef0f5f5f445e6f70debc3f79e3fd81ed2331366
2024-08-29 18:49:00 +00:00
Priyanka Advani (xWF)
b09c0d25c9 Revert "Allow modules to override --error-when-new UnflaggedApi"
This reverts commit 3001ce3bf5.

Reason for revert: Droidmonitor created revert due to b/363016109

Change-Id: Iaf3ca41520b4328fc727af8837e5dff6def41f2b
2024-08-29 18:48:14 +00:00
Treehugger Robot
f016b08ece Merge "Allow modules to override --error-when-new UnflaggedApi" into main 2024-08-29 17:58:56 +00:00
Jihoon Kang
85bc193805 Revert^4 "Implement detecting container violations."
This change introduces a method to detect violating inter-container
dependencies between modules. The method is run in
`ModuleBase.GenerateBuildActions`, after the container info provider is
set. Given that the provider of the direct dependencies would have been
set at this time, the method utilizes this information to determine
the violations, which are introduced in https://r.android.com/3141104.

Note that this enforcement does not turn all inter-container
dependencies as errors. Instead, it will only turn dependencies that
matches the pre-defined violations into errors. Even if the dependency
matches the violation, an error will not be thrown if the dependency
satisfies any of the exception functions (e.g. the dependent module is
stubs, or the two modules belong to the same apexes).

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: Ib9ddc0761fa46f1309b1a1a4f759d9a4e04fd70e
2024-08-29 17:55:00 +00:00
Yu Liu
11d8b6e8d3 Merge "Remove containersInfo, complianceMetadataInfo and aconfigFilePaths from ModuleBase." into main 2024-08-29 17:07:05 +00:00
Pirama Arumuga Nainar
65087c3588 Revert^2 "Enable -Wsingle-bit-bitfield-constant-conversion"
This reverts commit e64573b0c0.

Reason for revert: re-submit after fixing build breaks.

Change-Id: Ia43b8ffa23355f14e656ce086b23e1ca0d3821ca
2024-08-29 16:44:10 +00:00
Paul Duffin
3001ce3bf5 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: I499183276c7520605cca7acc6e6e9ab535feaa86
2024-08-29 15:35:58 +01:00
Priyanka Advani (xWF)
88a8daf8ca Merge "Revert^3 "Implement detecting container violations."" into main 2024-08-28 23:20:03 +00:00
Priyanka Advani (xWF)
33b3a638a5 Revert^3 "Implement detecting container violations."
2a88491afc

Change-Id: Iba4527f391a093703978fe01177b56fec4604b28
2024-08-28 23:10:29 +00:00
Jiyong Park
ae74fb63f1 Merge "logical_partition.groups.partitions.filesystem can be empty" into main 2024-08-28 23:08:35 +00:00
Priyanka Advani (xWF)
3efbd354d7 Merge "Revert "Enable -Wsingle-bit-bitfield-constant-conversion"" into main 2024-08-28 21:52:30 +00:00
Priyanka Advani (xWF)
e64573b0c0 Revert "Enable -Wsingle-bit-bitfield-constant-conversion"
Revert submission 3238689-bitfield-warning-cleanup

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

Reverted changes: /q/submissionid:3238689-bitfield-warning-cleanup

Change-Id: I9a35a52a79145541bb6bb3880ae8de2d1c09c02e
2024-08-28 21:44:53 +00:00
Jihoon Kang
c14be38f1a Merge changes Ia693c4a5,I8e5620d2 into main
* changes:
  Revert^2 "Implement detecting container violations."
  Define additional container violations
2024-08-28 21:35:16 +00:00
Treehugger Robot
f5a03c7957 Merge "Add com.google.pixel.camera.hal.manifest to build number allowlist" into main 2024-08-28 21:28:55 +00:00
Pirama Arumuga Nainar
ce531ba405 Merge "Enable -Wsingle-bit-bitfield-constant-conversion" into main 2024-08-28 20:24:04 +00:00
Treehugger Robot
5fa409b88e Merge "Report UnflaggedApi issues as warnings but treat as errors when new" into main 2024-08-28 19:13:24 +00:00
Cole Faust
dc0187811f Add com.google.pixel.camera.hal.manifest to build number allowlist
So that it can be removed from the genrule sandboxing allowlist.
Because this is an internal module, I'm submitting this allowlist
addition first, then will make the genrule use it, then will remove
it from the sandboxing allowlist.

Bug: 307824623
Test: Presubmits
Change-Id: Ia7001d89a57fd1d2fbe3b0f79fb68fecf859fbb4
2024-08-28 11:14:35 -07:00
Jihoon Kang
2a88491afc Revert^2 "Implement detecting container violations."
This change introduces a method to detect violating inter-container
dependencies between modules. The method is run in
`ModuleBase.GenerateBuildActions`, after the container info provider is
set. Given that the provider of the direct dependencies would have been
set at this time, the method utilizes this information to determine
the violations, which are introduced in https://r.android.com/3141104.

Note that this enforcement does not turn all inter-container
dependencies as errors. Instead, it will only turn dependencies that
matches the pre-defined violations into errors. Even if the dependency
matches the violation, an error will not be thrown if the dependency
satisfies any of the exception functions (e.g. the dependent module is
stubs, or the two modules belong to the same apexes).

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: Ia693c4a53369c757a3e96656a769405c759b111c
2024-08-28 18:01:25 +00:00
Jihoon Kang
a1527e5e23 Define additional container violations
This violation was only triggered for specific TARGET_PRODUCT builds.

Test: build/soong/scripts/build-ndk-prebuilts.sh
Bug: 338660802
Change-Id: I8e5620d26eff83bdbda79da8bb8237056cb9dfbd
2024-08-28 17:59:52 +00:00
Paul Duffin
88d3b39846 Report UnflaggedApi issues as warnings but treat as errors when new
The `UnflaggedApi` issue is only reported when doing API linting and
defaults to `Severity.HIDDEN` because AndroidX (among other users) do
not support using `@FlaggedApi` annotations. This change switches it to
be warning by default in the  Android build as there are some existing
instances of it, but will be treated as an error by the "Build Warnings
Aye Aye Analyzer" in a Gerrit change if it occurs on lines that are
modified/added by that change.

Bug: 361582214
Test: m checkapi
Change-Id: Ie5ed23d00dd49454aeb5b43ccd8ad027d9d34fd2
2024-08-28 18:24:02 +01:00
Yu Liu
b41b74fa2c Merge "Remove packagingSpecsDepSet from ModuleBase." into main 2024-08-28 17:12:07 +00:00
Cole Faust
80a6541647 Merge "Move aidl_camera_build_version to build number allowlist" into main 2024-08-28 16:59:54 +00:00