Commit Graph

8 Commits

Author SHA1 Message Date
Bill Peckham
3bdbd34b9a Include 'name' in props; use post-sanitize module name.
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
2020-10-21 15:49:54 -07:00
Bill Peckham
a2a29342aa Split gen_bp_files, make Android.bp idempotent.
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
2020-10-05 16:22:12 -07:00
Jose Galmes
00977668bf Use symlinks instead of unzipping vendor snapshot zip files.
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
2020-09-24 20:35:49 -07:00
Daniel Norman
552d49a3c1 Adds an --overwrite flag to always overwrite install dir.
This is useful for calling update.py from other scripts.

Test: Calls 'update.py --overwrite' with an existing install-dir.
Change-Id: Idc43afbf3e80150b589630dea28004726dccf808
2020-08-19 15:01:37 -07:00
Inseob Kim
ad01dffacb Implement more features to vendor snapshot script
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
2020-08-14 16:24:54 +09:00
Inseob Kim
09082f5d02 Add cfi static libraries to vendor snapshot
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
2020-08-06 19:47:22 +00:00
Inseob Kim
6b68541022 Assign compile_multilib for executable snapshots
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
2020-06-11 15:07:33 +09:00
Inseob Kim
7295caa166 Add script to install vendor snapshot
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
2020-01-31 13:44:38 +09:00