Add new module:
host_snapshot {
name: "host-snapshot"
deps: [
(list of host tools)
],
...
}
Package host tools using android.PackagingBase to capture host tools and transitive packaging data.
Add JSON meta data to snapshot that allows snapshot to be installed via development/vendor_snapshot/update.py
Add support to generate a fake host snapshot of all host modules that is used to detect required
modules via development/vendor_snapshot/update.py.
Bug: 192556798
Bug: 194799048
Bug: 192896149
Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist -- check snapshot exists in dist
Change-Id: I849c4db801cd858408f6fe6a3ce69262a23a5be9
Make prebuilt_etc module available for the snapshot. This change
includes implementing snapshot interface for the prebuilt_etc module so
it can be added to the snapshot from the fake snapshot, or when the
module is specified in the list.
Bug: 192430376
Test: m nothing passed
Test: Checked if the module is included in the snapshot properly
Change-Id: I3574d2a1b8f8f4e5f083f3913e8768f5088d0c46
Current snapshot definition is located in the CC module, so it is
difficult to capture non-CC module (such as prebuilt_etc) to the
snapshot. Separate general snapshot definition from cc so other modules
can also define its own snapshot.
Bug: 192430376
Test: m nothing passed
Change-Id: Ifb69fb3d2ec555b629aa31ec03e7ce5831fd3063
License files must be captured with the snapshot modules. NoticeFiles
does not have the information provided by the `license` module.
Reading the `Effective_license_text`, snapshot includes the required
license files.
Bug: 190690041
Test: build
check the NOTICE files built from snapshots
Change-Id: I96c4579b4bef484cbb39fc06c707742a02a2b90b
snapshot modules require the list of static libs to find the NOTICE
files for the snapshot modules.
snapshot binaries must include static_executable property to check if
non static binaries have libc as a static lib.
Bug: 190690041
Test: Check NOTICE for libaudiopreprocessing.so built from snapshots.
Change-Id: I53f7549a158ab27ada87833a3f4d58620aa7c3cf
Adds support for snapshotting Rust rlibs. This allows us
vendor-specific code that uses rlib-only linkage until dylib
snapshot support is added.
Bug: 184042776
Test: m nothing # new Soong tests pass
Test: Example test Rust vendor module builds
Test: m dist vendor-snapshot # includes rlibs
Change-Id: I4976d3e1efec0ee778cc97730d45be471dffb678
Export additional fuctions, structs, and interfaces from cc for use in
the rust package to allow for rlib snapshotting.
Bug: 184042776
Test: m nothing
Change-Id: I4c53b9378d5d5b5973dbd23ab692cdfb2ede60b9
This CL exports and refactors some cc vendor-snapshot related functions
so they can be reused by rust modules to support vendor snapshotting.
Bug: 184042776
Test: m nothing
Change-Id: I12706e62ce0ac3b2b4298085fafc1d77b8e0a0c4
Refactors the vendor snapshot support to use the LinkableInterface
so that support can be extended to Rust. This CL does not add
vendor snapshot support for Rust; that is left for a follow-on CL.
Bug: 184042776
Test: m nothing
Change-Id: Id0c4970ca00053484a52677d182153cbc454c301
Remove llndk_library in favor of cc_library with llndk.symbol_file.
Bug: 170784825
Test: m checkbuild
Test: TestLlndkLibrary
Change-Id: I43580976589a7a2a176d7442be53fa043c0c8324
As part of adding Vendor support to Rust, refactor the image mutator in
CC to a new common image mutator interface so this logic can be reused
across both CC and Rust.
Bug: 184042776
Test: m nothing
Change-Id: Ia55d5ad840db7cf1a64d6c65ed86487230cb8742
We need this so that HWASan sanitizer mutator in CC can sanitize Rust.
Bug: 180495975
Test: m nothing
Change-Id: I2c9eb248df4e55a33f5d45083e91588f4c8e3e94
Androidmk_suffix has been captured with "m vendor-snapshot". But the
suffix is to avoid collision with core variants, so the suffix should be
based on the existence of core variants. This change sets the suffix by
using OtherModuleDependencyVariantExists. This way we can also avoid
mutators and global states.
Bug: 179665538
Test: m nothing (soong test)
Change-Id: I35343aa2c4c07782057b82e6dd0e705a786e55fc
Using $out.rsp as the rsp file adds extra complexity around keeping
the $ unescaped. Make callers to FlagWithRspFileInputList provide
an explicit path for the rsp file instead.
Bug: 182612695
Test: rule_builder_test.go
Change-Id: I3f531d80c1efa8a9d09aac0a63790c5b11a9f0c6
When using the directed vendor snapshot, the build fails because soong
fails to find some variants of the modules that have been excluded
from VENDOR_SNAPSHOT_MODULES, even though those modules are not going
to be used by the build.
The solution implemented here is to generate fake versions of those
modules (empty files) and include them in the generated Android.bp,
so that soong finds the modules, even though trying to use them would
fail.
Bug: 171821997
Bug: 179275601
Test: source build/envsetup.sh
Test: m -j nothing
Change-Id: Ibd3e963ab3e5504c0ac817f7cabbd241bf47a5cb
Propgate the Android.mk suffix from source modules into the snapshot so
that it can be used for the prebuilt modules.
Bug: 177098205
Test: vendor_snapshot_test.go
Change-Id: Iea151dc91395f714fbcad1df3a6fd0874e5455d9
*_available will not provide if a module is VNDK-private or not.
Fixed it by using IsVndkPrivate() with private() interface.
By allowing exclude_from_vendor_snapshot for vendor_available
modules, available() interface is no longer required. Tests are
updated for exclude_from_vendor_snapshot on vendor_available modules.
Bug: 175768895
Test: m nothing
Change-Id: I9ff85256170d59b378a4c354d5c007cfbeacabc5
Vendors can now generate only needed modules by setting the following
Makefile variables:
- DIRECTED_VENDOR_SNAPSHOT: set to true
- VENDOR_SNAPSHOT_MODULES: list of snapshot candidates
e.g.
DIRECTED_VENDOR_SNAPSHOT := true
VENDOR_SNAPSHOT_MODULES := toybox_vendor sh_vendor libbase libcutils ...
Bug: 157967325
Test: m dist vendor-snapshot after setting those in BoardConfig.mk
Change-Id: I6515a43d9358d94483d7c7fa2b066f9dd457f6aa
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
A fake vendor snapshot is a vendor snapshot whose prebuilt binaries and
captured headers are all empty. It's much faster to be built than the
real vendor snapshot, so users can exploit the fake vendor snapshot to
reduce the size of vendor snapshot they need, by installing the fake
snapshot and then inspecting the ninja dependencies.
Bug: 157967325
Test: m dist vendor-fake-snapshot
Change-Id: I5e16e8dbbf9dd5e753cdd471ca73d06984a6cb2c
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
SkipInstall is actually primarily used to prevent making a module
visible to Make, rename it and add new SkipInstall that actually
skips installation without affecting Make.
Call c.SkipInstall() for uninstallable cc modules to allow calling
c.installer.install, which will collect PackagingSpecs for
uninstallable cc modules, allowing them to be used by genrules.
Bug: 124313442
Test: m checkbuild
Change-Id: I8038ed5c6f05c989ac21ec06c4552fb3136b9a7a
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
Add vendor_ramdisk_available and vendor_ramdisk attribute to
various rules. When a vendor_ramdisk variant of a module is
generated, it is installed to $OUT/vendor-ramdisk.
It is similar to a ramdisk image.
Test: m nothing -j
Change-Id: Ib2d16459f3094dbe21c3bdb7c016cb4b2bf62765
Also, TestVendorSnapshotUse is amended so it can test whether vndk
snapshot and vendor snapshot modules export their flags correctly.
Bug: N/A
Test: manual test
Change-Id: Ie62ad1206449b1a40db8a2282af00616db693017
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
The prebuilt-vs-source selection operates by setting SkipInstall on
either module. When the vendor-snapshot module visits all modules it
will visit both, and if it is a static library it will then add
duplicate install rules for both source and prebuilt unless it
looks at SkipInstall.
Test: `m nothing` in a tree with prebuilts/runtime present, that
has been updated with a snapshot after https://r.android.com/1398472,
which started to propagate vendor_available flags to prebuilts
snapshots.
Bug: 151303681
Change-Id: Ie425f0115e4180b7f4a8e682696697d55d666845
When building a vendor snapshot, the general rule the
build system uses to select a module for inclusion into
the vendor snapshot is if it's a framework module.
However, there are cases where a partner may modify the
framework module, thereby assuming control of that
module.
This change adds the exclude_from_vendor_snapshot
property allowing the partner to mark a module that
would normally be included in the vendor snapshot for
exclusion. This module is then built from source when
building the vendor image against the vendor snapshot.
Bug: 165705527
Test: m nothing
Test: build partner code against vendor snapshot
Change-Id: I6c5c15f13eeeb8f29717a4abd84b65fa72096889
The cc stripping logic can be reused for Rust. Export the Stripper
structure for that purpose. Extract the strip-related flags from
builderFlags into StripFlags. Add the method flagsToStripFlags
(similarly to flagsToBuilderFlags).
Add the helper method disableStripping on libraryDecorator.
Test: m
Bug: 153430439
Change-Id: I11aef1abb8d498a4c1672500a7398279edf7f548
CFI modules can't link against non-CFI static libraries, and vice versa.
So without capturing both CFI and non-CFI static libraries, vendor
modules won't be able to use CFI, which will be a critical security
hole.
This captures both CFI and non-CFI variants of all static libraries for
vendor snapshot, except for those whose cfi are explicitly disabled.
For example, suppose that "libfoo" is defined as follows.
cc_library_static {
name: "libfoo",
vendor_available: true,
}
As it doesn't have cfi disabled, two libraries "libfoo.a" and
"libfoo.cfi.a" will be captured. When installed, vendor snapshot module
for "libfoo" will look like:
vendor_snapshot_static {
name: "libfoo",
src: "libfoo.a",
cfi: {
src: "libfoo.cfi.a",
},
}
The build system will recognize the "cfi" property, and will create both
CFI and non-CFI variant, allowing any modules to link against "libfoo"
safely, no matter whether CFI is enabled or not.
Two clarification:
1) The reason why we don't create separate modules is that DepsMutator
runs before sanitize mutators. CFI and non-CFI variant of a library
should exist in a single module.
2) We can't capture CFI variant if the source module explicitly disables
cfi variant by specifying the following.
sanitize: {
cfi: false,
}
In this case, only non-CFI variant will be created for the vendor
snapshot module.
Bug: 65377115
Test: m dist vendor-snapshot && install && build against snapshot
Change-Id: Idbf3e3205d581800d6093c8d6cf6152374129ba4
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
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
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
LLNDK libraries shouldn't be disabled in any case.
Bug: 157106227
Test: m
Change-Id: I059e639b21d0edb8abc00773891d37e890a36cce
Merged-In: I059e639b21d0edb8abc00773891d37e890a36cce
(cherry picked from commit 470b4cf826)
cc_object modules are also necessary for vendor snapshot.
Bug: 157106227
Test: m vendor-snapshot
Change-Id: Idf4fd37a26f6f712f3cbab43133622f9f9bd9372
Merged-In: Idf4fd37a26f6f712f3cbab43133622f9f9bd9372
(cherry picked from commit 502679e061)
This refines the vendor snapshot codes in order to fix logic errors.
- Capture toolchain_library and cc_library_headers correctly.
- Redirect unwind static library correctly.
- Filter out sanitize / coverage / lto by looking at HideFromMake.
- Add binary() function for clear and shorter codes.
- Include test modules.
- Add more tests to prevent further snapshot breakages.
Bug: 157106227
Test: m vendor-snapshot
Test: m nothing for all available targets
Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true \
NATIVE_COVERAGE=true COVERAGE_PATHS="*" m nothing
Change-Id: Id90082b5ab730f928582ad24f022ba410855400e
Merged-In: Id90082b5ab730f928582ad24f022ba410855400e
(cherry picked from commit 4d8d8fec4a)