Commit graph

5624 commits

Author SHA1 Message Date
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
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
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
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
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
Liz Kammer
f0ab546f38 Allowlist more modules
Test: CI
Test: mixed_droid
Change-Id: I9c2a816f96399401482c93cae2cb9328abbecd16
2023-04-28 13:20:36 -04: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
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
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
Cole Faust
3e0836e865 Merge "Load starlark files from soong" 2023-04-27 17:15:02 +00:00
Mark Dacek
aa2e898e62 Merge "Fix allowlist in order to mixed_build the entire prod allowlist." 2023-04-27 04:47:19 +00:00
Treehugger Robot
3c31266816 Merge "Remove makefile_goal" 2023-04-27 04:29:08 +00:00
Spandan Das
f57a966b66 Ignore test apexes from bp2build generated tags
The core problem I am trying to solve is making sure that stub
libraries in Bazel have a single apex available. In Soong, this will be
enforced using some graph walk which is not easy to port to Bazel.

However, we might need to revisit this when we build the enforcement
mechanism in Bazel. We likely need a `test_for` on the top level
apex_test Bazel rule so that the test apex is _allowed_ to link against impl
of the library it is trying to test.

(This CL retricts this to cc_library, I can expand this to other modules
if this is the right approach.)

Bug: 277651159
Change-Id: Iaeec22c5626df79a33785c766ed29102b1da403e
2023-04-27 01:43:00 +00:00
Cole Faust
c9508aac4c Load starlark files from soong
There are a number of instances where we are exporting information
from soong to bazel via soong_injection. This could be more bazel-centric
if the information was instead held in bzl files, and both bazel and
soong read it from there.

Add a starlark package that will run
//build/bazel/constants_exported_to_soong.bzl at initialization time,
and then results can be retreived with GetStarlarkValue.

Since changes to the starlark files mean that soong has to rerun,
add them as ninja deps.

Unfortunately, the starlark code has to be run at runtime rather than
pregenerating their results, because tests run from intellij wouldn't
go through any pregeneration steps. This means that starlark is run
multiple times during the build, once per test package and once per
primary builder invocation. (currently 3, could be reduced to 2 if we
made the symlink forest generation into its own standalone tool) The
starlark code we have so far in this cl is very fast, roughly half a
millisecond, so it's not a big deal for now, but something to keep an
eye on as we add more starlark constants.

Bug: 279095899
Test: go test
Change-Id: I1e7ca1df1d8d67333cbfc46e8396e229820e4476
2023-04-26 17:18:19 -07:00
MarkDacek
b9e11c5b64 Fix allowlist in order to mixed_build the entire prod allowlist.
Bug: 279808471
Test: m nothing --ensure-allowlist-integrity

Change-Id: Ie7c18e1457d29f300e790ea8a38fbcdc4fdcc50a
2023-04-26 21:56:58 +00:00
Mark Dacek
dc4617aa66 Merge "Refactor MixedBuildsEnabled and add --ensure-allowlist-integrity." 2023-04-26 15:23:11 +00:00
Jooyung Han
a2b57abb4a Remove makefile_goal
This was added to use 'make' target in soong. It was a hacky way and
caused many problems:
- can't track dependency
- doesn't work with sanitizer
- VSDK snapshot doesn't support
- ..

Now references are all gone. Let's remove it.

Bug: n/a
Test: m
Change-Id: I0336a490780f37a4e77d343c61315686e23db643
2023-04-26 16:46:03 +09:00
Treehugger Robot
dfd4c8b8a4 Merge changes Ifd3117a4,Ic4f8b2b1
* changes:
  Revert "apex: skip symbol files when replaced with prebuilt"
  override_apex can be replaced with apex_set
2023-04-26 02:55:35 +00:00
Christopher Parsons
bcbb1728ed Merge "Refactor and cleanup of bazel handler" 2023-04-25 21:27:57 +00:00
MarkDacek
f47e142ffd Refactor MixedBuildsEnabled and add --ensure-allowlist-integrity.
Currently, there is little verification around allowlisted modules
actually being mixed-built. This flag would allow us to verify
that a module allowlisted is mixed-built for at least one variant.

Bug: 278910100
Test: m nothing --bazel-mode-staging --ensure-allowlist-integrity
Test: m nothing --bazel-mode-staging --ensure-allowlist-integrity
--bazel-force-enabled-modules=com.google.android.neuralnetworks (This
fails, as expected)
Test: build/soong/test/mixed_mode_test.sh

