Commit graph

58457 commits

Author SHA1 Message Date
Usta Shrestha
808bc719b9 Unit test for missing module error
build_conversion handling of missing module

Bug: N/A
Test: unit test build_conversion_test.go
Change-Id: I636b7228040294d354bf2add050babe66fc25cce
2022-09-26 15:37:34 +00:00
Yu Liu
7574afb67f Merge "Allowlist libcode2_hidl@1.0/1.1/1.2" 2022-09-23 16:05:44 +00:00
Treehugger Robot
b1f2bfdb72 Merge "Remove apexer.required workaround for aapt2." 2022-09-23 13:25:51 +00:00
Treehugger Robot
ad37451b65 Merge "[LSC] Add LOCAL_LICENSE_KINDS to build/soong" 2022-09-23 13:02:32 +00:00
Anton Hansson
f419277cc5 Merge "Tweak logic for when extension txt is latest" 2022-09-23 10:11:56 +00:00
Jingwen Chen
a5ecb37d64 Remove apexer.required workaround for aapt2.
Add a filter for cyclic references in required module names in bp2build.

Test: CI
Bug: 247985196
Bug: 225291837
Fixes: 234748998
Change-Id: Id1cfd0b2e5f217cdb01218ec3bbe11d5070cc9df
2022-09-23 06:41:35 +00:00
Jingwen Chen
2b8dcb4475 Merge changes from topics "soong_zip", "zip2zip-bp2build"
* changes:
  Add zip2zip alias and allowlist unblocked rdeps.
  Add a soong_zip alias to prebuilts and allowlist all blocked rdeps.
2022-09-23 06:37:36 +00:00
Jingwen Chen
f50817d511 Add zip2zip alias and allowlist unblocked rdeps.
Test: presubmit
Change-Id: Ia4eb3e6af5cf43dc5c1d924cbf7dcf812f4b8703
2022-09-23 02:29:02 +00:00
Jingwen Chen
4a7bf608b2 Add a soong_zip alias to prebuilts and allowlist all blocked rdeps.
This is an improvement over directly referencing the prebuilt because
bp2build can now emit BUILD files that contain a dep to
//build/soong/zip/cmd:soong_zip even though we're not converting the
soong_zip module.

It helps to make progress despite not having go rules support to
convert/build soong_zip. This unblocks many modules, like genrules and
gensrcs that use soong_zip in tools. soong_zip doesn't change often, so
it's not risky to depend on the prebuilt instead of source version.

Bug: 194644518
Bug: 248222296

Test: bp2build CI
Change-Id: Idef0c27ec0fb43a9097d750ec72fba00644c9f2a
2022-09-23 02:28:36 +00:00
Stephen Hines
fc21a0e55b Revert "Update clang version to clang-r468909"
This reverts commit 395e50544f.

Bug: 241941550
Bug: 241601211
Bug: 241011085
Test: Builds

Change-Id: Ic2bb5d5dc52db743435defd129b5c2d0dc794d58
2022-09-22 18:59:01 -07:00
Treehugger Robot
eaf5eda15b Merge "Fix package boundary in glob expansion with checked in BUILD files." 2022-09-23 01:25:36 +00:00
Kevin Dagostino
a964a2f12a Merge "adding /out/soong_injection/metrics/converted_modules_path_map.json" 2022-09-23 00:43:01 +00:00
Jingwen Chen
0eeaeb8ef7 Fix package boundary in glob expansion with checked in BUILD files.
For directories without an Android.bp file, if they contain a merged
checked in BUILD file, it becomes a package boundary in the symlink
forest. However, the current glob expansion is only aware of Android.bp
files, but not merged BUILD files, so it generates glob expansions
incorrectly for files that cross the package boundary.

This CL fixes that by making the package boundary function aware of the
keepExistingBuildFile allowlist. See the new test cases for example.

Also stop using the same global bp2buildConfig for every test case to
allow each test to define their own bp2build allowlists.

Bug: 185358476
Test: new unit tests

Change-Id: Ifcd1283480a09a642ef4343e5bbc599583524577
2022-09-22 23:22:49 +00:00
Chih-hung Hsieh
b472d457e0 Merge "Update clang version to clang-r468909" 2022-09-22 23:12:41 +00:00
Spandan Das
b79d1aee38 Merge changes from topic "api_export"
* changes:
  Allowlist conversion of api providing module types
  Multi-tree API bp2build converter for ndk_library
2022-09-22 20:49:16 +00:00
Bob Badour
302756ae83 [LSC] Add LOCAL_LICENSE_KINDS to build/soong
Added SPDX-license-identifier-Apache-2.0 to:
  python/tests/proto_pkg_path/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I17e9945a265d0ede3e291ed6f5d410dde035fbe5
2022-09-22 13:34:03 -07:00
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
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
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