Commit graph

66546 commits

Author SHA1 Message Date
Spandan Das
5e04d4884a Use Label (string) instead of Label (struct) to dedupe
Using Label struct as the map key causes issues because it contains
OriginalModuleName. The same module will have a different value for this
property when called from inside a soong namespace vs from outside.

If there are dups, we can just choose the first one. OriginalModuleName
is often used with ModuleFromName, and that function panics if there are
modules with the same name in two separate soong namespaces

Test: go test ./bp2build ./bazel

Change-Id: I2ee33efab03016a72f1eea99cb958b6198baeca2
2023-08-16 21:30:02 +00:00
Treehugger Robot
f768e6e27e Merge "Bp2build product variables on non-arch-variant module types" into main 2023-08-15 21:51:31 +00:00
Cole Faust
ed940008ac Bp2build product variables on non-arch-variant module types
Mostly so that genrules can have their command qualified on a product
variable.

Bug: 295910468
Test: m nothing
Change-Id: I28cc18a1b3b00368f4768a1326259a656ce970ec
2023-08-15 11:59:24 -07:00
Treehugger Robot
f5ee8e3ffc Merge "Stop sdk_library generated api_library to depend on full surface api_library" into main 2023-08-15 18:31:21 +00:00
Yu Liu
3625faffc7 Merge "Denylist jemalloc5_stresstests since it is run by a special script." into main 2023-08-15 16:34:26 +00:00
Liz Kammer
d365cc4d86 Merge changes from topic "bazel_module_labels" into main
* changes:
  Set Bazel_module for (un)converted sysprop libs
  Make ShouldConvertWithBp2build avail in loadhooks
2023-08-15 14:11:25 +00:00
Vinh Tran
e6adc83c6c Merge "Remove dylibs prop from rust module types" into main 2023-08-15 13:45:10 +00:00
Yabin Cui
78e4695b3a Merge "Disable Global ThinLTO by default" into main 2023-08-15 03:27:21 +00:00
Wei Li
66ae90d3ce Merge "Add new diffs found in vendor partition in sbom_test." into main 2023-08-14 23:20:47 +00:00
Yabin Cui
9c81c0cfd9 Disable Global ThinLTO by default
Because enabling ThinLTO makes some constructor functions not called
in arm64 executables.

Bug: 295944813
Test: build
Change-Id: Ic0cab5fd80aa86d0d9ca1131564b747a445c6e46
2023-08-14 15:47:36 -07:00
Jihoon Kang
e7ee256746 Stop sdk_library generated api_library to depend on full surface api_library
Since full_api_surface_libs extract class files instead of srcjar file,
full_api_surface_stub can be replace with android_*_stubs_current,
instead of the api_library android_*_stubs_current.from-text.
Functionally, the class files of the two modules are identical (in
from-text stub build), but depending on the from-text java_api_library
leads to missing dependency errors in partial branches (especially ART
branches). To resolve this problem, make sdk_library generated
api_library depend on the missing dependency handled
android_*_stubs_current.

Since android_module_lib_stubs_current.from-text does not have its
from-source equivalent, this can remain as dependency as the module is
moved to build/soong in aosp/2674196

Test: m (default to from-text stub build)
Bug: 274805756
Change-Id: Ic8bbd25252e5f9f1dc7c059ce6b00a951188985d
2023-08-14 21:18:13 +00:00
Cole Faust
9db358d43d Merge "Bp2build genrule commands as configurable properties" into main 2023-08-14 21:01:48 +00:00
Jihoon Kang
9a3cd19bee Merge "Add previous_api property to java_api_library module" into main 2023-08-14 20:50:32 +00:00
Wei Li
9ff64e6aff Add new diffs found in vendor partition in sbom_test.
Bug: 295606843
Test: build/soong/tests/sbom_test.sh
Change-Id: I50af9df5ea91ca113c272139530b0c468d41f5c8
2023-08-14 13:31:44 -07:00
Spandan Das
6a299f7d34 Merge "Fix possible orphaned proto_library targets" into main 2023-08-14 20:24:03 +00:00
Spandan Das
215adb43d3 Fix possible orphaned proto_library targets
This is a fix for aosp/2693190 that handled .proto files that end up in
different bazel packages. It did it by creating proto_library targets in
the correct bazel package.