Change-Id: Icd5976f4f44f1a8caca1e5247d986642f7995f97
2023-04-25 20:55:07 +00:00
Spandan Das
8a8714c781 Do not modify input in-place
SortedUniqueStrings and FirstUniqueStrings dedupes repeating elements
and returns the deduped list. Currently, it also modifies the input list
in-place, which causes non-determinisitc failures like b/275313114

Operate on a copy of the input so that the input remains untouched.

SortedUniqueStrings is O(NlogN) and FirstUniqueStrings is ~O(N), so
creating a copy (O(N)) should not result in major performance regressions.
Numbers for this single unit test:
```
go test . -run TestStubsForLibraryInMultipleApexes -v -count 1000
Before: 174s
After: 172s
```

Test: go test ./android
Test: go test . -run TestStubsForLibraryInMultipleApexes -v -count 1000
Change-Id: Id859723b2c2ebdc0023876c4b6fabe75d870bad7
2023-04-25 18:37:24 +00:00
Jihoon Kang
b420705230 Merge "Utilize from text core platform api surface jar in build" 2023-04-25 17:48:25 +00:00
Sam Delmerico
cf88420414 Merge "add neuralnetworks to prod allowlist" 2023-04-25 17:43:10 +00:00
Treehugger Robot
d7b50181d9 Merge "Use copy of apex_available in AvailableToSameApexes" 2023-04-25 17:27:00 +00:00
Chris Parsons
c9089dcc7b Refactor and cleanup of bazel handler
- Creation of a bazel command is independent of test/real implementation
- Use a custom struct instead of cmd.Exec
- Move mock bazel runner to the test

Bug: 270989498
Test: m nothing
Test: USE_PERSISTENT_BAZEL=0 m nothing
Test: Treehugger
Change-Id: Ieec35dad5e21aac644d5b8dc79a92397d42db861
2023-04-25 15:53:58 +00:00
Jooyung Han
912c4ab16f override_apex can be replaced with apex_set
Bug: 279247159
Test: m nothing
Change-Id: Ic4f8b2b1ee936afe2bf26de7d6cae19d93ecc831
2023-04-25 15:57:38 +09:00
Spandan Das
4e1bfa06e9 Use copy of apex_available in AvailableToSameApexes
Modifying the list in-place causes some non-determinism.

Test: go test ./cc -run TestStubsForLibraryInMultipleApexes -count 1000
Bug: 275313114
Change-Id: Ia2519e146d97667ad5900cf68ab9935fcbaf08a4
2023-04-24 22:45:14 +00:00
Treehugger Robot
a4c93e3bfc Merge "Add TestApexes to ApexInfo" 2023-04-24 07:03:34 +00:00
Treehugger Robot
e7773041d6 Merge "Remove module with a cc_test_library static dep" 2023-04-24 04:08:52 +00:00
Treehugger Robot
fdef3506c7 Merge "Delete mixedBuildSupportedCcTest." 2023-04-21 15:16:18 +00:00
Spandan Das
0bf4ea53f5 Merge changes I4129c2a9,I9af06f81
* changes:
  Drop the default apex_available value from BUILD files
  Make //apex_available:platform the default.
2023-04-20 15:30:20 +00:00
Jingwen Chen
a485d0935c Delete mixedBuildSupportedCcTest.
We can just rely on the prod/staging allowlists which name the modules directly.

Test: presubmits
Test: m nothing; showcommands adbd_test | grep bazel-out
Fixes: 279004435
Change-Id: I666855d6bbe63c628256c3eebd7ae581c0cbdedb
2023-04-20 14:35:12 +00:00
Hang Lu
a98aab98c4 Enable HWASan for multiple modules in one place(Soong)
Environment variables HWASAN_INCLUDE_PATHS and
PRODUCT_HWASAN_INCLUDE_PATHS can be used to enable HWASan for multiple
modules, by just adding the module directory to the env variable.

Bug: b/271948407
Test: Set specific module directory to above env variable and check the
assembly codes of output elf files after building, finding hwasan
related symbols inside.

