Previously, the prebuilt mutators were added by the
cc.RegisterRequiredBuildComponentsForTest() function as a convenience
but unfortunately it lead to some of the mutators being in a different
order in the tests than in the normal build.
This change:
* Extracts the RegisterPrebuiltMutators() call from
cc.RegisterRequiredBuildComponentsForTest()
* Makes sure that the prebuilt mutators are registered before the
visibility gatherer and enforcer mutators.
Bug: 162505935
Test: m nothing
Change-Id: I7d959b558200b502f0a5e4653c41ea01414e142a
All uses of this property have been migrated to 'blocklist' instead.
Update language to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference
Bug: 161896447
Bug: 162245450
Test: TH
Change-Id: I4b83b41ad5a4b2caf1166b1acece9537f545aaad
llndk_library and llndk_headers are backward compatible. We may use
the source code instead of snapshot for those modules.
Bug: 161565086
Test: build with vendor snapshot
Change-Id: If3da3f9b31f7180d8d0835f8dbd7ba938a60d967
The implementation before libraryDependencyTag was added failed to
include some JNI libraries into apps because it did not handle
sharedExportDepTag, earlySharedDepTag or lateSharedDepTag.
Also fix a bug in cc.*Module.IsNdk that was comparing "liblog.ndk"
against "liblog" and incorrectly returning false that would have
caused NDK libraries that now pass the check above to incorrectly be
packaged into the APK.
Bug: 162437057
Test: m checkbuild
Change-Id: I02fb745abb5cace2b4e5bfff2f35cef6d2e0a4ff
The implementation before libraryDependencyTag was added failed to
treat shared library dependencies with reexported headers on a
static library as crossing the apex boundary because the dependency
tag was overwritten from SharedFromStaticDepTag to sharedExportDepTag,
causing FromStatic to be false.
Bug: 162437057
Test: m checkbuild
Change-Id: I514b90aeb0f1477045e92b46d17336d4fb2fb62c
The implementation before libraryDependencyTag was added failed to
treat the libgcc_unwind dependency as a static library when traversing
dependencies for LTO because it didn't handle staticUnwinderDepTag.
Bug: 162437057
Test: m checkbuild
Change-Id: Iccc96c0daa0379f51eb975c51fd5e8c507a0daba
The implementation before libraryDependencyTag was added failed to
expose some shared or header libraries because it didn't handle the
headerExportDepTag or SharedFromStaticDepTag tags.
Bug: 162437057
Test: m checkbuild
Change-Id: Ie477de70faa31cca8afaa753ea1c0c39586858c7
dependencyTag uses a set of predefined tags to identify different types
of dependencies. There are already multiple bits of metadata stored
in the dependency tag (Library, Shared, ReexportFlags), and supporting
them all requires a combinatorial explosion of predefined tags and
causes issues when using equality comparisons if a new bit of metadata
is added.
Add a new libraryDependencyTag type that will contain the metadata
bits, and replace the quality comparisons with checks on the metadata
bits.
There are 5 TODOs where modifying the checks identified problems with
the existing checks. These were left in place to produce identical
build output and will be fixed separately.
Bug: 162437057
Test: no change to build.ninja or {Android,make_vars,late}-${TARGET_PRODUCT}.mk
Change-Id: I72d4207dcf381c07c92e00e5a03968ebb5ed8d30
Bug: 162024969
Test: Successfully builds targets for both host and device
"writeonly" flag in SANITIZE_(HOST|TARGET) enables it with "address"
and "hwaddress"
Change-Id: Ia89d43230deef15a67dee09ed015fea14f0717ff
* changes:
Revert "Add prebuilt_build_tool to allow genrules to use prebuil..."
Revert "Switch cc's use of bison and flex to prebuilt_build_tool"
Revert "Fix builds with absolute OUT_DIR"
This will eventually replace the Blacklist property.
Update language to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference
Bug: 161896447
Bug: 162245450
Test: build topic
Change-Id: I3c2609c791c27b8ba3bcb55f79304b78bce1f518
Revert submission 1366377-prebuilt_build_tool_make
Reason for revert: breaks build
Reverted Changes:
I20bf062bb:Export prebuilt tools to Make
I4bb526492:Move some prebuilt build tool configs to Soong
I195b68813:Support per-module MakeVars
Ibcb257e7b:Fix dependency loop with flex
I6150f0f39:Switch cc's use of bison and flex to prebuilt_buil...
I6939451b8:Reland "Use genrules to build a consistent awk."
Idee60640f:Add prebuilt_build_tool modules for genrule use
I00893172b:Rename bison to bison_bin
I82c26be1c:Add prebuilt_build_tool to allow genrules to use p...
Change-Id: I1ca553ffe4b09250a441b9bc477c3ba98c6f6549
This reverts commit 2019658b86.
Reason for revert: broke builds where makefiles were using M4 without depending upon it
Change-Id: I18304246e7a8a8f8c2620dd2c65ed77acd256be2
* changes:
Support per-module MakeVars
Switch cc's use of bison and flex to prebuilt_build_tool
Add prebuilt_build_tool to allow genrules to use prebuilt tools
__ANDROID_SDK_VERSION__ for a cc module means API level of which the
module should work with.
For APEX variants, it should be apex.min_sdk_version and tracked by the
variable cc.Module.apexSdkVersion.
The variable was set in the wrong place and used uninitialized
sometimes, which results __ANDROID_SDK_VERSION__=0.
Bug: n/a
Test: m
Test: checked build.ninja manually
=> no __ANDROID_SDK_VERSION__=0
Change-Id: Iba532b2c62773983414a061f5291a73363322487
This new module type allows cc_test modules to depend on prebuilt
shared libraries and have them included as data dependencies alongside
the test binary.
Test: Manually verified to facilitate mk-to-bp migration of
bionic-unit-test prebuilt dependencies (aosp/1339035)
Change-Id: Idbac0854f1f9e2e01bbfa63591de458b61733e17
Android S would not support upgrade from O-MR1 devices, so VNDK Lite
configuration is no more valid. This change removes all VNDK-lite
variables from soong.
Bug: 158719241
Test: m -j passed
Change-Id: I54093fd4ee37ceddfc33a0b216b7069372040a0c
Merged-In: I54093fd4ee37ceddfc33a0b216b7069372040a0c
This allows setting per-module make variables earlier in the build,
particularly for prebuilt_build_tool users like LEX/M4/BISON. I moved
filegroup over because it's a simpler common interface, but it doesn't
strictly need it.
With this, the last user of the hardcoded cc.m4Cmd variable is gone.
Test: Inspect out/soong/make_vars-*.mk, out/soong/late-*.mk
Test: treehugger
Change-Id: I195b688131feac0c100c338a0749368aa5d50f4f
There was a special case in cc_prebuilt_binary only, which resulted in
prebuilt libraries getting both 32 and 64 bit variants even when their
sources only had one of them, and the other variant would be defunct
since it wouldn't get any prebuilt artefact.
This moves the handling of compile_multilib completely to the common
update code, so that SDK members don't need to deal with it. It doesn't
take SDK member defaults into account, which means a bit more
boilerplate in the snapshots, but it's simpler and less error prone
(different SDK member types have different defaults).
This relands https://r.android.com/1359962 after disabling the SDK
tests on mac once and for all.
Bug: 151303681
Test: `go test -v ./sdk` in build/soong on mac and linux
Change-Id: I05f6603b2ac9b8676b25c3e297165ca23284e9cc
Break apart test helpers a bit to make it possible to enable
LinuxBionic in a single test, and add LinuxBionic support to
cc.GatherRequiredDepsForTest.
Test: m nothing
Bug: 160349757
Change-Id: Iace1024c964cee2308c130c945daef9e46c18c66
The stdlib's xml apparently cares about ordering but also doesn't
preserve it. There are a number of different recommendations of other
ways to do this, but they all depend on packages we don't have
available (lxml or xml.dom.ext, in particular).
Test: pytest
Bug: None
Change-Id: I07108d8977c302404e7c90ca75a4bf7a1144750f
Imports weren't working in tests because the package had been created.
The Python "binaries" built by Soong don't seem to take their own
pkg_path into account, so I split the separate pieces of code here out
into their own packages.
Note that the ndk_api_coverage_parser tests do not actually pass
before or after this change (seems like it might be a
non-deterministic ordering issue in the attributes of the generated
output?), but they can at least be run now.
Test: pytest ndkstubgen
Test: pytest symbolfile
Test: pytest ndk_api_coverage_parser
Test: out/host/linux-x86/nativetest64/test_ndkstubgen/test_ndkstubgen
Test: out/host/linux-x86/nativetest64/test_symbolfile/test_symbolfile
Test: out/host/linux-x86/nativetest64/test_ndk_api_coverage_parser/test_ndk_api_coverage_parser
Bug: None
Change-Id: I2ac22f7ced7566e4808070f2f72fd04355846e0b
There was a special case in cc_prebuilt_binary only, which resulted in
prebuilt libraries getting both 32 and 64 bit variants even when their
sources only had one of them, and the other variant would be defunct
since it wouldn't get any prebuilt artefact.
This moves the handling of compile_multilib completely to the common
update code, so that SDK members don't need to deal with it. It doesn't
take SDK member defaults into account, which means a bit more
boilerplate in the snapshots, but it's simpler and less error prone
(different SDK member types have different defaults).
Bug: 151303681
Test: m nothing
Test: build/soong/scripts/build-aml-prebuilts.sh art-module-host-exports
Check that the generated Android.bp passes Soong.
Change-Id: Ib73444c6788ee1c78480bdb103aa2b8ae8f2c63c
llndk_headers can't depend on other non-llndk cc modules such as libc++,
just like llndk_library. This nullifies stl and sanitize to prevent such
dependencies.
Bug: 160639583
Test: m nothing, see dependencies of llndk_headers
Change-Id: I3c6830d6b46754981c4ae10a7e7e013ec849efaf
This allows dependencies on link:shared variant of library modules, and
adds the shared libraries adjacent to the test binary
Test: Manually verified on bionic-unit-tests target
Change-Id: I5d406bf9428664c5ac3d3c5915507b750375debb
Test: m SOONG_COLLECT_CC_DEPS=true SOONG_COLLECT_JAVA_DEPS=true dist
general-tests and verify module_bp_java_deps.json and
module_bp_cc_deps.json is in out/dist
Test: m SOONG_COLLECT_CC_DEPS=true SOONG_COLLECT_JAVA_DEPS=true
checkbuild dist general-tests
Bug: 154845369
Change-Id: I683fe1d7e17f7abaab40206770d09db705493ffb
generated_sources needs exclude_* just like that srcs needs exclude_srcs
to support variant-specific exclusion of source files.
Bug: 159585065
Test: m
Change-Id: I49e49b0b3a0115a01fc9cf6f9fe74b23e723a785
Even though modules listed in generated_headers may produce .h files and
return the list of them as GeneratedSourceFiles(), cc modules do not
need them. GeneratedDeps() and GeneratedHeaderDirs() are what we need.
Bug: n/a
Test: m
Change-Id: I655f88e8c1a387e256c58913931721aaeab90b62
A VDNK extension is an image:vendor module provided by a
vendor-modified framework project. So it should be
provided to the vendor build as a prebuilt (for the
purposes of building against a vendor snapshot).
Exempt-From-Owner-Approval: cherry pick from internal branch
Bug: 160189878
Test: manual
Change-Id: I3eb4794c1be2949b9c85fd52f823e5e14df4ad7d
Merged-In: I3eb4794c1be2949b9c85fd52f823e5e14df4ad7d
This doesn't need to be manually maintained. It briefly did need to be
during the transition from the old prebuilts, but that's long gone.
Test: treehugger
Bug: http://b/113547923
Change-Id: If05633f3cf622ab39e560a3dfcc88f3eb50406bf
A VDNK extension is an image:vendor module provided by a
vendor-modified framework project. So it should be
provided to the vendor build as a prebuilt (for the
purposes of building against a vendor snapshot).
Bug: 160189878
Test: manual
Change-Id: I3eb4794c1be2949b9c85fd52f823e5e14df4ad7d
This warning only flags code that's otherwise pretty trivial to refactor
into something more readable. It also catches nasty bugs, so turning it
on seems like a good idea.
Bug: 150166387
Test: TreeHugger
Change-Id: I0e095d83ba4a2dcd81f680efd8ea3d2a6fe1a970
This CL adds "dists" to the base property struct to support multiple
dist file configurations, and generic tag support to dist tagged outputs
of modules.
Fixes: b/152834186
Test: soong tests and `m sdk dist`
Change-Id: I80c86bc9b7b09e671f640a4480c45d438bdd9a2a
Signed-off-by: Jingwen Chen <jingwen@google.com>
It is not clear whether this is causing the bug but it is a potential
source of problems and if it does not fix the bug then at least it will
have eliminated this as the culprit.
Bug: 157656545
Test: m nothing
Change-Id: I3abcb9ae501977924d0d514f4d9007ead24fe0a5
Enforce min_sdk_version for every payload dependency of updatable
APEX/APKs.
android.CheckMinSdkVersion() calls ApexModule.ShouldSupportSdkVersion
for every transitive dependency from APEX/APK modules to see if it
meets the min_sdk_version requirements.
The common implementation for apex/android_app is provided in
android/apex.go.
Bug: 145796956
Bug: 152655956
Bug: 153333044
Test: m nothing
Change-Id: I4a947dc94026df7cebd552b6e8ccdb4cc1f67170
Make uses NATIVE_COVERAGE to enable gcov coverage and CLANG_COVERAGE
to enable clang coverage. NATIVE_COVERAGE is translated to the Soong
Native_coverage product variable which triggers the native_coverage
clause in Android.bp files. The clause also needs to be triggered
for CLANG_COVERAGE.
Rename the existing Native_coverage product variable to GcovCoverage,
and regenerate Native_coverage when either GcovCoverage or
ClangCoverage are set.
Also remove NativeLineCoverage, it wasn't doing anything differently
than Native_coverage.
Bug: 159059537
Test: m checkbuild
Change-Id: I215124a9b35a2ad50ad562079d392e3d33da11f4
Test: Ran with the following command and it succeeded
RBE_CLANG_TIDY="true" RBE_CLANG_TIDY_EXEC_STRATEGY="remote" RBE_CXX_EXEC_STRATEGY="remote_local_fallback" RBE_METALAVA="true" RBE_METALAVA_EXEC_STRATEGY="local" RBE_ABI_LINKER="true" RBE_ABI_LINKER_EXEC_STRATEGY="remote_local_fallback" RBE_CXX_LINKS="true" RBE_CXX_LINKS_EXEC_STRATEGY="remote" use_rbe m out/soong/.intermediates/external/android-clat/clatd/android_arm_armv7-a-neon/obj/external/android-clat/icmp.tidy
Bug: b/157147559
Change-Id: I110b6157fc090abd14ac32330fc59a3d76cdfa82
Fix a bug where host-only modules were incorrectly listed as VNDK.
Also refactor VndkMutator() / apexVndkDepsMutator() module skipping
logic.
Bug: 158543482
Test: Add unit test to cc/cc_test.go
Change-Id: I50b09f526cbc081149d8241c2a091e3ee48ef4d7
Merged-In: I50b09f526cbc081149d8241c2a091e3ee48ef4d7
(cherry picked from commit bba545e039)
Test: m nothing
Test: Check on go/Android.bp that cc_prebuilt_library supports
unique_host_soname
Bug: 158743135
Change-Id: Ie02a5cae057fb9092c226d8c5b7f63e1f66ad066
Vendor snapshot is supposed to have AOSP-defined modules which are
installed to vendor. kernel_headers are excluded from snapshot because
they always depend on vendor, regardless of locations they are defined.
Bug: 157106227
Test: m vendor-snapshot
Change-Id: If47634678797973266fcf502739216daf28ad790
Merged-In: If47634678797973266fcf502739216daf28ad790
(cherry picked from commit 65ca36a72e)
When a lib has sdk_version set, an SDK variant and a platform variant
are created by the sdkMutator. Then by the versionMutator, if the
library had 'stubs.versions' property, one or more versioned variants
and one impl variant are created for each of the two (SDK and platform)
variants. As a concrete example,
cc_library {
name: "foo",
sdk_version: "current",
stubs: { versions: ["1", "2"], },
}
would create 6 variants:
1) (sdk: "", version: "")
2) (sdk: "", version: "1")
3) (sdk: "", version: "2")
4) (sdk: "sdk", version: "")
5) (sdk: "sdk", version: "1")
6) (sdk: "sdk", version: "2")
This is somewhat uncessary because the need for the SDK mutator is to
have the platform variant (sdk:"") of a lib where sdk_version is unset,
which actually makes sens for the impl variant (version:""), but not
the versioned variants (version:"1" or version:"2").
This is not only unncessary, but also causes duplicate module
definitions in the Make side when doing an unbundled build. Specifically,
The #1 and #4 above both are emitted to Make and get the same name
"foo".
To fix the problem and not to create unnecessary variants, the versioned
variants are no longer created for the sdk variant. So, foo now has
the following variants only.
1) (sdk: "", version: "") // not emitted to Make (by versionMutator)
2) (sdk: "", version: "1") // not emitted to Make (by versionMutator)
3) (sdk: "", version: "2") // emitted to Make (by versionMutator)
4) (sdk: "sdk", version: "") // not emitted to Make (by versionMutator)
Bug: 159106705
Test: Add sdk_version:"minimum" to libnativehelper in libnativehelper/Android.bp.
m SOONG_ALLOW_MISSING_DEPENDENCIES=true TARGET_BUILD_UNBUNDLED=true libnativehelper
Change-Id: I6f02f4189e5504286174ccff1642166da82d00c9
Unbundled APEX modules need to access the platform variant (i.e.
sdk:"") since it's there that the versioned stubs are exposed.
Test: m SOONG_ALLOW_MISSING_DEPENDENCIES=true \
TARGET_BUILD_UNBUNDLED=true toybox
on master-art with prebuilt Runtime (Bionic) APEX SDK. The prebuilt
SDK doesn't have libc.ndk.xxx etc, which e.g. libcrypto would depend
on without this CL, since it specifies sdk_version.
Bug: 157549171
Change-Id: I3095e42beb2b48421bfb81be942cc2ac30405fd0
There are still out-of-tree users of `-fno-integrated-as`, which will
have issues without the hyphen.
Bug: http://b/158191033
Test: ./build.py
Change-Id: I44b68ab5b65a68df3993f38b99662178915e9be2
To support dist-for-goals in Soong, we need to define all phony rules
in Make so that dist-for-goals can insert additional dependencies on
them. Collect all the phony rules in phonySingleton and write them
out as Make rules when Soong is embedded in Make, or as blueprint.Phony
rules when Soong is run standalone.
Bug: 153485543
Test: m checkbuild
Change-Id: I68201eff30744b0f487fc4f11f033767b53a627d
Merged-In: I68201eff30744b0f487fc4f11f033767b53a627d
(cherry picked from commit c3d87d3112)
Now that tests don't need to specify every path passed to
PathForSource or PathForModuleSrc, remove them from cc.TestConfig.
Bug: 153485543
Test: all soong tests
Change-Id: I90cd7b4dfc49c156afbb0eea9a77159c3e1860fa
Merged-In: I90cd7b4dfc49c156afbb0eea9a77159c3e1860fa
(cherry picked from commit 2fce23ae6d)
Add missing dependency for file 'api_levels.json' in rule
'parseNdkApiRule'
Forest test build link: http://shortn/_iCbktdkPsT
Test: m ndk
Change-Id: I9bcd3f8d261e40b6033ec82c4a50971ccb8b45b1