Commit graph

58544 commits

Author SHA1 Message Date
Yu Liu
bf7c03ef66 Allowlist libcode2_hidl@1.0/1.1/1.2
Bug: 232544295
Test: Manual
Change-Id: Iaeae1d348a0756e63e0c16ebd0759528543c057f
2022-09-22 12:12:26 -07:00
Vinh Tran
2c27b17f8e Merge "Add shared libs from upstream cc modules to cc_aidl_library targets" 2022-09-22 18:21:41 +00:00
Sam Delmerico
3ff81e784d run bp2build in mixed_mode_test.sh
Now that cc_toolchains that are registered in the WORKSPACE file depend
on soong_injection, we need to run bp2build before running bazel.

Change-Id: If32dbdab5700b9dd142aa6f38250b3b3f0e7530b
2022-09-22 13:46:43 -04:00
Sam Delmerico
0d08b9ba35 document workaround test_bp2build_generates_all_buildfiles
test_bp2build_generates_all_buildfiles uses the same directory for
--output_base and --sandbox_tmpfs_path. This is required on the build
servers, but causes issues locally. This commit adds a more helpful
error message when this test fails.

Test: build/soong/tests/bp2build_bazel_test.sh
Change-Id: Ib29a7edf456f8ae39bd429ebb367c8115e02c284
2022-09-22 11:43:21 -04:00
Vinh Tran
fd446d6dba Allowlist com.android.neuralnetworks
Bug: 246958825
Bug: 232486397
Test: b build //packages/modules/NeuralNetworks/apex:com.android.neuralnetworks
Change-Id: I0f818911cc99505e95239e0aa782e3ed3b5b1da7
2022-09-22 14:45:42 +00:00
Vinh Tran
f19b658803 bp2build to convert $(genDir) to $(RULEDIR) in genrule's cmd
`statslog.cpp` with cmd `"$(location stats-log-api-gen) --cpp $(genDir)/statslog.cpp"` produces `out/.intermediates/frameworks/proto_logging/stats/stats_log_api_gen/statslog.cpp/gen/statslog.cpp`. Hence, $(genDir) is equivalent to `<package-dir>/<module-name>/gen`.

Currently, bp2buld converts `$(genDir)` to `$(GENDIR)`. In Bazel, `$(GENDIR)` is only the base of the generated code (e.g. `bazel-bin`).

```
genrule(
    name = "statslog.cpp",
    cmd = "$(location :stats-log-api-gen) --cpp $(GENDIR)/statslog.cpp",
    outs = ["statslog.cpp"],
    tools = [":stats-log-api-gen"],
)
```
produces `bazel-bin/statslog.cpp` but expects to have `bazel-bin/frameworks/proto_logging/stats/stats_log_api_gen/statslog.cpp`.

By converting to `$(RULEDIR)` which is `bazel-bin/frameworks/proto_logging/stats/stats_log_api_gen`.

There had not been any genrule module allowlisted with genDir
yet. So this should not cause any issue with modules converted before
this CL.

Bug: 247536535
Test: go tests
Test: presubmit builds and tests
Change-Id: I65c6aafadab6b180b7ef700427e041547ae7e98a
2022-09-22 08:57:14 -04:00
Vinh Tran
395a1e9508 Add shared libs from upstream cc modules to cc_aidl_library targets
In Soong, aidl cc binding code is built with all the libs defined in the cc modules. In Bazel, because cc_aidl_library creates a cc_library_static target with the generated .h and .cpp files, it needs to depend on the libs from the parent cc modules in order to build successfully.

We can also consider including static libs but that requires a larger change to cc_aidl_library macro (e.g. renaming deps to aidl_libraries and preserving deps for static libs to be consistent with cc lirary macros).

This CL only adds shared libs (e.g. (implementation_)dynamic_deps) and ignore static libs for now since they're not needed for the modules currently  allowlisted.

This fix is similar to https://android-review.googlesource.com/c/platform/build/soong/+/2219103/4/android/proto.go#207 for proto.

We can follow-up with adding static libs to cc_aidl_library later if needed.

Bug: 247151591
Test: presubmit is able to build allowlisted modules successfully
Change-Id: I40f14297f8c8f4c2a36b1e972d009824398b59cd
2022-09-21 18:14:31 -04:00
Jason Wu
94a0373f1e Merge "Rollforward w/fix of "Use json encoding for cquery ParseResult" Previous commit: commit fcc53f992b40786b216d38844ab61945fe5c9071." 2022-09-21 21:49:26 +00:00
Spandan Das
3a8255cba2 Merge "Create api_domain module type and its bp2build converter" 2022-09-21 21:44:17 +00:00
Treehugger Robot
37ec64f783 Merge "Provide platform build flag to R8/D8" 2022-09-21 21:35:38 +00:00
Trevor Radcliffe
4c196e26e4 Merge "Only generate stubs for shared libraries" 2022-09-21 21:04:25 +00:00
Spandan Das
d58630f5fc Allowlist conversion of api providing module types
The allowlisted modules will be used to gather the contributions to the
publicapi surfce