Change-Id: Ic49b515830c4469ca5fa94f547b26c0fb602fc54
2023-04-19 22:59:54 +00:00
Sam Delmerico
0ffa1f369d add LLVM_*_VERSION envvars to allowlist
Bug: 273563660
Change-Id: I7c1e6b244e137b27126abcba22684db66fae0327
2023-04-19 14:18:20 -04:00
Zi Wang
a4f7dae7b9 Fix api fingerprinting with apex.
Test: b build adbd and tzdata and verify target sdk version is correct

Bug: 277921995
Change-Id: I05a98fcb628f2a1d83358fe79f19c58010f05430
2023-04-18 21:12:02 +00:00
Usta (Tsering) Shrestha
cf76125627 Merge "Add aidl.deps prop to include aidl implicit deps explicitly in Android.bp" 2023-04-18 14:18:51 +00:00
Spandan Das
e8173a83cb Add TestApexes to ApexInfo
If any of apexes in apex_available is an apex_test, then that name will
be propagated down from that apex to each apex variant. This metadata
will be used to enforce that stub libraries cannot have more than one
apex_available.

This logic is necessary so that bp2build can select the correct
stub/impl.

(To avoid replicating this complexity in Bazel, we should consider
dropping the test apexes in Bazel BUILD files, next CL)

