Commit graph

5447 commits

Author SHA1 Message Date
Jihoon Kang
b507831b71 Utilize from text core platform api surface jar in build
Use JavaApiLibraryName function to redirect the usage
of core platform api stubs from .txt files based on config.

Test: m --build-from-text-stub
Change-Id: I926a0a455fed301ba4ff9dfa509d4dbbbd076029
2023-04-06 18:34:32 +00:00
Jihoon Kang
7bfe443875 Merge "Export defaultJavaLibraryName() identifier" 2023-04-06 04:40:16 +00:00
Jihoon Kang
5b065bbd1d Export defaultJavaLibraryName() identifier
Modify the visibility of defaultJavaLibraryName() to export it so that
it can be accessed from another package. This is essential for use case
when identical JavaApiLibraryName() has to be returned regardless of
config.

Test: m
Change-Id: Iefa1b3eb18a0d2717284608c825f488e7ae73df0
2023-04-05 21:15:17 +00:00
Romain Jobredeaux
e7370eabe4 Bp2build converter for java_host_for_device.
Change-Id: I70a345c641bbed3223dc6222062fb6948f7dc6cb
Bug: 276710283
Test: Presubmit
2023-04-04 19:49:17 -04:00
Jingwen Chen
37eec7d019 Merge "Revert "Allowlist more of system/timezone"" 2023-04-04 04:09:26 +00:00
Cole Faust
5bc31c11ba Merge "Keep existing build files in build/make/target/product/security" 2023-04-04 03:58:15 +00:00
Jiyong Park
7a64621169 Merge "Assert that platform_sdk_codename is set" 2023-04-03 23:28:58 +00:00
Jingwen Chen
83a4b68ff4 Revert "Allowlist more of system/timezone"
This reverts commit da03b08062.

Reason for revert: This was previously reverted in aosp/2510617 due to b/275666961, which spawned b/276416537 and b/276416485 that Cole and I are working on now. Given that the root causes are still being actively resolved, I believe this will cause the test (b/275666961) to fail again.

Change-Id: I69e756f823f920610a832a1fc88b415074c0f488
2023-04-03 23:22:54 +00:00
Treehugger Robot
43a2a9a5c6 Merge changes from topic "fdo_profile"
* changes:
  Reimplement afdo support for rust
  Implement fdo_profile module type
2023-04-03 22:35:25 +00:00
Liz Kammer
5342482043 Merge "Allowlist more of system/timezone" 2023-04-03 17:43:17 +00:00
Treehugger Robot
71585a0187 Merge changes Ib9ff4eb5,If27a050c
* changes:
  add *.from-text modules to the java test fixture
  Create a SetBuildFromTextStub method
2023-04-03 16:44:08 +00:00
Alix Espino
2173e6545a Merge "Simplify logic in Soong ApiLevelFromUserWithConfig" 2023-04-03 13:41:02 +00:00
Jiyong Park
3a00e3defb Assert that platform_sdk_codename is set
This is already the case for bazel. Soong should do the same.

Bug: 271277773
Test: m nothing
Change-Id: Ibb680801872bd04eade511e1a174cc629af80722
2023-04-03 20:36:40 +09:00
Cole Faust
10b94de0b6 Keep existing build files in build/make/target/product/security
To add a new filegroup for certificates in that folder.

Bug: 269577299
Test: See other cl
Change-Id: I1c41c809ee3ec6838a427d18f2d21fec9571ccb6
2023-03-31 17:43:06 -07:00
Vinh Tran
44cb78c988 Implement fdo_profile module type
Introducing fdo_profile module type to reimplement the afdo support in cc moduels. This change allows the feature to be compatible with Bazel migration.

How it works:

PreDepsMutators:
  * BeginMutator: If non-static cc modules sets afdo prop, search and add corresponding fdo_profile module as a dep with fdoProfileTag
  * fdoProfileMutator:
    * If in fdo_profile module, set FdoProfileProvider with full path to profile
    * If in cc module, read FdoProfileProvider from dep with fdoProfileTag and set FdoProfileInfo.Path to FdoProfilePath field

