Create snapshot_etc module in the Android.bp, so etc files in the
snapshot can be used from the build.
Bug: 192430376
Test: tested locally to check if update.py creates snapshot_etc module
and build succeeds
Change-Id: I4cc533d8a0a378dc94d0b780ea2972cd8c6314f4
Static binaries have "static_executable: true". This is required to
check if a static lib dependency on 'libc' is allowed for the
snapshot binaries.
Bug: 190690041
Test: 'm nothing' with snapshots
Change-Id: I6c0c7e71fe50624ac233bc43665f4127c0f6103b
snapshot modules have the static libs information. Include
`static_libs` property to the snapshot modules.
Bug: 190690041
Test: read the json files to create Android.bp
check if static_libs properties are included
Change-Id: I7aef610c9a767895d039991385b9abfabc531874
Adds support for collecting rlibs as part of the vendor snapshot.
Bug: 184042776
Test: m dist vendor-snapshot
Test: python3 development/vendor_snapshot/update.py --local $DIST_DIR --install-dir
vendor/vendor_name/vendor_snapshot VER
Test: vendor_snapshot_rlib modules generated, vendor_snapshot has rlibs
Change-Id: Ia90e53131c4ffba32883718b66ba99f4962d4633
Vendor snapshot mutator has been handled disabling unused arch variants,
but it's not the case for now. This change adds compile_multilib to all
modules except for header, so only needed variants can be created.
Bug: 184601825
Test: build fake snapshot, install, and see Android.bp
Change-Id: Iabca5c7e044811e2e89f42d3bb92107c3d91a81c
You might want to compare generated Android.bp files
from different snapshots or different points in time on
the same snapshot. Sorting the properties makes this
easier.
Test: manually compare different Android.bp files
Change-Id: I68beea856620f14b879cbf3148cab62dd991a67b
This will additionally generate {image}_snapshot module which contains
a list of vndk and snapshot libraries. This information will be used by
Soong to override source modules, and will look like:
vendor_snapshot {
name: "vendor_snapshot",
version: "30",
arch: {
arm: {
vndk_libs: ["libvndk", ...],
shared_libs: ["libc++", ...],
static_libs: ["libc++_static", ...],
header_libs: ["libbase_headers", ...],
binaries: ["sh.vendor", ...],
objects: ["crtbegin_so", ...],
},
arm64: {
...
},
...
},
}
As shared/static/header/binary/object snapshots may differ among
archtecture, they will be placed under arch properties.
Bug: 177098205
Test: run script and see results
Change-Id: I774f4a6394c0a8552be6822a9592c6511a849160
After you run a build that uses the full (or any) vendor
snapshot, you can use ninja to determine which files in
the vendor snapshot contribute to a given goal, which is
generally a subset of the content of a full vendor
snapshot. This information can be fed back to the
snapshot generation process to tailor the snapshot
generation towards its expected usage.
Bug: 157967325
Test: manual test
Change-Id: I0c886d130633e2ba84e9d89ae60c1faaaf9be1c4
(cherry picked from commit 57ef5d0c6a4e8e50ee9248234da69ab810a21886)
In cases where not all the variants of a library are
included in the generated vendor snapshot, be sure to
include the module name in the props so that it can be
factored out later.
Conversely, be sure to compute the notice filename from
the de-sanitized module name so so that it can also be
factored out later.
Bug: 171413810
Bug: 157967325
Test: Verify that full snapshot Android.bp unchanged.
Test: Verify correct syntax for filtered snapshot.
Change-Id: I5725e17b19907d6a5063823e8b99bd0517c7c144
Split gen_bp_files for future use of new build_props
function. Sort the data output to the Android.bp file so
that the script does not depend on the sort of the keys
in the various dictionaries.
Bug: 157967325
Test: verify that vendor snapshot content is identical
Test: verify Android.bp is sorted by arch, variation, name
Change-Id: I438f8611ad460bccfcae99441ad7c60aa3b68c49
This is useful for using the results of a local build without having to unzip
the vendor snapshot file.
Test: Passing the --symlink from other scripts and verifying the symlinks.
Change-Id: I0468c965cda99bfb0799431cc00e40a2c67d490b
This is useful for calling update.py from other scripts.
Test: Calls 'update.py --overwrite' with an existing install-dir.
Change-Id: Idc43afbf3e80150b589630dea28004726dccf808
1. It unzips artifacts and installs Android.bp at once.
No need to manually unzip artifacts and then run the script. Users can
just give dist directory to automatically unzip and install Android.bp.
$ python3 update.py --local /some/android/tree/out/dist --install-dir \
> vendor/<vendor_name>/vendor_snapshot/v30 -vvv 30
2. The vendor snapshot can be fetched from the build server.
Just like VNDK snapshot.
$ python3 update.py --branch {some_branch} --build {some_build_id} \
> --target {target_which_produces_vendor_snapshot} --install-dir \
> vendor/<vendor_name>/vendor_snapshot/v30 -vvv 30
3. The install directory can be specified manually, replacing fixed
directory "prebuilts/vendor/v<VERSION>".
prebuilts/vendor/v<VERSION> was randomly picked when implementing the
draft version of this script. Now it can be installed anywhere.
Bug: 154777533
Test: manual test
Change-Id: I3870a85864a9a775b1091419b28ed0e2ab781609
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: I5b36a1078399a3ca402eb302b4d1156bcb0dda4b
Some executable binaries have both 32-bit and 64-bit outputs, and
sometimes both variants are needed to be installed. One good example is
boringssl_self_test. This CL assigns compile_multilib to support such
cases.
Bug: 157106227
Test: install vendor snapshot
Change-Id: I016265e7234a59ac480c47a1df2035f4ef7ed89f
This script installs Android.bp under prebuilts/vendor/v{version}. This
script only supports basic operations, so artifacts from "m dist
vendor-snapshot" must be unzipped under the directory before running
this script; features including automatic un-zipping, fetching artifacts
from server, etc. are to be supported in later versions.
Bug: 65377115
Test: m dist vendor-snapshot && run update.py
Change-Id: I1e0ae6a7d2b9bc991694943bd44b84a0dc3c9f30