Add a filter for cyclic references in required module names in bp2build.
Test: CI
Bug: 247985196
Bug: 225291837
Fixes: 234748998
Change-Id: Id1cfd0b2e5f217cdb01218ec3bbe11d5070cc9df
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
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
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
`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
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
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
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
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
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
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
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
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
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
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