PostDepsMutators:
  * afdoDepsMutator: If a module has FdoProfilePath set, walk to its static deps and set itself to the deps' AfdoRdeps
  * afdoMutator: If a static dep has AfdoRDeps set, create afdo variant.

Ignore-AOSP-First: Other CLs in the same topic are internal-only
Test: go test
Bug: b/267229065
Change-Id: I687d798a02d9743c92804fea36fb4ae3a7a0e5e3
Merged-In: I687d798a02d9743c92804fea36fb4ae3a7a0e5e3
2023-03-31 17:52:01 -04:00
Peter Collingbourne
bc03688e7c Merge "cuttlefish: Stop building the CVD host package tarball by default." 2023-03-31 19:09:32 +00:00
Treehugger Robot
840d49a564 Merge "rename aidl/library.bzl to aidl/aidl_library.bzl" 2023-03-31 18:26:33 +00:00
Treehugger Robot
2d704998f4 Merge changes I1ed3ab24,I68678ddf
* changes:
  Use stubs from .txt files for hiddenapi
  Rename JavaLibraryNameFromText function
2023-03-31 14:59:30 +00:00
Alix
fb502512cb Simplify logic in Soong ApiLevelFromUserWithConfig
Currently, ApiLevelFromUser calls ReplaceFinalizedCodename(raw).
This function checks whether raw is in the getFinalCodenamesMap which is
equivalent to ApiLevelsMapReleasedVersion with an additional entry for current.

Since ApiLevelFromUserWithConfig already returned on the raw = "current"
we only care about ApiLevelsMapReleasedVersion and can avoid the unecessary
use of strconv.Atoi(strconv.Itoa(raw)) that calling ReplaceFinalizedCodename
ends up doing.

Also makes the function look more like the Bazel version in
build/bazel/rules/common/api.bzl

Change-Id: I8c03fc159d7f63298273624f030d1956e2307615
Test: m bp2build
2023-03-31 14:55:13 +00:00
Sam Delmerico
e55bf08de2 rename aidl/library.bzl to aidl/aidl_library.bzl
Test: b test --config=android //build/bazel/...
Change-Id: I7e22ee5ffa391ddaf43a3eec17812be78f2d86ab
2023-03-31 09:48:27 -04:00
Peter Collingbourne
ff56c0124f cuttlefish: Stop building the CVD host package tarball by default.
This change causes us to stop building the CVD host package during
the default `m` build, as this is one of the most time consuming steps
of incremental builds, taking around a minute on my machine. Instead,
we build a directory containing the host package contents. A companion
change to acloud teaches it to upload the directory if it exists.

The host package tarball will continue to be built with `m dist` and `m
hosttar`. When building the host package, just create it from the package
contents directory instead of going through a zip file as we were before.

Bug: 273862156
Change-Id: Id7ab47cd5a2e96d073fcc21ed82d3719119df6b9
2023-03-30 16:44:28 -07:00
Sam Delmerico
5121153568 improve error handling for SourceRootDirs
Previously, warnings about missing modules were printed directly to
stderr. Instead we can pass these messages along as errors using the
existing pathways.

Bug: 269457150
Test: m nothing
Test: add -external to PRODUCT_SOURCE_ROOT_DIRS and observe missing
  module errors
Change-Id: I7273c427f38024e3c288f1ecb31175ed04ac44a6
2023-03-30 14:22:38 -04:00
Spandan Das
4deab28fd4 Create a SetBuildFromTextStub method
This will be useful for writing unit tests

Test: go build ./android
Change-Id: If27a050c0cfd0492e0cd3a422ac33f40b7a0a6d5
2023-03-30 17:06:32 +00:00
Liz Kammer
da03b08062 Allowlist more of system/timezone
This helps enable better testing of tzdata apex building.

