Commit graph

64646 commits

Author SHA1 Message Date
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
Liz Kammer
46cd7d3be7 Merge "Correct allowlisting for override modules" 2023-05-03 14:58:31 +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
Almaz Mingaleev
2429776555 Add jdk.internal.access to the allowed package list.
This is part of OpenJDK17 update.

Bug: 270674727
Test: m
Change-Id: I0708ee286cd7c3c6eef593784affaeffbdf0a76c
2023-05-03 07:21:27 +00:00
MarkDacek
1de78f3174 Fix instantiation of config.bazelForceEnabledModules
Currently, uninstantiated, the field will be set to [""]
instead of an empty slice.

Test: m nothing --ensure-allowlist-integrity
Test: m nothing --ensure-allowlist-integrity
--bazel-force-enabled-modules=com.google.android.neuralnetworks (this
fails, as expected)

Change-Id: Ib4cd26f0cb0d40714b8c3f263ee2d22093ee15ef
2023-05-03 03:48:27 +00:00
Mark Dacek
2953486e31 Merge "Process bazel metrics prior to potentially exiting upload.go" 2023-05-03 03:37:38 +00:00
Mark Dacek
833d7ee6e3 Merge "Modify --ensure-allowlist-integrity call to avoid spurious errors." 2023-05-03 03:34:48 +00:00
Spandan Das
921af32310 Print default val if all vals in axis match default val
To avoid verbosity, we currently dedupe keys in axis if its value
matches the value of //conditions:default. For axes where all values
might match the default value, we would effectively drop the common
value.

To fix this, we are now dropping the select statement and not the common
value.

Test: go test ./bp2build
Change-Id: Ic377b93ee2aba971753f6a5e7a62e15d1fcfa2bc
2023-05-03 00:35:13 +00:00
Treehugger Robot
ad3f14edf3 Merge "VSDK: use relative install path when generating snapshots" 2023-05-03 00:04:08 +00:00
Cole Faust
9e4c6c9cc7 Merge "Use api_levels_released_versions from starlark" 2023-05-02 21:55:15 +00:00
MarkDacek
ed2253e8df Process bazel metrics prior to potentially exiting upload.go
This is a necessary step for running b on CI with metrics collection.

Bug: 280491043
Test: b build libcore:all
Change-Id: I37d621c38e3f891dd63e5977befa6ce6604487ea
2023-05-02 21:35:39 +00:00
MarkDacek
6f6b962bd0 Modify --ensure-allowlist-integrity call to avoid spurious errors.
We now ensure that the module is disabled and _not_ enabled before
failing the build.

Bug: 280439299
Test: m nothing --ensure-allowlist-integrity --bazel-mode-staging (on
master and aosp)

Change-Id: I59c969a27b064f07913a511cb29bc06d23daa371
2023-05-02 21:07:36 +00:00
Andrei Onea
580f7b0094 Add script for modifying privapp permission allowlists
This script will be used to change the package that is being allowed to
use privileged permissions.

Test: python scripts/modify_permissions_allowlist.py
Bug: 242509786
Change-Id: I1d7cb3c906ad39aef42ad4394953251db40d1bf1
2023-05-02 15:10:16 -04:00
Sam Delmerico
91ac31c160 Merge "add media.swcodec to Bazel staging allowlist" 2023-05-02 18:32:00 +00:00
Yu Liu
bd421e06d1 Merge "libbuildversion should be linked as a whole archive dep as soong does." 2023-05-02 17:34:02 +00:00
Yu Liu
fe978fd2c1 libbuildversion should be linked as a whole archive dep as soong does.
Bug: 278789968
Test: Unit tests and CI
Change-Id: Ic2c44826bdc03b91cc19d93f96096ec6fdf44833
2023-05-02 17:27:44 +00:00
Yu Liu
2bedceeb53 Merge "Fix a bug where CppFlags should have been Cppflags" 2023-05-02 17:23:49 +00:00
Colin Cross
bd3a16b5e7 Install sdk variants in unbundled builds and package uninstallable variants
This effectively undoes both If6c3ee82d588e2742c85cef7244c090c93f38b8e
and I682e4f1f477f3024f7719dfaa67006ef335e0640.  SDK variants are now
installed again, which will fix unbundled builds of cc_test modules.
The platform variants used by com.android.virt are now packagable
even though they are not installable.