Changing the granularity causes issues if the the new proto_library in
the subpackage imports a .proto file from a parent package or a
different package. e.g.
```
tmp
├── foo.proto
└── subdir/import_foo.proto # contains an `import "foo.proto"`
└── subdir/Android.bp # package boundary
├── Android.bp # contains a cc_library with foo.proto and
# subdir/import_foo.proto
```

At ToT, the ProtoInfo we provide to CcProtoGen is correct, but the
proto_library in subdir/BUILD will not compile because it does not have
a dep on the proto_library in ./BUILD

This CL creates a workaround by adding `manual` to the proto_library
targets. This CL is based on the assumption that the buildable unit in
bp2build is cc_library_*, and not proto_library necessarily (atleast
till we do a manual/automated cleanup)

Test: Created an integration test in build/bazel
Test: go test ./bp2build
Bug: 292583584
Bug: 246997908
Change-Id: I73120be2411967cb144f37ed4417f76ecf1a6ffa
2023-08-14 19:17:39 +00:00
Cole Faust
f0d4d4f9f2 Bp2build genrule commands as configurable properties
So that users can use soong config variables / product variables
to adjust a genrule's command.

Bug: 295910468
Test: m nothing
Change-Id: I9fedf8d5d52e515c3fdb913411ce1b3fecb7ba81
2023-08-14 11:58:20 -07:00
Vinh Tran
5ce68092d3 Merge "Add unit test to verify default linkage for rust binaries" into main 2023-08-14 18:13:04 +00:00
Vinh Tran
4eeb2a9514 Remove dylibs prop from rust module types
For device build, rust defaults to dylib linkage for rustlibs deps. `dylibs` prop was provided for flexibility.

By removing it, we're enforcing users to either use the default linkage (dylibs for device and rlibs for host) or rlibs prop explicitly. This means no dylibs for host modules. This makes sense because host modules always uses rlib linkage against libstd. The flexibility with dylibs prop opened room for linkage collisions because the dependencies don't link against libstd the same way.

Test: go test
Change-Id: I2fc221daa8a9bb42bdcf6d9823c723a4ddabe7b5
2023-08-14 14:03:28 -04:00
Juan Yescas
83b86cccda Merge "soong: ARM 32-bit targets must be built with 4k elf alignment" into main 2023-08-14 17:56:55 +00:00
Jihoon Kang
862da6f233 Add previous_api property to java_api_library module
`Previous_api` is used to migrate nullness information in metalava (i.e.
convert @Nullable and @NonNull to @RecentlyNullable and @RecentlyNonNull
for some methods). The input is required to generate loosely equivalent
from-text stubs.

Test: m && compare nullness annotations between from-source stubs and from-text stubs
Bug: 293962901
Change-Id: Ic7a0868415fdb2c65d0d472e527fe73280b7651d
2023-08-14 17:18:40 +00:00
Jihoon Kang
0c705a448f Convert additional sdk_library stub libraries to from stub generation
legacy.i18n.module.platform.api, stable.i18n.module.platform.api and
conscrypt.module.platform.api contributes to api surfaces, but the
corresponding stub libraries were being generated from source during
from-text stub build. This discrepancy may lead to hiddenapi failure.
Thus, enable these modules to be built from txt files during from-text
stub build.

Test: m
Bug: 274805756
Change-Id: I940dc8484b210bb8aea57ead1055983be7cdf5ec
2023-08-14 17:17:48 +00:00
Treehugger Robot
95e8fe9e1e Merge "Check in BUILD files in prebuilts/rust and external/bazelbuild-rules_rust" into main 2023-08-14 15:34:06 +00:00
Vinh Tran
05b3410290 Add unit test to verify default linkage for rust binaries
Test: go test
Change-Id: I16eed90dffc8f98a880aa801e96601227dcc37be
2023-08-14 11:26:18 -04:00
Liz Kammer
12dc96ebe1 Set Bazel_module for (un)converted sysprop libs
Set Bazel_module.Label for modules that are migrated and
Bazel_module.Bp2build_available: false for types that are not converted.