Bug: 277651159
Test: go build ./apex
Change-Id: I63617c1dc2a2d5c9cd7758c416fec7b4db1f10a7
2023-04-17 19:26:07 +00:00
Spandan Das
2dc6dfcb16 Drop the default apex_available value from BUILD files
If apex_available is missing from Android.bp files, ApexAvailable
returns [//apex_available:platform], which is the default. To avoid
BUILD file verbosity, remove the build system default value from the
generated BUILD files.

Bug: 277651159
Test: go test ./bp2build

Change-Id: I4129c2a93ac28578f46ebeed49baa23ce727aa1f
2023-04-17 19:26:03 +00:00
Spandan Das
8e6386e0aa Make //apex_available:platform the default.
go/Android.bp mentions that ["//apex_available:platform"] is the
default, but currently it was []. This change does not create any
additional module variants.

(Noticed this for libz, I was expecting its apex_available to be
platform and not an empty list)

Test: TH
Change-Id: I9af06f813b1a1d7b716939874f469bd2e1ce4d14
2023-04-17 17:28:06 +00:00
Romain Jobredeaux
aa6e25df46 Allowlist CaptivePortalLogin and required dependencies.
Change-Id: I5ed5bfa70d5a7d179e8721df0e833315a2ada05a
Bug: 215230089
2023-04-17 09:50:04 -04:00
Vinh Tran
2562585878 Add aidl.deps prop to include aidl implicit deps explicitly in Android.bp
In a follow-up CL, we should eventually disallow aidl.include_dirs in cc rules so that the deps are always explicit and compatible with Bazel migration.

Test: go test
Bug: 278059962
Change-Id: Ia786cc8634d03589dc008f10b01e6bb2b9f2c7f0
2023-04-14 19:28:44 -04:00
Cole Faust
ae31382119 Merge "bp2build support for python_test(_host)" 2023-04-14 20:49:01 +00:00
Sam Delmerico
3eda019e04 Revert "Respect Clang version override env vars."
Revert submission 2478283-master-I3cf18e7814ff52d526017e4fe34b17ab3d8f1080

Reason for revert: implementing a different way

Reverted changes: /q/submissionid:2478283-master-I3cf18e7814ff52d526017e4fe34b17ab3d8f1080

Change-Id: I1d690b6d322adc664e4c02d958f0183bbb78e669
2023-04-14 18:07:25 +00:00
Jeongik Cha
b745e2e205 Use module type, size of srcs or deps to prioritize module
Instead of listing up module names, use another information from soong
such as module type, or size of inputs.

I focused on recall, not precision or accuracy, because false negative
module can slow down whole build

Bug: 273282046
Test: m --ninja_weight_source=ninja_log
Change-Id: I8fcc26f1312fda36197c787d240bc3d7b5346481
2023-04-15 00:58:15 +09:00
MarkDacek
9c094ca153 Fix issue where bazel-force-enabled-modules aren't actually analyzed.
Bug: 273910287
Test: run mixed_mode_test.sh

Change-Id: I309c423b6e7f505ad1db0d9327e7de6b8298dfe9
2023-04-14 02:17:54 +00:00
Cole Faust
d82f036b89 bp2build support for python_test(_host)
There was a request for using b with python tests. bp2build python
tests exactly the same way as python binaries so that they can be
used with `b`.

Bug: None
Test: go test
Change-Id: Id68a6a73572745a4885b3e5bb1b8452e36baa982
2023-04-13 16:10:59 -07:00
Treehugger Robot
01add2893c Merge "Add external_updater to bazel allowlist." 2023-04-13 21:13:05 +00:00
Romain Jobredeaux
a3c029e7d5 Merge "Bp2build support for sdk_version and java_version." 2023-04-13 20:53:07 +00:00
Dan Albert
f1235a8787 Add external_updater to bazel allowlist.
Bug: None
Test: treehugger
Change-Id: I2b8a357198dbe0b2be4850ba7de4a749910c1be1
2023-04-13 16:39:28 +00:00
Treehugger Robot
5a15e9522c Merge "Fix crash when missing platform sdk version" 2023-04-12 21:35:31 +00:00
Treehugger Robot
7a9626c655 Merge "Make buildroot.cquery determinisitc" 2023-04-12 21:04:52 +00:00
Cole Faust
37d27c4884 Fix crash when missing platform sdk version
Fixes: 277890306
Test: Presubmits
Change-Id: I26658a90856cb057c631bb71ca0cd094ed648cf5
2023-04-12 10:32:18 -07:00
Treehugger Robot
ebf93ff2d8 Merge "add libneuralnetworks[_static] to staging allowlist" 2023-04-12 17:08:01 +00:00
Jingwen Chen
aea34a38ca Merge "Revert^2 "Re-land test tzdata apex with bazel builds."" 2023-04-12 06:50:26 +00:00
Cole Faust
12f9cef5fe Merge "Break constant information out of product vars" 2023-04-12 04:08:45 +00:00
Romain Jobredeaux
2eef2e13e9 Bp2build support for sdk_version and java_version.
This CL adds java_version and sdk_version support to bp2build
converters for
   - java library
   - java binary
   - android library
   - android binary
   - android library import

Although java import doesn't support java_version and sdk_version, the
neverlink java_library wrapper around a java_import must specify a
sdk_version when targetting a device. "none" is used by convention.

Change-Id: I22a69dea2e351858368df69ed6a703b568d613ea
Bug: 215230098
Test: Presubmits
2023-04-11 21:05:48 -04:00
Cole Faust
eb644cfb34 Break constant information out of product vars
We don't want rules to load the product variables directly, because
then they won't be able to transition on them.

Break constant information that is safe to load outside of the
product vars file, so that we can make the product vars file have
more restricted visibility later.

Bug: 269577299
Test: m nothing
Change-Id: I848bff33e4f5798f51296ea3a2600615cab36985
2023-04-11 15:38:43 -07:00
Steven Moreland
a80b113f55 Merge "Add name hint to Soong." 2023-04-11 20:26:04 +00:00
Jihoon Kang
bbd707fadf Merge "Remove completed TODO in android/visibility.go" 2023-04-11 19:23:31 +00:00
Liz Kammer
f6275096ea Remove module with a cc_test_library static dep
Currently we treat cc_test_library as a shared library but it really can
be both a static and a shared library. This causes issues when trying to
statically link a shared library.

Test: bp2build.sh
Change-Id: Ie3a4c0ffa607e1c9fcffe015d216be7a9bccfb4d
2023-04-11 11:06:07 -04:00
Jingwen Chen
6134211c2d Revert^2 "Re-land test tzdata apex with bazel builds."
fb8b1a69e9

Change-Id: Id5c0edd1cd4aacbb75a8019e0a5ada4e608fbf09
2023-04-11 14:55:27 +00:00
Jingwen Chen
ed35066ec7 Merge "Revert "Re-land test tzdata apex with bazel builds."" 2023-04-11 07:23:31 +00:00
Junho Yoon
fb8b1a69e9 Revert "Re-land test tzdata apex with bazel builds."
Revert submission 2522075-tzdata-test-apex-bazel

Reason for revert: DroidMonitor: Potential culprit for Bug X - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted

Reverted changes: /q/submissionid:2522075-tzdata-test-apex-bazel

Change-Id: I08bfddf05a3461328c0b77dfe6c532a7f20a3df9
2023-04-11 07:15:14 +00:00
Treehugger Robot
1000493802 Merge "Re-land test tzdata apex with bazel builds." 2023-04-11 02:42:06 +00:00
Steven Moreland
671dc2319b Add name hint to Soong.
Bug: N/A
Test: updated, also manual:

error: system/tools/aidl/Android.bp:431:1: "aidl_test_client_ndk" depends on undefined module "aidl-test-versioned-interface-ndk". Did you m
ean ["aidl-test-versioned-interface-V1-ndk" "aidl-test-versioned-interface-V2-ndk" "aidl-test-versioned-interface-V3-ndk" "aidl-test-version
ed-interface-api"]?

Change-Id: I62f679d1f2152b42cdc336b6e3e7814cd2594c92
2023-04-10 20:20:41 +00:00
Jihoon Kang
f25bdf4643 Remove completed TODO in android/visibility.go
Remove fixed TODO(b/130796911) as it is marked fixed.
Defaults_visibility prop works as intended.

Test: none
Change-Id: I4277e9b8886f9196f6265aa63ec29dca68f5aca7
2023-04-07 22:18:19 +00:00
Sam Delmerico
96e5370a36 add neuralnetworks to prod allowlist
Bug: 275722093
Change-Id: Ib086bdbbdd433c600efc1be4922226776983915d
2023-04-07 15:09:37 -04:00
Sam Delmerico
646dcfa502 add libneuralnetworks[_static] to staging allowlist
Bug: 266568703
Change-Id: I15a993fdbd7adcc5ce5f05cc754fcf6721d19831
2023-04-07 14:38:32 -04:00
Justin Yun
1871f90026 Include license texts and kinds for VNDK snapshot
VNDK snapshot must include the information of the license texts and
kinds. Include them when packaging the snapshot prebuilt files.
This will be used to generate the VNDK snapshot files.

Bug: 270625053
Bug: 277317599
Test: development/vndk/snapshot/build.sh --build-artifacts
Change-Id: I0a39ff598efbb80faaf63807cdf5ce685fa074cc
2023-04-07 20:13:19 +09:00
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
8bbf44f3f2 Re-land test tzdata apex with bazel builds.
Test: atest
Test: presubmits
Fixes: 275351675
Change-Id: I12a151ef2c6fea1b8313c51f408d806ee7b13e60
2023-04-04 13:54:56 +00: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
Colin Cross
01f1615abe Merge "Add sanitizer tests for musl" 2023-03-23 23:07:37 +00:00
Spandan Das
ad3555ea33 Merge "Export the name of stub java Soong modules" 2023-03-23 21:32:03 +00:00
Spandan Das
a26eda7f2c Update max_sdk_version from SdkSpec to ApiLevel
max_sdk_version signifies device version and does not need an sdkKind to
describe it fully. Update the type and cleanup existing usages. As a
side benefit, we also get better error handling since users can no
longer enter something like `public_30` as a valid max_sdk_version in bp
files

Bug: 208456999
Test: no change in ninja file (this should be a no-op)
Test: TH
Change-Id: I304b5ad802bde200137d8e225182828dfd6f7227
2023-03-23 19:38:56 +00:00
Spandan Das
ca70fc40bd Update target_sdk_version from SdkSpec to ApiLevel
target_sdk_version signifies device version and does not need an sdkKind to
describe it fully. Update the type and cleanup existing usages. As a
side benefit, we also get better error handling since users can no
longer enter something like `public_30` as a valid target_sdk_version in bp
files

Test: m nothing
Test: no change in ninja files (this should be a no-op)
Bug: 208456999

Change-Id: I3c19245e29184bd9e5660ad8981966f64dfa9424
2023-03-23 19:31:17 +00:00
Spandan Das
ddfab60014 Merge "Update min_sdk_version from SdkSpec to ApiLevel" 2023-03-23 16:33:36 +00:00
Yi Kong
fd07ed2c14 Revert^2 "Update clang version to clang-r487747"
9ede280375

Bug: 264965700
Change-Id: I4154c70c050a825525d5b591fa757104eb78c158
2023-03-23 14:14:31 +00:00
Treehugger Robot
62d3353434 Merge "Disable musl in mixed Bazel builds" 2023-03-23 06:35:30 +00:00
Jooyung Han
4973d45d06 Add t.helper() to AssertStringListContainsEquals
Bug: n/a
Test: m nothing
Change-Id: I49d87ac75edbc4856eb5a178c9085134a4185487
2023-03-23 14:22:46 +09:00
Spandan Das
8c9ae7ed67 Update min_sdk_version from SdkSpec to ApiLevel
This relands aosp/2457063. The original change broke T and U since those
branches still contain soong modules of type (kind+level). Those soong
modules have been cleaned up now

Test: Used go/abtd to test T and U branches with this change

Bug: 208456999
Change-Id: I0ef7933c055f88cb512a02108f1173e51156ef1c
2023-03-22 20:15:45 +00:00
Colin Cross
5dc62c9456 Add sanitizer tests for musl
Add tests that verify sanitizer behaviors for musl.

Test: sanitize_test.go
Change-Id: I1f0a51cc103ac14d1738cb223e216ee0e32d8550
2023-03-22 12:58:38 -07:00
Colin Cross
9e87f0a6ea Disable musl in mixed Bazel builds
Test: builds
Bug: 259266326
Change-Id: I4492f6b585d35fe848d5dc255043960c69742dcb
2023-03-22 12:58:37 -07:00
Spandan Das
7947b31a55 Merge changes I10e8bea5,I8e013ec1
* changes:
  Create EffectiveVersion* functions for ApiLevel
  Create two sentinel api levels
2023-03-22 19:57:52 +00:00
Yu Liu
7977650c49 Add neuralnetworks to the mixed build staging list.
Related tests modules will be added later.

Bug: None
Test: CI
Change-Id: I1ff66cdf327ae2bf214f87522a302a1957fed3c6
2023-03-22 17:03:36 +00:00
Jeongik Cha
e114e60615 Add HINT_FROM_SOONG option for ninja weight list
If this option is set, Soong generates ninja weight list including
modules in HugeModulesList in allowlists.go

Test: m --ninja_weight_source=soong
Bug: 273282046
Change-Id: Id92b7f9f9e8152c1c46ae071c5821a479cf47bce
2023-03-23 01:45:27 +09:00
Liz Kammer
f235505c9f Disable modules in mixed builds.
Test: m --bazel-mode-dev hwuimicro
Change-Id: If55763b35c931571e317993bd707de027d647e59
2023-03-22 11:14:57 -04:00
Liz Kammer
448bbfb083 Merge "Add missing deps for neuralnetworks/swcodec" 2023-03-22 14:45:27 +00:00
Liz Kammer
d42d738fda Merge "add parent static deps to cc_aidl_library targets" 2023-03-22 14:43:57 +00:00
Liz Kammer
9d8e0158de Merge "Disable riscv in all Bazel mixed builds" 2023-03-22 12:19:26 +00:00
Liz Kammer
e76510ba32 Add missing deps for neuralnetworks/swcodec
Test: b build --config=android //hardware/interfaces/...
Change-Id: I458684d511af0e4858956bbb00b42be7d79538e0
2023-03-21 16:49:13 -04:00
Sam Delmerico
512437b0b4 add parent static deps to cc_aidl_library targets
The static deps of the parent library can be necessary to build a
bp2build-generated cc_aidl_library target. We should add these deps as
implementation_deps so that they are accessible.

Bug: 250876486
Test: b build //frameworks/native/libs/gui/...
Change-Id: Ibe7c3598a684907473e2a4e040fb3976455a59e9
2023-03-21 16:49:06 -04:00
Spandan Das
dd7057c715 Create EffectiveVersion* functions for ApiLevel
This relands aosp/2457062. The original CL was submitted as part of a
stack that broke tm and udc. Those branches still contain soong modules
with min_sdk_version of type (kind+level).

Bug: 208456999
Test: m nothing on tm and udc (via go/abtd)
Change-Id: I10e8bea59cd5914d36b2c9539ee1556e55b82e53
2023-03-21 17:37:57 +00:00
Spandan Das
15da5887fe Create two sentinel api levels
This relands aosp/2470068. The original CL was submitted as part of a
stack that broke tm and udc. Those branches still contain soong modules
with min_sdk_version of type (kind+level).

Test: m nothing on tm and udc (via go/abtd)
Bug: 208456999

Change-Id: I8e013ec10530372f70f0ab0505b7eebeee2b360b
2023-03-21 17:37:49 +00:00
Spandan Das
ef5b7e4e36 Merge "Cleanup hardcoded references to android_*stubs_current" 2023-03-21 17:22:42 +00:00
Treehugger Robot
c164b460d0 Merge "Replace json_encode with json.encode" 2023-03-21 17:21:18 +00:00