Each conversion required defining a separate mutator, which will each
operate on _all_ modules and requires each to repeat checks whether the
mutator should operator. Instead, we introduce a single mutator and
modules can define a ConvertWithBp2build to implement bp2build
conversion for that module.
Test: bp2build.sh
Bug: 183079158
Change-Id: I99d4b51f441c2903879092c5b56313d606d4338d
For generated headers, Soong introduces the package to the includes (and
re-exports as necessary).
Test: bp2build.sh
Change-Id: Iea9cda859ddaa3e5393f0f4533c15fc60222c408
Test: Resolves build error for BP2BUILD_VERBOSE=1 b build //packages/modules/adb:libadbd_core
Test: Added unit test
Bug: 208481704
Change-Id: I4022c686c7baf050de3f97295fe4654515622a66
Add annotations to dependency tags that are dynamic or classpath
linkage.
Bug: 207445310
Test: m checkbuild
Change-Id: Ife89b8f234aa40c380c721eda7dd18cab697fbb3
This is configured from Make by setting up Darwin+Arm64 as a HOST_CROSS
target (which is largely true, as binaries can't be executed on X86_64
machines). On the Soong side, it's a bit blurier, as we don't current
have any other users that are the same OS but not natively executable
(Linux/musl is executable, Windows/x86 is a different OS).
Instead of requiring cc_binary/etc to become multi-architecture-aware
and using something like common_first/MultiTarget, this defaults all
non-multi-architecture-aware modules to be built with both
architectures. It then adds a dependency with the
DarwinUniversalVariantTag so that supporting modules can get the outputs
of the other variant.
Cc uses that dependency tag to run lipo on shared libraries and binaries
so that the output of the x86_64 variant is actually a fat binary
including both architectures.
Bug: 203607969
Test: build sdk-repo targets on a Mac
Change-Id: Icbddb0a177c0ba19d3e0d11f8cf568e0d1ea3245
* The obj-* targets only call clang or clang++ to compile
C/C++ files, like the tidy-* targets only call clang-tidy.
* Add (obj|tidy)-dir_os and module_os-(obj|tidy) phony targets
to include only targets of the specified OS.
* Add (obj|tidy)-dir_os_subset and module_os_subset-(obj|tidy) phony targets
to include only a subset of that OS target group.
* Most clang-tidy runs produce the same warnings for all variants
of an OS. The *_subset targets reduce runs over multiple variants.
* The obj-*subset targets are useful for a quick test to compile
at least one variant of every C/C++ file for each OS.
* The (obj|tidy)-soong phony target is changed to include only
(obj|tidy)-top_level_directory targets instead of ALL
module-(obj|tidy) targets in all subdirectories.
* For aosp_arm64-eng make tidy-* targets; count NINJA commands:
tidy-soong 381K
tidy-soong_subset 106K
tidy-soong_android 294K
tidy-soong_android_subset 73K
tidy-soong_linux_glibc 84K
tidy-soong_windows 12K
tidy-bionic 12K
tidy-bionic_subset 2.4K
tidy-bionic_android 11.5K
tidy-bionic_android_subset 2.1K
tidy-bionic_linux_glibc 1K
tidy-device_android 7K
tidy-device_android_subset 5K
tidy-hardware_android 3K
tidy-hardware_android_subset 9K
libfec_rs-tidy 33
libfec_rs_subset-tidy 9
libfec_rs_android-tidy 18
libfec_rs_android_subset-tidy 3
* For aosp_arm64-eng make obj-* targets; count NINJA commands:
obj-soong 399K
obj-soong_subset 112K
obj-soong_android 305K
obj-soong_android_subset 75K
obj-soong_linux_glibc 90K
obj-soong_linux_glibc_subset 38K
obj-soong_windows 12K
obj-bionic 15K
obj-bionic_subset 3K
obj-bionic_android 14K
obj-bionic_android_subset 2.3K
obj-bionic_linux_glibc 1.3K
obj-system-core 6K
obj-system-core_subset 3K
obj-frameworks-base 16K
obj-frameworks-base_subset 6K
libfec_rs-obj 33
libfec_rs_subset-obj 9
libfec_rs_android-obj 18
libfec_rs_android_subset-obj 3
Test: NINJA_ARGS="-n" WITH_TIDY=1 make some_obj_tidy_target;
compare output commands from various phony targets
Bug: 199169329
Bug: 202769240
Change-Id: I186c45dc07c5884888c1063dfc09cf212ffb0ebf
This allows using libbuildversion in Cuttlefish, which builds many
binaries for both vendor and host.
On vendor executables, this gets the build id from the
ro.vendor.build.version.incremental property.
Bug: 206843934
Test: m -j
Change-Id: I9ab11b42de3f1febf282f107c3e137592097d3c0
We do not profile host binaries. Moving to device binaries only helps
saving some disk space as well as shortening build time.
Test: presubmit
Change-Id: I09afb106d0e2ee250b3bc75d9dfd9cb8b6552c97
We already add the "-fdebug-info-for-profiling" flag globally by default.
Besides, Sampling PGO does not need additional target-specific build
flags, unlike instrumentation PGO.
This is preparation to separate out sampling pgo into a separate module.
NFCI.
Test: presubmit
Change-Id: Icb28a98c021a78db25d8cb5ca9694ed6b7367a8d
* shared libraries and binaries can depend on NDK share libraries
Bug: 208310402
Test: WITH_TIDY=1 make tidy-soong
Test: WITH_TIDY=1 make droid
Change-Id: I88ca8555c62d5ca49e36ca089749722166afec30
Necessary for modules that depend on headers through
LOCAL_HEADER_LIBRARIES in legacy Android.mk files.
Test: m nothing
Test: m nothing SOONG_CONFIG_art_module_source_build=false
on internal master
Test: m droid checkbuild SOONG_CONFIG_art_module_source_build=false
Test: m SOONG_CONFIG_art_module_source_build=false \
out/soong/.intermediates/prebuilts/module_sdk/art/current/sdk/prebuilt_jni_headers/linux_glibc_x86_64/prebuilt_jni_headers.a
ar t out/soong/.intermediates/prebuilts/module_sdk/art/current/sdk/prebuilt_jni_headers/linux_glibc_x86_64/prebuilt_jni_headers.a \
&& echo ok
Bug: 202192894
Change-Id: Ied267053d1fc3563870a3faaf41d79983a22815a
Bug: http://b/133876586
This was turned off but the upstream change fixing this has been long
part of the Android toolchain.
Test: Output of
m aidl_parser_fuzzer; readelf aidl_parser_fuzzer | grep -c sancov
hasn't changed.
Change-Id: Id7edd7ac5791b0e031fd4af46381acdbb1b80d47
Previously, could not set an empty string as a value of an attribute;
however, this is necessary in some cases. To not unnecessarily create an
empty string, use string pointers for attributes rather than strings.
Test: go test bp2build tests
Change-Id: I03b3a3567452d455246d22d81f86c317d06b7c39
This reverts commit 753dd32123.
Reason for revert: Broke hwasan postsubmit and https://r.android.com/1906006 does not seem to fix it. Reverting while investigating.
Change-Id: I0033314ac936e7062dc785b3b362ead0b5e9d8f0
Unlike other prebuilt modules it doesn't have a srcs property of any
kind, so android.Prebuilt cannot defer to the source module just
because its srcsSupplier would return nil.
Test: m nothing
Bug: 202192894
Change-Id: Iafcf165569bad6eae37820cf71aa0fcacb720e02
variable usage.
There's bug a in the current soong_config_variable handling
implementation where a soong_config_variable sets conditions_default
value for an attr, and a non-conditions_default value for another attr.
This results in the former attr not properly setting the zero value for
the non-conditions_default select key, resulting in the pretty printer
omitting the attribute totally.
The current implementation in this CL ensures that the zero value is set
whenever this happens at the module level. This is seen in
library_linking_strategy_cc_defaults (see comments in code, and the new
tests)
Test: CI
Bug: 198556411
Change-Id: Ibaeb94508c51a7429fb7a08df610cbb5470f76d2
Many modules requiring min_sdk_version have been used without setting
it, but hard-coded in allowlist.
Bug: 158059172
Test: m
Change-Id: Ibb09ddfdb11df0791a28eb8a0a49f1780084fd95
Test: flash & boot flame_hwasan-userdebug
Test: run parts of CTS on flame_hwasan-userdebug
Bug: 184289082
Bug: 172507966
Change-Id: I520bf57df57df45a63bc06a47462d6dc9a541828