Test: TH
Change-Id: I49df3a734c7ab21f21020a8cf8ddfaf7b6fa9717
2022-09-21 19:58:18 +00:00
Spandan Das
81593891ee Create api_domain module type and its bp2build converter
This module does not have any build actions in Soong yet. It will be
converted to a Bazel target using bp2build, and API export will be run
on the generated Bazel target

Test: go test ./bp2build
Test: TH
Change-Id: I76df32bd9f23b60e746b2700af07668a2ed74844
2022-09-21 19:49:46 +00:00
Spandan Das
1278c2cb24 Multi-tree API bp2build converter for ndk_library
This is a partial bp2build conversion that only emits the
cc_api_contribution target of ndk_library. We also need to convert this
to cc_stub_suite eventually to enable building vendor/product API
domains with Bazel

Also create an enum for the three known Multi-tree API surfaces (will
likely be expanded in the future)

Test: go test ./bp2build
Test: b cquery //bionic/libc:libc.ndk.contribution --output=starlark
--starlark:expr="providers(target)"

Change-Id: Idb24871ba20aae132b61eb31ef35c917cacae9e1
2022-09-21 19:49:46 +00:00
Alix Espino
62b75f4e4a Merge "Revert^2 "deletion of clang_cflags & clang_asflags from Soong"" 2022-09-21 19:28:11 +00:00
Harshit Mahajan
5b8b730cdd Enforce mainline modules to have latest target sdk version by default.
Due to GMS target SDK requirements (https://docs.partner.android.com/gms/policies/preview/mba#min-target-sdk)
we need to ensure all the  mainline packages to target latest API
level. Currently, the team chases each module to bump their target
API level.

Updating the build code to make sure that mainline modules
(i.e updatable modules) target the latest sdk version by default.
It would be by default set to 10000 before SDK finalization and updated to the new API level after finalization.

Effectively it would mean:
1. '10000' in aosp and internal master
2. Finalized number in development branches like "33" in "tm-dev"
3. As sdk hasn't been finalised in "udc-dev", it would be "10000"
which would be automatically updated to finalized version after sdk finalization.

For local development if the target sdk version is required to be set,
users would need to set Updatable flag to false.
Enforce_default_target_sdk_version flag needs to be used in bp file,
if this feature needs to be tested locally when updatable: false.

Bug: b/227460469
Test: m nothing
Change-Id: I05e0ae74ae44fd73df75e91b926bcc924446253f
2022-09-21 19:09:38 +00:00
Jason Wu
07bb005b99 Rollforward w/fix of "Use json encoding for cquery ParseResult"
Previous commit: commit fcc53f992b.

Test: 1. use `TARGET_BUILD_VARIANT=userdebug TARGET_PRODUCT=aosp_arm64 build/bazel/ci/mixed_droid.sh` to verify no error occurred.
2. revise the test cases under request_type_test. 3. pass the test cases

Bug: 242587802
Change-Id: I7f70e62f7b6f42fa5f211772888040a0d07a710b
2022-09-21 18:54:14 +00:00
Treehugger Robot
f5410382ab Merge "Remove obsolete script for building unbundled Mainline targets." 2022-09-21 18:11:20 +00:00
Jared Duke
40d731a4c3 Provide platform build flag to R8/D8
Provide the `--android-platform-build` flag to R8/D8 for targets that do
not specify a stable min SDK. This includes all targets that do not
specificy an SDK version (e.g., services.jar, SystemUI.apk) and all
targets that specify core_platform (e.g., framework.jar).

Follow-up work will expand the set of cases that qualify for this flag,
but for now this captures some of the highest priority targets.

Bug: 232073181
Test: m + presubmit + validate verbose.log
Change-Id: Idad32c80490a101c049b7f937807a615564ca8ef
2022-09-21 11:01:32 -07:00
Trevor Radcliffe
1eb582e0c9 Merge "Enable bp2build for cc modules relying on sysprop" 2022-09-21 17:10:41 +00:00
Cole Faust
9d75168276 Merge "Make protobufs respect pkg_path properly" 2022-09-21 16:33:52 +00:00
Treehugger Robot
4669ea4d19 Merge "Allowlist deps of minadbd." 2022-09-21 15:28:38 +00:00
Vinh Tran
70e079c6ad Merge "Reallowlist libneuralnetwork's deps in bp2build" 2022-09-21 15:24:14 +00:00
Jingwen Chen
adc07fa995 Allowlist deps of minadbd.
Remaining blockers are:

* android.hardware.health@1.0_interface: blocking 15 modules
* android.hardware.health@2.0_interface: blocking 12 modules
* android.hardware.health_interface: blocking 8 modules
* android.hardware.health@2.1_interface: blocking 8 modules
* android.hardware.health@1.0: blocking 8 modules
* android.hardware.health@2.0: blocking 7 modules
* android.hardware.health@2.1: blocking 5 modules
* android.hardware.health-translate-ndk: blocking 4 modules
* libhealthshim: blocking 3 modules
* libhealthhalutils: blocking 3 modules
* librecovery_utils: blocking 2 modules
* libminadbd_services: blocking 1 modules

Test: bp2build.sh
Bug: 243025934
Change-Id: Ic39666ee2d9f573726d6ed7ef9c45ac4975baa3a
2022-09-21 13:13:48 +00:00
Paul Duffin
4930389405 Merge "Exclude unsupported libraries from sdk snapshot" 2022-09-21 12:43:47 +00:00
Paul Duffin
4f1128bee4 Merge "Separate hidden API flag info for sdk from platform_bootclasspath" 2022-09-21 12:10:37 +00:00
Paul Duffin
1fdd934df0 Merge "Separate hidden API flag generation from encoding" 2022-09-21 12:10:29 +00:00
Anton Hansson
7212dbef03 Tweak logic for when extension txt is latest
Always use the latest extension as the latest API, regardless of
the current base extension version. This makes it so that we can
bump the base in master without changing which txt is considered
latest.

Also extend the error check to apply more widely (which caught an
error in the extension 3 finalization).

Bug: 228017107
Test: m checkapi (with api break & bumped base)
Test: prebuilt_apis_test.go
Change-Id: Ia10eb41ff500c566736f0d29a29984a99386bb6f
2022-09-21 11:51:21 +00:00
Martin Stjernholm
4fc6f4ee62 Remove obsolete script for building unbundled Mainline targets.
The supported scripts for doing that now live in
packages/modules/common/build.

Test: Check in CodeSearch that the script isn't actively used nor
  mentioned in docs.
Bug: 180394948
Change-Id: I787cbe469bec2121f89de7b74695484310b00b5e
2022-09-21 11:50:08 +01:00
Jooyung Han
7113b19be8 Add a host tool to create an APEX bundle
Even though the soong build system generates a bundle module for an
apex, the bundle module itself should be further processed to be an
AppBundle (.aab) file which can be uploaded to Play.

This script fills the gap by invoking bundletool to create an
AppBundle (.aab) file out of soong-built bundle module for an apex.
(Note: uploading APEX bundle (.aab) to Play is not supported yet.)

You can create an .aab file by:
- TARGET_BUILD_APPS={apex name} m dist
- m build-apex-bundle
- build-apex-bundle --output out.aab out/dist/{apex name}-base.zip

For now it creates a single-ABI APEX bundle. In the future it can be
extended to support multiple-ABI APEX bundles.

Bug: 236673372
Test: m build-apex-bundle
Test: TARGET_BUILD_APPS=com.google.cf.bt m dist
Test: build-apex-bundle --output bt.aab out/dist/com.google.cf.bt-base.zip
Change-Id: Id321efcd42c0fe60294a8348047c9ebbf7acf391
2022-09-21 13:27:49 +09:00
Trevor Radcliffe
f19d8a7f0a Only generate stubs for shared libraries
Bug: 246958825
Test: Unit tests
Test: m nothing
Change-Id: If976027314b079525397fa8f5d6dc3de9f1221c8
2022-09-20 23:04:39 +00:00
Cole Faust
43ac21f53d Make protobufs respect pkg_path properly
Currently, python protobuf sources are generated as if
pkg_path didn't exist, but then are moved into the pkg_path
directory after being generated. This means they're generated
with import statements in them that don't include the pkg_path.
These import statements won't work at all when pkg_path is at
least 2 levels deep, but currently erroneously work with a 1
level deep pkg_path because we mistakenly add the top-level
modules in a soong-built python zip to the PYTHONPATH. We want
to remove those modules from the PYTHONPATH, so the generated
protobuf source files have to use the correct imports.

Since there are existing cases of code that needs to be updated,
guard this new behavior behind a flag, protos_respect_pkg_path.
We will set this to true on modules individually as we update
them, and then eventually change the default to true and remove
this flag.

Bug: 247578564
Test: m py_proto_pkg_path_test && out/host/linux-x86/nativetest64/py_proto_pkg_path_test/py_proto_pkg_path_test
Change-Id: I3695cf5521837da087592f2ad5350201035b7b0e
2022-09-20 16:00:51 -07:00
Christopher Parsons
b2dce1ae5e Merge "Revert "Use json encoding for cquery ParseResult"" 2022-09-20 22:18:32 +00:00
Treehugger Robot
0c01f91174 Merge "Reclassify GPL+CE as permissive." 2022-09-20 22:16:58 +00:00
Christopher Parsons
3e1833f9e5 Revert "Use json encoding for cquery ParseResult"
This reverts commit fcc53f992b.

Reason for revert: Broke mixed_droid

Change-Id: I0f7b864a93624a6be94f8faf55cd9e5175de7f14
2022-09-20 21:59:29 +00:00
Vinh Tran
583a07d159 Reallowlist libneuralnetwork's deps in bp2build
Reverting a revert aosp/2221842 and disabling converted filegroups that are srcs of unconverted gensrcs because of b/247782695.

Bug: 232486397
Test: CI
Change-Id: Ifc5ee7ed6f96ef8081a779e374ad7ac5ecbb947a
2022-09-20 21:31:49 +00:00
Colin Cross
9f6e6238ef Merge "Move AllowMissingDependencies handling into processMainCert" 2022-09-20 20:15:43 +00:00
Bob Badour
4ea386ad4e Reclassify GPL+CE as permissive.
Bug: 210546823

Test: m cts dist
Change-Id: I5197cd1dc0d4a7f68d3fc6d9988976bc41ca4a28
2022-09-20 12:21:19 -07:00
Trevor Radcliffe
6cbb330437 Merge "Create Stub targets for cc_library_(static|shared)" 2022-09-20 17:34:23 +00:00
Jason Wu
2901c3b390 Merge "Use json encoding for cquery ParseResult also using a generic json_encode as an approximation for json.encode" 2022-09-20 14:50:35 +00:00
Pedro Loureiro
62b471ae71 Merge "Remove special case for test-only module" 2022-09-20 08:57:12 +00:00
Kevin Dagostino
60f562ac7e adding /out/soong_injection/metrics/converted_modules_path_map.json
This file can be used by atest/scripts/tools to determine which modules
have been converted and what their bazel build path is.

Test: b build //packages/modules/adb/...
will generate the file at /out/soong_injection/metrics/converted_modules_path_map.json
Also added a unit test to check that the file is created.

{
  "adbd": "//packages/modules/adb",
  "adbd_test": "//packages/modules/adb",
  "add_ext4_encrypt": "//external/e2fsprogs/contrib",
  ....
}

Change-Id: Ibd424c487840d84c8a4fb635828a73541220b36b
2022-09-20 04:01:13 +00:00
Treehugger Robot
c518b336a3 Merge "Remove Python enables identical to global defaults." 2022-09-20 00:48:55 +00:00
Trevor Radcliffe
cee4e056aa Enable bp2build for cc modules relying on sysprop
Bug: 244439349
Test: m bp2build
Test: Inspect BUILD.bazel files
Test: Unit tests
Change-Id: I85bfb9fa69cb3f96b15bdbeb797dba86b3349804
2022-09-19 23:38:33 +00:00
Treehugger Robot
e53c7ea256 Merge "Revert "Allowlist libneuralnetworks's dependencies"" 2022-09-19 23:24:11 +00:00
Colin Cross
5555726311 Merge "Revert^2 "Drop dependency on musl_linker_script"" 2022-09-19 23:18:50 +00:00
Jason
fcc53f992b Use json encoding for cquery ParseResult
also using a generic json_encode as an approximation for `json.encode`

Test: 1. use m --bazel-mode-dev nothing to verify no error occured. 2.
revise the test cases under request_type_test. 3. pass the test cases

Bug:242587802

Change-Id: I1288ecca1afd3e32f6473bcabae4ee2cb5838007
2022-09-19 21:54:23 +00:00
Vinh Tran
414946c466 Revert "Allowlist libneuralnetworks's dependencies"
Revert submission 2216878-libneuralnetworks

Reason for revert: failing mixed_droid.sh
Reverted Changes:
I77c8d4736:Allowlist libneuralnetworks's dependencies
I5f98038ec:Remove conversion of backend.rust to Bazel

Change-Id: Ib7147b4afdbdd69d635eb1bb8ed2e725396fdae7
2022-09-19 20:20:52 +00:00
Chih-Hung Hsieh
395e50544f Update clang version to clang-r468909
* Allow/show clang deprecated* and array-parameter warnings.

Upstream commit date: 2022-07-25

Test: presubmit
Bug: 241941550
Bug: 241601211
Bug: 241011085
Change-Id: I5c152823500dde656e1306afcb6f45e824b50102
2022-09-19 19:26:18 +00:00
Liz Kammer
bda5850a71 Merge changes from topic "libbuildversion-directly"
* changes:
  Allowlist aapt2 deps.
  Add libbuildversion in converion instead of macro
2022-09-19 18:33:49 +00:00