Test: CI
Test: m json-module-graph and inspect
Change-Id: I47b82d5055cdfd5ba6b2878e88f39447f1a50223
2023-08-14 11:03:07 -04:00
Liz Kammer
c86e094e13 Make ShouldConvertWithBp2build avail in loadhooks
Test: Soong go tests
Change-Id: I65af040152107ce50b1a97efcee9364f28bad08b
2023-08-14 11:03:05 -04:00
Zhi Dou
1f82aea323 Merge "Support default-permission in aconfig_declarations" into main 2023-08-14 14:12:27 +00:00
Sharjeel Khan
7ce8bf0757 Merge "Removed order file use flags from being passed to cflags" into main 2023-08-14 03:05:35 +00:00
Paul Duffin
64876012de Merge "Pass the current API file to the metalava --use-same-format-as option" into main 2023-08-12 13:27:37 +00:00
Treehugger Robot
69ea5b8267 Merge changes I33846cdb,I1eb1f4bf into main
* changes:
  Move scopeOrderedSourceFileNames as outside var
  Sort api files by api scope in java_api_library
2023-08-12 04:42:48 +00:00
Jihoon Kang
478ca5b79e Move scopeOrderedSourceFileNames as outside var
This change enables scopeOrderedSourceFileNames to be not computed
everytime when the function is called, but instead is computed once.

Test: m
Bug: 295429988
Change-Id: I33846cdb7a750e44e45049dbd342aa6ab8b70c4c
2023-08-11 23:36:11 +00:00
Sharjeel Khan
3c5d4c257d Removed order file use flags from being passed to cflags
The orderfile use flags are unused as cflags causing warnings which becomes errors in some order file builds
In addition, I fixed the test cases so it only looks at ldflags not cflags for orderfile use flags.

Test: mma build/soong
Output: #### build completed successfully (05:14 (mm:ss)) ####

Change-Id: I2a2d846d6688fd5256cf753267c000ff054d56f1
2023-08-11 23:28:46 +00:00
Paul Duffin
10a23c29e2 Pass the current API file to the metalava --use-same-format-as option
That will allow the format of a file to be changed by simply modifying
the signature format in the current API file (e.g. from `2.0` to `3.0`)
and then running `m update-api` and it will just update the current API
file (and the corresponding removed API file).

Bug: 295577788
Test: m checkapi && m update-api
      # Also did as described above and modified the
      # `libcore/api/current.txt` file from `2.0` to `3.0` and ran
      # `m update-api` and checked that only that file and the
      # corresponding `removed.text` file was changed.
Change-Id: I20c9bc151677502cf09b0c06fb442fd385caccdd
2023-08-12 00:06:42 +01:00
Jihoon Kang
84473f55d7 Sort api files by api scope in java_api_library
Recent changes in metalava (aosp/2704325) enforces api files passed as
inputs to generate stubs from txt to be sorted in the order from the
narrower api scope to the wider api scope. In order to comply with this
change, all api files passed as inputs to metalava invocations need to
be sorted in the respective order.

Test: m out/soong/.intermediates/packages/modules/IPsec/tests/cts/CtsIkeTestCases/android_common/e10894d3da5db41239526c9048962355/javac/CtsIkeTestCases.jar --build-from-text-stub --skip-soong-tests (Failing module from incorrect class hierarchy when building from text stub)
Bug: 295429988
Change-Id: I1eb1f4bf8fa34fd7dc8a0e4c04aa056258a975c5
2023-08-11 22:58:54 +00:00
Cody Schuffelen
a405301f03 Merge "Darwin/Mac OS host rust compilation fixes" into main 2023-08-11 20:44:55 +00:00
Chia-Chi Teng
4e0f6451ca Revert "Handle Clang's change of defaults from -fcommon to -fno-common"
This reverts commit a4a4d29509.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_udc-dev-plus-aosp&target=aosp_cheetah-trunk_staging-userdebug&lkgb=10647066&lkbb=10647484&fkbb=10647184, bug 295551355.