Fix the original problem in b/194403710 by adding a flag to platform
variants of modules in apexes that are not platform available, and
using that to prevent install and packaging dependencies.  That
allows the HideFromMake flag to go back to being used for preventing
install dependencies but not packaging dependencies.

Test: TestPackagingWithSkipInstallDeps
Test: TestFileSystemShouldInstallCoreVariantIfTargetBuildAppsIsSet
Test: TestFileSystemShouldSkipApexLibraries
Bug: 194403710
Bug: 268582372
Fixes: 274443025
Change-Id: If5418df3ddbb940bd631caebdf38daa81e71f40e
2023-05-02 15:37:26 +00:00
Liz Kammer
20f0f780df Correct allowlisting for override modules
Prevoiusly, we were partially correcting for override modules in
bp2build/mixed builds in some but not all places. Now we always check
for override modules and ensure that Bazel_module properties are
propagated properly for override modules.

Bug: 279609939
Test: go test soong tests
Change-Id: I5445aa71f4c8013315415a2ca9ab9c6b3be6bce0
2023-05-02 09:27:55 -04:00
Sam Delmerico
befbf05350 add media.swcodec to Bazel staging allowlist
Bug: 279756270
Change-Id: Id8c9734185ff4fa263a2b4c28b1b7ecafa7bb0c3
2023-05-02 09:24:37 -04:00
Justin Yun
17d0ee2160 VSDK: use relative install path when generating snapshots
Without respecting the relative install path, the snapshot install
path may collide when they use the same stem name.
To avoid this, respect the relative install path when generating the
snapshots.

Bug: 279652606
Test: RECOVERY_SNAPSHOT_VERSION=current m recovery-snapshot
Change-Id: Ic70a5855aeb2a6eda397b4dd06113dddb6ef70f4
2023-05-02 16:29:06 +09: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
e018bc858b Merge "Enforce stub libraries should have a single apex_available" 2023-05-01 23:43:01 +00:00
Yu Liu
93893ba061 Fix a bug where CppFlags should have been Cppflags
Bug: 278789968
Test: unit test and manual build
Change-Id: I9abb056e6b820414707247d1b19ba6aabffc26ea
2023-05-01 13:55:53 -07:00
Sam Delmerico
316b0158fe Merge "add LLVM_*_VERSION envvars to allowlist" 2023-05-01 20:23:16 +00:00
Sam Delmerico
162fb00eb3 Merge "Revert "Respect Clang version override env vars."" 2023-05-01 20:23:16 +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
098f49de26 Merge "Allowlist more modules" 2023-05-01 14:53:43 +00:00
Treehugger Robot
176271a426 Merge "Correct cc_test_library migration" 2023-05-01 14:38:41 +00:00
Liz Kammer
d3b78b2381 Merge "Remove alexmarquez from owners." 2023-05-01 12:30:48 +00:00
Spandan Das
5e1525d1de Merge changes Ibbb14b0d,I9aa552e3
* changes:
  Create config_setting per apex_name
  Add a function to create config_setting(s)
2023-04-29 03:52:55 +00:00
Treehugger Robot
2f6179d4f5 Merge "Enable HWASan for multiple modules in one place(Soong)" 2023-04-29 00:10:16 +00:00
Treehugger Robot
e605b39e61 Merge "target_sdk_version replacement should respect REL branches" 2023-04-28 23:18:16 +00:00
Liz Kammer
9b2ca5c8c9 Prevent sh_test from migrating as sh_binary
Test: CI
Change-Id: I4cb789e3f1351fcb1635d58b72c265eac4bf62d8
2023-04-28 17:39:24 -04:00
Spandan Das
4242f10462 Create config_setting per apex_name
These are created by bp2build in /build/bazel/rules/apex. Eventually
these config_settings should likely be colocated with the source apex
definition.

