Commit graph

6893 commits

Author SHA1 Message Date
Cole Faust
e8561c6108 Include "soong" in sandboxed out paths
Previously, the path to built files in the sandbox would be
out/.intermediates/... instead of out/soong/.intermediates/....

After this cl, it will be out/soong/.intermediates/.... This makes
it more consistent with the non-sandboxed paths, which is easier for
developers.

CtsApkVerityTestDebugFiles is a genrule that's used to find the paths
to other modules. Developers were expected to build it, then copy all
the files listed in its output file to a temporary directory. Those
paths would be wrong before this change.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py CtsApkVerityTestDebugFiles
Change-Id: Iadf9e3240a2c828567e46b6b02cc14004f30e8bf
2023-12-19 12:14:01 -08:00
Cole Faust
8fc38f3761 Add sdk_genrule
Some users want to repackage the results of an sdk module.
Genrules have 3 variants: linux, android, and common_os. The common_os
one produces a snapshot zip file that users want. In order to get
access to it, we need a genrule in the same variant, so create
an sdk_genrule for that.

The sdk_genrule shouldn't have linux/android variants either, because
those other variants would get errors when trying to depend on the
sdk modules because the snapshot zip doesn't exist in those other
variants. The code in arch.go needs to be tweaked to allow a common_os
variant without the other variants.

Bug: 315962165
Test: m dist out/dist/art_release.zip
Change-Id: Idc9b3cae7a525d71aed6bafa0f8724a89f75a94b
2023-12-13 14:11:24 -08:00
Treehugger Robot
fa6995f75e Merge "Remove infrastructure to run bp2build" into main 2023-12-12 20:03:58 +00:00
Colin Cross
a72573a727 Merge "Remove ConvertWithBp2build implementations" into main 2023-12-11 23:12:53 +00:00
Colin Cross
b63d7b3af7 Remove infrastructure to run bp2build
Bug: 315353489
Test: m blueprint_tests
Change-Id: Idcf6377d389b94c39e4e6ff4b8efa8a9f9e78b17
2023-12-08 13:51:07 -08:00
Colin Cross
8ff105860d Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.

Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
2023-12-08 13:51:05 -08:00
Yu Liu
95572ff2da Remove the code for bazel when reading ReleaseAconfigValueSets.
Bug: 315353489
Test: CI
Change-Id: I652f78df6d9256cdb35b8b498e20bcb76f1437b3
2023-12-07 16:38:45 -08:00
Vilas Bhat
3ad4cf3a9a Merge "16k: soong: Update DevicePageSizeAgnostic to DeviceNoBionicPageSizeMacro" into main 2023-12-06 13:16:19 +00:00
Aleksei Vetrov
fb510be871 Merge "Move NDK ABI monitoring enabling flag to release flags" into main 2023-12-06 11:11:35 +00:00
Aleksei Vetrov
146e9824c5 Move NDK ABI monitoring enabling flag to release flags
Currently NDK ABI monitoring is enabled by switching boolean flag in
soong code. When this flag is switched, it will enable ABI monitoring in
all release configurations at once.

This change moves the flag from soong code to the trunk-stable flags
framework ("build/release/build_flags.scl") that allows to enable it
only in specific configurations like "trunk-staging".

Test: TH
Bug: 156513478
Change-Id: Ibb810a834c0d756b22782b1a2d8ec5a5e575a4b3
2023-12-05 23:52:46 +00:00
Vilas Bhat
b3d2d22a5d 16k: soong: Update DevicePageSizeAgnostic to DeviceNoBionicPageSizeMacro
This is part of a larger change to update the flag
PRODUCT_PAGE_SIZE_AGNOSTIC to PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO.
This is to help clarify that this flag doesn't mean the device
will actually work end-to-end with any page size.

Bug: 312541564
Test:
```
source build/envsetup.sh
lunch aosp_cf_arm64_phone_pgagnostic-trunk-userdebug
m
cat out/soong/build.aosp_cf_arm64_phone_pgagnostic.ninja | grep __BIONIC_NO_PAGE_SIZE_MACRO
```

Change-Id: I33033876d0d4a276d1bb962d40315b71a3968c66
2023-12-05 23:49:50 +00:00
Aditya Choudhary
26df39fe44 Add source file provider for genrule/srcs, python libraries and rust libraries.
Change-Id: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
2023-12-05 19:56:26 +00:00
Aditya Choudhary
8094b6bf9d Add Code Metadata rule to soong/testing.
This Cl adds a new rule to Soong to generate code ownership metadata. Also, this CL adds a provider in the Java SDK library to provide generated source files to the Code_metadata rule. Will add providers to other libraries in the future changes.