Test: b build --config=android //system/timezone/...
Change-Id: Iec0d2393366fa612f24c57b6ae2d4f7bfe181668
2023-03-30 11:02:14 -04:00
Treehugger Robot
7c907b84e7 Merge "Add more modules in HugeModulesMap" 2023-03-30 12:00:38 +00:00
Jingwen Chen
29c4561a6b bp2build: denylist some modules to fix CI breakage.
Test: presubmits
Fixes: 276107812
Change-Id: I5e698b26f4d20de6c50008ab12fcfbef8a108ecb
2023-03-30 09:39:40 +00:00
Spandan Das
69f4218c4f Rename JavaLibraryNameFromText function
The "FromText" suffix is an implementation detail. Having this suffix in
the name can be also confusing because in certain settings (e.g. when
not run with --build-stub-from-text) it returns the name of the stub
module generated from source files

Test: go build ./java
Change-Id: I68678ddfaa3d68c8e1a945632e7512b5de33d9af
2023-03-30 00:34:36 +00:00
Treehugger Robot
bc2906efef Merge "Modify Soong to utilize from-text android.jar in build" 2023-03-29 20:31:20 +00:00
Dan Albert
a910e10b76 Merge "Generate api_levels.json from the preview codenames." 2023-03-29 17:57:22 +00:00
Treehugger Robot
998fdd7e37 Merge "support PRODUCT_SOURCE_ROOT_DIRS product variable" 2023-03-29 17:04:37 +00:00
Jingwen Chen
559e3a803f Merge "Revert "Build test1_com.android.tzdata and test3_com.android.tzdata with bazel."" 2023-03-29 16:40:14 +00:00
Jingwen Chen
7a3fed2565 Revert "Build test1_com.android.tzdata and test3_com.android.tzdata with bazel."
This reverts commit d28c426f15.

Reason for revert: breaks timezone_data_e2e_tests b/275666961

Change-Id: Icb2ee7c0db8b9eb82d1eaf191c8bf62afcece22f
2023-03-29 16:21:34 +00:00
Jeongik Cha
2ece11ecd1 Add more modules in HugeModulesMap
Generate list based on build metric.
The next step is generate the list from module characteristics, not from
module name.

Bug: 273282046
Test: m
Change-Id: I0e9caa9987e8fc7f5a378bef940f3646e7bd169c
2023-03-29 23:29:45 +09:00
Jingwen Chen
263d400425 bp2build: fix breakage with more allowlists.
A new dep on //hardware/interfaces/audio/aidl/default was added, breaking mixed droid.

Bug: 275660561
Fixes: 275660561
Test: presubmits
Test: b build --config=android //hardware/interfaces/audio/aidl/... //external/tinyalsa_new/... //system/libvintf/... //system/tools/... //system/media/... //packages/modules/...  //external/tinyalsa/... //external/tinyalsa_new/...
Test: b build //hardware/interfaces/audio/aidl/... //external/tinyalsa_new/... //system/libvintf/... //system/tools/... //system/media/... //packages/modules/...  //external/tinyalsa/... //external/tinyalsa_new/...
Change-Id: Iead2fe6bfcf9cdb2a5b75210d9e84d33dc71691b
2023-03-29 12:17:43 +00:00
Jingwen Chen
3ebe338ec1 Merge "Build test1_com.android.tzdata and test3_com.android.tzdata with bazel." 2023-03-29 03:01:28 +00:00
Jihoon Kang
1bff0349d4 Modify Soong to utilize from-text android.jar in build
Context
- from-text android.jar files are built using Metalava, and these can be
  utilized in `decodeSdkDep` so that any modules that depends on APIs
  can be compiled using from-text android.jars
- This change removes dependency on source java files when compiling
  stub android.jar files

Implementation
- Modify java_api_library module to create system modules using the
  generated android.jar
- Replace modules in decodeSdkDep to link against java_api_library
  modules
- Add --build-from-text-stub flag to hide the feature behind a flag

Test: m --build-from-text-stub
Bug: 271154441
Change-Id: I104df595edc65c0006820d5ae5b15f1fb167e190
2023-03-28 21:53:45 +00:00
Spandan Das
5aade5f52d Merge "Update max_sdk_version from SdkSpec to ApiLevel" 2023-03-28 19:17:48 +00:00
Trevor Radcliffe
6182d31c63 Merge "Supporting changes for CFI toolchain features" 2023-03-28 14:23:55 +00:00
Jingwen Chen
d28c426f15 Build test1_com.android.tzdata and test3_com.android.tzdata with bazel.
..and allowlist //system/timezone/testing/... so that these apexes are mixed builds enabled.