Bug: 295551355

Change-Id: I9b68cdac258b26f975e1e575a383b789c87adaa4
2023-08-11 19:59:44 +00:00
Juan Yescas
23cc4aa7aa soong: ARM 32-bit targets must be built with 4k elf alignment
- ARM 32-bit targets will be built with 4096 ELF alignment.
- ARM 32-bit targets will only support 4K Page sizes.
- ARM 32-bit targets won't be page agnostic.

Test: source build/envsetup.sh
      lunch aosp_cf_x86_64_phone
      m
Bug: 295550555
Change-Id: I61cc45fa5f2ea18c494dfc9a0ca44cf9b694dfa3
2023-08-11 12:00:40 -07:00
Vinh Tran
fe1ecfc989 Check in BUILD files in prebuilts/rust and
external/bazelbuild-rules_rust

Test: N/A
Change-Id: I115f77a77e23cbc9181d6f2fe7f8081f7fd89ce3
2023-08-11 14:38:18 -04:00
Wei Li
5428433766 Merge "Remove diffs of symlinks in root directory which are included in product SBOMs now." into main 2023-08-11 18:38:12 +00:00
Zijun Zhao
88df1d3e0b Merge "Handle Clang's change of defaults from -fcommon to -fno-common" into main 2023-08-11 15:29:43 +00:00
Jooyung Han
4ed512b3c7 apex: respect relative_install_path of rust modules
Bug: 295453836
Test: m
Change-Id: I0637d13f6f87fead3cf53a093d9ce84dea681a08
2023-08-11 16:32:58 +09:00
Juan Yescas
83a740e888 Merge "soong: Add product variable DevicePageSizeAgnostic" into main 2023-08-11 05:45:44 +00:00
Wei Li
0634397cd8 Remove diffs of symlinks in root directory which are included in product SBOMs now.
Also explicitely ignore some diffs that were ignored because of "-I /bin".

Bug: 272358980
Test: build/soong/tests/sbom_test.sh
Change-Id: I8a19fdaa89c9f6b4a11c107df98bca647323db26
2023-08-10 18:18:21 -07:00
Zhi Dou
3f65a416b8 Support default-permission in aconfig_declarations
Aconfig provides new argument, default-permission, for create-cache.
When buld aconfig_declarations, aconfig_declarations will read the value
from release configuration to pass this value to aconfig.

Bug: 294417368
Test: presubmit
Change-Id: Id55dab1d757e2366a62449c73e2497cc958c5e78
2023-08-10 21:54:59 +00:00
Treehugger Robot
34a1c57b05 Merge "fix protos in another dir + a module that uses it" into main 2023-08-10 20:53:56 +00:00
Treehugger Robot
1824463396 Merge "Remove pdk product variable" into main 2023-08-10 20:47:50 +00:00
Liz Kammer
7dc6bcbd58 fix protos in another dir + a module that uses it
Protos in another directory were using import prefix, which was
prepending the repository-relative path with the value, instead, we want
to strip the prefix of the directory of the module the protos were used
in such that they can be referenced at the appropriate relative path.

Reference on import_prefix:
https://bazel.build/reference/be/protocol-buffer#proto_library.import_prefix

Test: b build //packages/modules/adb:libfastdeploy_host
Change-Id: If050b0f5fc5103bd9cc5a99703bd604325aa4204
2023-08-10 14:19:39 -04:00
Yu Liu
cb91632951 Denylist jemalloc5_stresstests since it is run by a special script.
Bug: 290909930
Test: CI
Change-Id: Iaae8542186fa843b0ed3c2dc951507b0d13ebb45
2023-08-10 10:58:01 -07:00
Cole Faust
8dc9e917aa Remove pdk product variable
It has no effect.

Test: Presubmits
Change-Id: Ia15cd99ce083294a119203c416046e43d20bf87f
2023-08-10 10:20:03 -07:00
Treehugger Robot
19e00b350a Merge "Replace -bootclasspath and -classpath metalava options with --classpath" into main 2023-08-10 17:12:16 +00:00