Bug: 296873595
Change-Id: Ic2e43aa9b161231fea4416d1f0d36b778361d7c5
2023-12-05 18:10:03 +00:00
Treehugger Robot
e0a5c5ae1d Merge "Define __ANDROID_VENDOR_API__" into main 2023-12-05 03:48:26 +00:00
Joe Onorato
9390fb85f6 Merge "Add accessor function for bool product variables." into main 2023-12-05 00:53:05 +00:00
Colin Cross
2998c33d43 Merge "Add TestContext parameter to ContentFromFileRuleForTests" into main 2023-12-05 00:29:10 +00:00
Joe Onorato
3fefc23391 Add accessor function for bool product variables.
Test: treehugger
Change-Id: If6a59ba140d28696d1411ee5b5fcfc4fc0e97926
2023-12-04 17:36:22 +00:00
Colin Cross
f61d03d241 Add TestContext parameter to ContentFromFileRuleForTests
The next CL will need a TestContext parameter in
ContentFromFileRuleForTests in order to retrieve the file rule contents
from the Config.  Add it and update all the tests that use it in order
to simply review of the next CL.

Bug: 306029038
Test: go test ./...
Change-Id: Ia4b4c9854017ea3472fa2f8ba42cf7f72720496e
2023-12-03 17:22:56 -08:00
Colin Cross
0d5dd390c6 Merge "Move test data installation to Soong" into main 2023-12-01 18:56:01 +00:00
Roshan Pius
66b10a7ffa Merge "soong(nfc): Create framework-nfc sdk library" into main 2023-12-01 17:12:39 +00:00
Colin Cross
5c1d5fb21b Move test data installation to Soong
To generate module-info.json in Soong for b/309006256 Soong needs to
know the test data paths. Moving test data installation into Soong will
also help later for test suite packaging.

Add ModuleContext.InstallTestData that installs the files listed in a
[]DataPath alongside the test.  The files will also be passed to Make
to allow it to continue packaging them into the test suites for now.

Update the module types that are producing LOCAL_TEST_DATA entries
in their Android.mk files to go through InstallTestData instead.

Bug: 311428265
Test: atest --host toybox-gtests --test-timeout=120000
Change-Id: Ia8b964f86e584ea464667fd86a48d754d118bead
2023-11-30 13:38:49 -08:00
Yu Liu
9dc6b1025d Merge "Add container property to aconfig_declarations." into main 2023-11-30 21:33:34 +00:00
Justin Yun
41cbb5e9b5 Define __ANDROID_VENDOR_API__
cc modules can use __ANDROID_VENDOR_API__ to read BOARD_API_LEVEL
that is the API level of the vendor surface.

Bug: 313822931
Test: check ninja commands to have -D__ANDROID_VENDOR_API__=<version>
Change-Id: Iceb5918cbfce0f24929d02d7e3caf1e9942b88e8
2023-11-30 05:26:12 +00:00
Colin Cross
74656ccf35 Merge "Don't write license data to Android-${TARGET_PRODUCT}.mk" into main 2023-11-28 22:51:32 +00:00
Yu Liu
eae7b36699 Add container property to aconfig_declarations.
Bug: 311155208
Test: Unit test
Change-Id: I7b187138856d0144203961e82b6dad5e2f8eed9d
2023-11-28 12:37:02 -08:00
Yi-Yo Chiang
62093cf7fc Merge "Deprecate BOARD_BUILD_GKI_BOOT_IMAGE_WITHOUT_RAMDISK" into main 2023-11-28 00:38:44 +00:00
Cole Faust
77beb6f12a Remove google_clockwork list of soong plugins
The only plugin in that list has been removed.

Bug: 307824623
Test: Presubmits
Change-Id: Ieceb8610cfb2425500659a009703895a4f499cb1
2023-11-27 12:29:55 -08:00
Yi-Yo Chiang
939fe1a751 Deprecate BOARD_BUILD_GKI_BOOT_IMAGE_WITHOUT_RAMDISK
These variables are no longer used. We don't build GKI in the platform
tree anymore. Remove these vars as we are not maintaining these.

Bug: 229701033
Test: presubmit
Change-Id: I7551aa37a049f3bc9252559a18feb0f6bdf0a548
2023-11-24 15:07:21 +08:00
Colin Cross
a16bd6b714 Don't write license data to Android-${TARGET_PRODUCT}.mk
All the necessary license data is already propagated through the license
metadata file, and the entries in Android-${TARGET_PRODUCT}.mk are not
used.  Remove them, which should both reduce the size and parsing cost
of the Android-${TARGET_PRODUCT}.mk file and also removes a variable
that changes when dependencies are added or removed, which will
eventually allow running kati less often.

