Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.
Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Move the global lists of VNDK modules into boolean properties on the
modules themselves, and use the new SingletonModule functionality
to visit all modules and collect the list of modules with the properties
set.
Bug: 176904285
Test: all soong tests
Test: m checkbuild
Test: compare Soong outputs
Change-Id: Icf7e2f8f190a517d30f0780e98762bc0084ddb24
Adds a PlatformSanitizable interface which both CC and Rust can
implement so that the sanitizer mutators in CC can sanitize Rust
shared/static libraries appropriately.
Bug: 147140513
Test: m nothing
Change-Id: Ib31103b6c4902a4d5df2565c0d7c981298d100a3
In case of VNDK, 'vendor_available: false' had a special meaning that
defines VNDK-private libraries. It is not trivial because not
defining a boolean property means 'false' normally. To avoid the
confusion replace it with the 'vndk.private: true' for VNDK-private
libraries and 'private: true' for LLNDK-private libraries.
All VNDK libraries must define 'vendor_available: true' and may have
'vndk.private: true' if they are VNDK-private.
With this change '(vendor|product)_available: false' is the same as
not defining the property.
LLNDK-private must define 'private: true' instead of
'vendor_available: false'.
Bug: 175768895
Test: build
Change-Id: I57fbca351be317257d95027f3cdcdbbe537eab23
Replace the vndk_libraries_txt module type with llndk_libraries_txt,
etc. in preparation for making it a new SingletonModule, which will
only work with a single instance of the module type.
Bug: 176904285
Test: m checkbuild
Change-Id: Ie010a9eeee8f5849201aa4ab4eb9b2e7a9cd7d5b
Some VNDKs will be available to product modules by adding
'product_available' property. These VNDK libs will be listed in
vndkproduct.libraries.txt and tracked by the build system for the
changes. The product available VNDK list will be frozen by the
release process.
Bug: 174323911
Test: build
Change-Id: Ie1b085851413a8f2273925fefdc14fec3bfc7892
To define VNDK-private libraries, we used `vendor_available: false`.
Because of it, `vendor_available == nil` had different meaning from
`vendor_available: false` for the VNDK libraries.
To clarify this, we change the logic for defining VNDK-private
libraries which was:
cc_library {
name: "vndk_private",
vendor_available: false,
product_available: false,
vndk: {
enabled: true,
},
}
It must be replaced with
cc_library {
name: "vndk_private",
vendor_available: true,
product_available: true,
vndk: {
enabled: true,
private: true,
},
}
Bug: 175768895
Test: m nothing
Change-Id: I81769f57c2231e54b682a28e4b82631ab9f3d390
With this patch, `vendor_available: true` will no longer creates
product variant. Instead, modules need to set `product_available:
true` if they have to be available to product vanriant.
If both properties are defined for VNDKs, they must have the same
values.
Bug: 150902910
Test: m nothing
Change-Id: I28fb6886e6114583227a31151136627c8516ac9c
Rewriting LLNDK dependencies with .llndk suffix requries referencing
a global data structure to determine if a given library is an LLNDK
library and therefore needs the .llndk suffix. References to
global data structures from mutators must be removed to support
incremental Soong analysis. Instead, move the LLNDK stubs rules
into the vendor variant of the implementing cc_library so that
the original name can be used.
As an incremental step, the llndk_library modules are left in
place, and the properties are copied into the cc_library via
the dependency specified by the llndk_stub property. A followup
will move the LLNDK properties directly into the cc_library and
delete the llndk_library modules.
The global list of LLNDK libraries is kept for now as it is used
to generate the vndk.libraries.txt file.
Bug: 170784825
Test: m checkbuild
Test: compare Soong outputs
Test: all Soong tests
Change-Id: I2a942b21c162541a49e27b2e5833c9aebccff1d0
Refactors parts of CC to prepare for preliminary support for using Rust
static libraries in vendor images. Some previously private functions are
made public, and additional functions are added to LinkableInterface so
GetMakeLinkType can be passed a LinkableInterface.
Bug: 172525289
Test: m
Change-Id: I5fda48e79532fe9ceab255e18d910af58048a123
Also some files are refactored:
- snapshot_prebuilt.go is separated from vendor_snapshot.go. Now
vendor_snapshot.go contains snapshot generation codes, while
snapshot_prebuilt.go contains module definition codes.
- Some helper functions are moved from snapshot_utils.go to util.go.
- Some ambiguous names of types and functions are renamed.
We still can add more detailed comments about the snapshots. They are to
be uploaded in follow-up changes, to avoid making this change too big.
Bug: 173474311
Test: generate vndk and vendor snapshot
Change-Id: I18fa837ccdf44a042b7a78e5c3df25fd2de96d95
Enable the RuleBuilder and RuleBuilderCommand methods to access
the BuilderContext by passing it to NewRuleBuilder instead of
RuleBuilder.Build.
Test: genrule_test.go
Test: rule_builder_test.go
Test: m checkbuild
Change-Id: I63e6597e19167393876dc2259d6f521363b7dabc
module_names.txt and module_paths.txt did not end with the newline
character in each line. Instead it had literal '\n'.
The character must use '\n' without escape character.
Test: m vndk
Change-Id: I1de1d0993994c8a95b02426777f62bfb2bed7b6f
The android.WriteFile rule takes careful escaping to produce the
right contents. Wrap it in an android.WriteFileRule that handles
the escaping.
Test: compare all android.WriteFile outputs
Change-Id: If71a5843af47a37ca61714e1a1ebb32d08536c31
To make a module available to product variants, it must define
`product_available: true`. `vendor_available: true` will not create
product variants any more.
However, in this CL, we don't change the behavior of
`vendor_available` property. It still creates both variants. After we
update all Android.bp files that need to provide product variants
with `product_available: true`, we may upload the remaining patches.
Bug: 150902910
Test: lunch aosp_arm64-userdebug && m
Change-Id: I0fd5be7bbae2c45d5cab3c3c2ca49f53a9b6f975
The stubs methods are very specific to cc for now, move them out
of LinkableInterface so they are not shared with rust. Instead,
create a cc.Module.library field that contains the libraryInterface
to simplify calling libraryInterface methods on cc modules.
Test: all Soong tests
Test: no change to Soong outputs
Change-Id: I0289d866ce1f7a765631fe3101a62b1b4988ba1c
Prepare for making the relationship between an llndk_library stubs
module and the cc_library implementation module explicit by
adding an llndk_stubs property. Each cc_library will be updated
to point to its llndk_library, and the llndk_library name will
be changed to make the .llndk suffix explicit. Then the implicit
connection and suffix can be removed.
Bug: 170784825
Test: m checkbuild
Change-Id: I6b0482a3f286ec29b2e928551aa4317749f2b499
VNDK libs are installed as part of VNDK APEX, so we don't need to
install them at all.
Bug: 170711679
Test: m
Change-Id: I62b881d6e65d6b007db1d26ab314c140c60e8a4e
If vndk-sp closure fails, the error message mentions it instead of
double-loadable error. It would be more helpful since vndk-sp is more
straightforward to fix.
Bug: 171080110
Test: m (soong test added)
Change-Id: Icc762a4ffb4a8d7d6b31ef1daac17f13383518bf
Export information about static libraries, shared libraries and
exported flags through Providers instead of accessing the module
directly. Much more is left to be converted, but this significantly
simplifies the dependencies on libraries with stubs by making it easy
for a module to masquerade as another by simply exporting the
providers from the other module. Instead of depending on all the
versions of a library and then picking which one to use later, it
can depend only on the implementation variant and then select the
right SharedLibraryInfo from the variant.
Test: m checkbuild
Test: only expected changes to build.ninja
Change-Id: I1fd9eb4d251cf96ed8398d586efc3e0817663c76
A global variant was used to store the global mapping between
modules and APEXes. Replace it with storing pointers to APEX
contents inside each module so that they can query the contents
of any APEXes they belong to.
Bug: 146393795
Test: all Soong tests
Test: single line change to build.ninja host install dependency ordering
Test: no Android-${TARGET_PRODUCT}.mk, make_vars-${TARGET_PRODUCT}.mk or late-${TARGET_PRODUCT}.mk
Change-Id: Id2d7b73ea27f8c3b41d30820bdd86b65c539bfa4
prebuilt_firmware module is one of many prebuilt_etc-like modules. When
it is soc-specific, it is installed in /vendor/firmware. Similarly, when
prebuilt_firmware is embeded in a vendor apex, installing it in
<apex>/firmware instead of <apex>/etc.
Bug: 162701747
Test: lunch sunfish-userdebug
m && device boots && vibrator works
Change-Id: I00d28cde42259aaf8221e3897df77efc42b0c1ca
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
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
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
Give prebuilt_etc and sh_binary their own packages and split the
gigantic main Android.bp up to small, per-package ones.
Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
Revert submission 1313718-revert-1312595-zlib_as_stub-BVNRLZPNBJ
Reason for revert: relanding
Reverted Changes:
I0cf486d9b:Revert "libz provides stubs to Mainline modules."
I412132f8a:Revert "libz is a stub"
I617eb90a3:Revert "Allow libz to have stub even though it's n...
Exempt-From-Owner-Approval: this is a clean relanding.
Test: m
Change-Id: Ib09a615bd11cf2647dcad42108adfcfc5040940f
Revert submission 1312595-zlib_as_stub
Exempt-From-Owner-Approval: reverting a bad change
Reason for revert: broke rvc-dev-plus-aosp
Reverted Changes:
I7c0a7f954:libz is a stub
If51a7e80f:libz provides stubs to Mainline modules.
I26417bb78:Allow libz to have stub even though it's not an LL...
Change-Id: I617eb90a33eacc7f264551c969ff5a16fa0d4087
For VNDK-Lite devices, which doesn't define BOARD_VNDK_VERSION, VNDK
APEX is built with only VNDK-Sp libraries with core variants.
Bug: 141908078
Bug: 152353068
Bug: 151635128
Test: TH
Merged-In: I0d08d32473368fd158818d4c2c72fc4cfad68ce6
Change-Id: I0d08d32473368fd158818d4c2c72fc4cfad68ce6
(cherry picked from commit 65d8a6262c)
Exempt-From-Owner-Approval: cp from internal
Change-Id: I0d08d32473368fd158818d4c2c72fc4cfad68ce6
If a lib has stubs, that means the library provides stable C APIs and
the APIs are guaranteed to be maintained in a backwards compatible
manner. Then there is no reason to have the same library in VNDK,
because VNDK is for libraries (usually having C++ interfaces) where API
stability across the yearly releases is hard (or impossible) to be
guaranteed.
This change triggers an error when the build system finds a VNDK lib
which has stubs defined. Users are suggested to make the lib an LLNDK
one.
Bug: 151303316
Test: m
Change-Id: Id305196a9d5a6fc7e7f9c02f3fa076859dc9a282
This reverts commit 380fc3615c.
Reason for revert: breaking one of internal targets
Change-Id: Ica96c44078e5a7f674410828af3ba851317775dd
Exempt-From-Owner-Approval: revert to fix build failure
Even though use_vendor:true is prohibited, there is media.swcodec apex
which is still use_vendor: true and also needs to support Android10.
(min_sdk_version: 29)
Because LLNDK stubs were provided only for the current VNDK version,
media.swcodec couldn't be built against min_sdk_version: 29.
This change introduces additional versions for LLNDK stubs which are
enforced when an apex with use_vendor: true sets min_sdk_version.
To make things easier, the versions of LLNDK stubs are borrowed from its
implementation libraries.
Bug: 147450930
Bug: 149591522
Test: TARGET_BUILD_APPS=com.android.media.swcodec m
(with min_sdk_version: 29 set)
check if liblog/libc/libm/libdl stubs are 29
check if 29 stubs don't have new symbols.
Change-Id: I79946cbb4da6617138a96d2b254349d3a298e77b
VNDK and vendor snapshot singleton work in a single thread, so globbing
in singleton results in ridiculus running time. Moving codes to
GenerateAndroidBuildActions to reduce running time.
Bug: 150406226
Test: VNDK_SNAPSHOT_BUILD_ARTIFACTS=true m dist vndk vendor-snapshot
Test: vendorSnapshotSingleton build time became 0.56s (from 10s)
Test: build.ninja building time became 1m11s (from 1m21s)
Change-Id: I4a081eef5847c62ca00280ca426f5b4e10f87b59
As a second step to removing the go/android3p instructions to copy or
to link NOTICE to LICENSE, include LICENSE files in the notices, which
will allow deleting all of the copied/linked NOTICE files.
The change causes a few additions to the system image notice files.
Test: manually built and compared before and after notices
Change-Id: Ia7bc58e2eba7bed5e63934881b5298201a93bc3e
Vendor snapshot can be captured with "m dist vendor-snapshot". With
vendor snapshot and vndk snapshot, older version of /vendor and newer
version of /system will be able to be built together by setting
BOARD_VNDK_VERSION to past vendor's version.
Only vendor modules under AOSP are to be captured. In detail, modules
under following directories are ignored:
- device/
- vendor/
- hardware/, except for interfaces/, libhardware/, libhardware_legacy/,
and ril/
Test modules (cc_test, etc.) and sanitized modules are also ignored.
Bug: 65377115
Test: m dist vendor-snapshot
Change-Id: If7a2f6de7f36deee936930c0ccf7c47c4a0cebf6
This reverts commit 5df3b11f78.
Reason for revert: re-land with a fix
Fix a broken soong test
Add implicit dependency (libprofile-clang-extra) to make a test pass.
Bug: n/a
Test: m
Change-Id: I0b179199bc032501354f8e24782837453781bd8c
VNDK APEX is supposed to contain "vendor" variants of VNDK libraries.
This is different from normal APEXes which have "apex" variants.
Bug: 146758869
Test: build / flash / boot
Change-Id: I5e035678c337334092616b58d2e0e404788a6639
Exempt-From-Owner-Approval: Got ORV, but rebased with resolving merge conflicts.