Another alternative was to make Bazel's apex a macro that generates a
config_setting. I did not pursue this further for now since it requires the
apex_available of every allowlisted cc_library to also be allowlisted.
This might not always be true (e.g. com.android.runtime)

Test: go test ./bp2build
Change-Id: Ibbb14b0d9c1491b3c79b7634a18d9d35b03922c1
2023-04-28 20:37:35 +00:00
Spandan Das
6a448ec1a3 Add a function to create config_setting(s)
The use case for this is creating config_setting(s) specific to an apex
variant and selecting stub/impl in that config_setting. We likely need
only a handful of such config_setting(s), but determining that list
requires iterating the build graph.

Test: go test ./bp2build
Change-Id: I9aa552e3d0bcf67513023c3a7d4bbf8fae464ee4
2023-04-28 19:43:43 +00:00
Mark Dacek
4188a899dc Merge "Add bazel exit code to bazel metrics proto." 2023-04-28 19:40:52 +00:00
Liz Kammer
d2442920d7 Remove alexmarquez from owners.
Test: n/a
Change-Id: Ic303c60bd688023bac8225c4f8435fbbb2272252
2023-04-28 15:39:43 -04:00
Liz Kammer
f0ab546f38 Allowlist more modules
Test: CI
Test: mixed_droid
Change-Id: I9c2a816f96399401482c93cae2cb9328abbecd16
2023-04-28 13:20:36 -04: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
MarkDacek
18ed8a912b Add bazel exit code to bazel metrics proto.
Bug: 279754118
Test: N/A
Change-Id: I52558843f40bf54b75a4255b0a9d96e9dcaa81bc
2023-04-28 14:50:32 +00:00
Chris Wailes
b5ae9bcf90 rustc-1.69.0 Build 10027731
Bug: https://issuetracker.google.com/issues/274972941
Test: m rust
Change-Id: I03ba07802c2d77d5e3776cc49abac8b98d6ebbfe
2023-04-28 01:15:55 -07: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
Juan Yescas
05d4d90114 16k: Align shared libraries and executables to 4k by default
The default ELF segment alignment will be 4096. This alignment
can be overriden by setting the desired alignment in
PRODUCT_MAX_PAGE_SIZE_SUPPORTED flag. The alignment has to be
a multiple of the configured kernel page size.

Test: Built changes for Pixel 4a, 6 and checked alignment.
Bug: 276963698
Bug: 276801883
Change-Id: Icb380041a5b27da1fa0d86b302e1e7cde9a236d7
2023-04-28 02:42:20 +00:00
Spandan Das
12d170dc2a Merge changes I91063ebb,Id859723b
* changes:
  Differentiate between empty and nil input
  Do not modify input in-place
2023-04-28 00:07:57 +00:00
Spandan Das
20fce2d340 Enforce stub libraries should have a single apex_available
If a library contributes to an API surface, it will have only a single
copy on device. Therefore, we should disallow installation to muliple
apexes/platform.

There are some exceptions to this rule today, and they have been relaxed
using allowlists.

Bug: 277651159
Test: go test ./apex
Change-Id: Ice3023ecd28412a2610d8b98628cb727b58c5c3b
2023-04-27 23:24:55 +00: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
Spandan Das
c0f9a2178f Merge "Re-enable TestMixedBuildUsesStubs" 2023-04-27 23:11:14 +00:00
Spandan Das
cc4da76511 Differentiate between empty and nil input
Previously, CopyOf on an empty list was returning nil. With the updates
to SortedUniqueStrings and FirstUniqueStrings, we need to differentiate
between empty lists and nil.

Test: m nothing
Change-Id: I91063ebbe5013cbda5d8f70efde4683c66581599
2023-04-27 19:34:08 +00:00