Bug: 309006256
Test: No change to out/Android-aosp_cf_x86_64_phone.ninja
Change-Id: Idfeb6fd10d77497ca274f8e74fe8e994ce1cafe6
2023-11-21 15:27:44 -08:00
Colin Cross
d442a0e882 Add DataPath.ToRelativeInstallPath
Add a method to DataPath that converts it to the relative install path
in preparation for adding additional complexity to DataPath.

Bug: 311428265
Test: builds
Change-Id: I65b06238aafda2db72c6a253744a3087976451cd
2023-11-17 19:06:50 -08:00
Colin Cross
09ad3a6505 Change deps of ctx.Install* from Paths to InstallPaths
Installed files should only depend on other installed files, change
the deps arguments of the ctx.Install* methods from Paths to
InstallPaths.

Bug: 311428265
Test: builds
Change-Id: I1ebef60a943bdbe907744cc43aa985371ac56d32
Merged-In: I1ebef60a943bdbe907744cc43aa985371ac56d32
2023-11-17 19:06:43 -08:00
Roshan Pius
92307ffa58 soong(nfc): Create framework-nfc sdk library
Splits out the NFC API classes that are going to be part of NFC mainline
module. Uses `framework-location` as reference.

Bug: 303286040
Test: Device boots up after flashing
Test: atest CtsNfcTestCases
Merged-In: I309e76165f5563147dde5e581316ee4ac463fbc4
Change-Id: I309e76165f5563147dde5e581316ee4ac463fbc4
2023-11-17 22:37:59 +00:00
Spandan Das
9915e03018 Merge "Skip error check if allow missing deps is true" into main 2023-11-17 19:42:10 +00:00
Spandan Das
2daded460c Skip error check if allow missing deps is true
Fixes: 311711411
Test: will use go/abtd
Change-Id: I6df6c679e3f122bbca317d16f89cca2ffc982794
2023-11-17 18:58:48 +00:00
Alyssa Ketpreechasawat
afd6963ab4 Merge "Revert "Revert "Added new framework-pdf jar inside MediaProvider..."" into main 2023-11-17 10:30:16 +00:00
Jihoon Kang
c1b04d6bc1 Revert^2 "Modify conditionals for BuildFromTextStub()"
This change modifies config.BuildFromTextStub() to return false when
deviceConfig.BuildFromSourceStub() is set to true.

This change resubmits https://r.android.com/2832580.

Test: m nothing
Bug: 311203379
Change-Id: I832364c3c42556e2b3aede2316e8927fd7163e91
2023-11-17 01:49:55 +00:00
Colin Cross
8d25afd575 Merge "Split *ModuleContext out of module.go" into main 2023-11-15 22:05:43 +00:00
Colin Cross
69452e14a3 Split *ModuleContext out of module.go
Move EarlyModuleContext, BaseModuleContext and ModuleContext out of
module.go and into early_module_context, base_module_context and
module_context.go respectively.

Test: builds
Change-Id: I52e6eb1589d1478233c1c55d770b395a16eaa1a3
2023-11-15 11:40:49 -08:00
Jihoon Kang
7c1958f0f4 Add environment variable BUILD_FROM_SOURCE_STUB
On top of the soong build flag --build-from-source-stub, the user can
configure build to generate stubs from source Java files by setting the
environment variable BUILD_FROM_SOURCE_STUB=true.

Test: m nothing
Bug: 310279899
Change-Id: I0c5247558455f09b8fc208d988aab3b60bf0ff16
2023-11-15 00:34:43 +00:00
Makoto Onuki
b66bba3a3c Allow Ravenwood to cross variant boundaries
Bug: 310268946
Bug: 292141694
Test: atest RavenwoodMockitoTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:43b648195bcf62f62cae5547f73b247c278e1883)
Merged-In: Ia395d32bad57007ec477a6410dcc4201853c8790
Change-Id: Ia395d32bad57007ec477a6410dcc4201853c8790
2023-11-11 00:13:14 +00:00
Jihoon Kang
8c4387e478 Merge "Revert^2 "Default from-text stub generation in build"" into main 2023-11-10 04:10:24 +00:00
Colin Cross
4ade19fe94 Merge changes I4d0b27ba,Ic48e9cf2 into main
* changes:
  Fix soong_ui file rlimits for go 1.21
  Fix TestReverseSlice for go 1.21
2023-11-09 18:47:40 +00:00
Colin Cross
f2fab8347d Fix TestReverseSlice for go 1.21
Go 1.21 does a better job using the same empty allocation for empty
slices, check for cap > 0 before requiring slices to have different
backing arrays.