Bug: 273910287
Fixes: 275351675

Test: b build //system/timezone/testing/...
Test: b build //system/timezone/testing/... --config=android
Test: m test1_com.android.tzdata test3_com.android.tzdata
Test: showcommands test1_com.android.tzdata | grep bazel-out
Test: showcommands test3_com.android.tzdata | grep bazel-out
Test: build/bazel/scripts/print_analysis_metrics.py --save-proto-output-file=out/proto-out.txt; rg enabled out/proto.txt
        $ rg enabled out/proto-out.txt
    639:    "mixed_build_enabled_modules": [ "adb_crypto_test", "adb_pairing_auth_test", "adb_pairing_connection_test", "adb_tls_connection_test", "adbd_test", "api_fingerprint", "com.android.adbd", "com.android.tzdata", "libbase", "libc++", "libcrypto", "libcutils", "test1_com.android.tzdata", "test3_com.android.tzdata", "test_com.android.adbd" ],
Change-Id: I2e74426d974d07ca39fccb5003dd4baed9763941
2023-03-28 10:40:37 +00:00
Jeongik Cha
56df091391 Merge changes from topic "b/273282046"
* changes:
  Add HINT_FROM_SOONG option for ninja weight list
  Add EXTERNAL_FILE option for ninja weight list
2023-03-28 03:51:20 +00:00
Dan Albert
8c7a994dfc Generate api_levels.json from the preview codenames.
When the branch is configured as something less than the max codename
(for example, right now AOSP is U but V is also in development), the
active codenames list will not include V.

Bug: None
Test: None
Change-Id: Ia22388a8ba94ff00d053acb33363c3cdce7677d0
2023-03-27 20:34:01 +00:00
Sam Delmerico
98a7329d59 support PRODUCT_SOURCE_ROOT_DIRS product variable
Soong analyzes the entire source tree even though not every lunch target
needs to know about every module. For example, OEM sources can be
ignored for cuttlefish products. This functionality allows blueprint to
ignore a list of undesired directories.

Bug: 269457150
Change-Id: I1eec5d7b6a268cae4c633d8d89ed485598ebca45
2023-03-27 14:42:36 -04:00
Trevor Radcliffe
391a25d7fa Supporting changes for CFI toolchain features
Mostly exporting variables to Bazel, but also allowlisting a BUILD
file.

Bug: 251217226
Test: Unit tests
Change-Id: Id87015a3cd5d970700c4058ec989bb0c14c36bcb
2023-03-27 18:07:40 +00:00
Treehugger Robot
8fdb210be2 Merge "Add apex_available aidl + aidl&lang libraries" 2023-03-25 00:00:32 +00:00
Liz Kammer
2b3f56ed22 Add apex_available aidl + aidl&lang libraries
Test: b build com.android.neuralnetworks com.android.media.swcodec
Change-Id: I008b915b22e4c8c2cf1f0aee6cfdaf17374cb3a9
2023-03-24 15:14:53 -04:00
Yu Liu
e1ab66de2e Change the way that neuralnetworks apex is enabled.
Otherwise the google variant won't build in internal master.

Bug: 274852147
Test: CI
Change-Id: I8ea3a5f5bd44663eedbc8f2af1049e06754c1b44
2023-03-24 10:53:02 -07:00
Yu Liu
1530719278 Merge "Add neuralnetworks to the mixed build staging list." 2023-03-24 17:49:26 +00:00
Yi Kong
a137aa2e6e Merge "Revert^2 "Update clang version to clang-r487747"" 2023-03-24 13:19:52 +00:00
Treehugger Robot
40bfdb181a Merge "Add t.helper() to AssertStringListContainsEquals" 2023-03-24 00:47:29 +00:00
Spandan Das
f5d3906505 Merge "Update target_sdk_version from SdkSpec to ApiLevel" 2023-03-24 00:09:50 +00:00