Bug: 309895579
Test: TestReverseSlice
Change-Id: Ic48e9cf2c95ea0b810a11cdc4a794a70c02a0a61
2023-11-08 22:11:24 -08:00
Spandan Das
fc12d2f494 Special-case java_sdk_library in source vs prebuilt selection
If a java_sdk_library is listed in `contents`, then restrict the source
vs prebuilt selection superseding to only the internal stub libraries.

Defer the source vs prebuilt selection mechanism of the top-level
library to the existing mechanisms for now. This is necessary because
this top-level library acts as a hook for
- hiddenapi: boot jars are deapxed from the prebuilt apex
- dexpreopt: system server jars are deapexed from the prebuilt apex and
  installed via required

If `next` uses `framework-foo` and `service-foo` as the top-level
library instead of the prebuilt equivalents, then the bootjars installed
in out/soong/dexpreopt_x86_64/apex_bootjars will come from source. And
the *.odex files of the system server jars will come from source.

Bug: 308174768
Test: Added a java_sdk_library unit test to assert that the new
mechanism supersedes the `prefer` flag

Change-Id: Ib43198a3b547c58b54f1f0966e95584215096d32
2023-11-08 18:37:24 +00:00
Spandan Das
1c4d94dccf Use all_apex_contributions for source/prebuilts selection
This flattened singleton module explicitly lists by module name whether source or
prebuilt version of a module should be used. If a module appears in this
metadata module, it supersedes all other source vs prebuilts selection
mechanism

Implementation details
- Update the module dep chain from <source> --> <prebuilt> to <source>
  --> <prebuilt> --> all_apex_contributions
- all_apex_contributions sets a provider which is bubbled up
  to the source module. This requires changing `prebuilt_select` to a
  bottom up mutator
- Update `usePrebuilt` to consult the new provider before falling back
  to existing source vs selection mechanisms. If (foo|prebuilt_foo) is
  listed in the selected `apex_contributions` modules, it
  will be used superseding any other selection mechanisms.
- Update this depTag to IsMetaDepTag so that bootclasspath_fragment's
  validation ignores this new dependency.

Test: Added unit tests to assert that this new mechanism supersedes
`use_source_config_var`

Bug: 308174768
Change-Id: I39a85639642711f3c96b6f18b94d626b55e80c66
2023-11-08 18:37:24 +00:00
Spandan Das
e3fcb41ff7 Create a singleton all_apex_contributions module type
This will be a container for the the apex_contributions
selected using build flags. This module will be used to query the state of
selected apex contributions instead of a global that can be mutated by
anyone.

It will set a provider containing metadata for source vs prebuilts
selection. To reduce the overhead of a new mutator, this will be done in
the existing `prebuilt_select` mutator.

It will validate that there are no dups (`foo` and `prebuilt_foo` cannot
be both selected)

Bug: 308174923

Test: go test ./android

Change-Id: Ie42999a71f35d70e0e977f5ab07ce451608d9f35
2023-11-08 18:37:18 +00:00
Alyssa Ketpreechasawat
9f63436385 Revert "Revert "Added new framework-pdf jar inside MediaProvider..."
Revert submission 2775627-revert-2759049-framework-pdf-UAOVGTHHXO

Reason for revert: submit together with the fix to allow this new jar to coexist w/ mainline prebuilts

Reverted changes: /q/submissionid:2775627-revert-2759049-framework-pdf-UAOVGTHHXO

Change-Id: I877af450918647524d7e24371fb3343a8a2900dc
2023-11-08 16:03:58 +00:00
Jihoon Kang
2a929ad250 Revert^2 "Default from-text stub generation in build"
This change defaults Java stubs to be generated from API text files
during build. Using the `--build-from-source-stubs` flag, users can
toggle between the feature.

This change relands aosp/2617457.

Test: m nothing && verify ninja path exists between android_stubs_current and android_stubs_current.from-text, and does not exist between android_stubs_current.from-source, m nothing --build-from-source-stub && verify the opposite
Bug: 301522358
Change-Id: Ic129dafc3231e71470af982374739930947b69cb
2023-11-08 04:25:52 +00:00
Treehugger Robot
2ab031f467 Merge "Export build flags to soong." into main 2023-11-08 04:15:17 +00:00
Inseob Kim
e4e85d5f9f Export build flags to soong.
This exports a map of build flags used in this release config to Soong.

Bug: 302514918
Test: manual
Change-Id: Id95c03e14cfbb91c0cb9c8c37a065b8387733317
2023-11-08 04:01:38 +00:00