Commit graph

65 commits

Author SHA1 Message Date
Colin Cross
56a8321c21 Remove global state from apex modules
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
2020-10-06 13:39:57 -07:00
Jooyung Han
0703fd873f apex: support prebuilt_firmware for vendor apexes
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
2020-09-01 10:45:13 +09:00
Colin Cross
6e511a9a9f Add libraryDependencyTag to track dependencies on static and shared libraries
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
2020-07-29 13:22:30 -07:00
Yo Chiang
08fac0c25f Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 161896447
Test: TH
Change-Id: I9bb7178518c3f9dec0fe0a6dbd8d1a8e19a6b495
2020-07-29 01:10:11 +08:00
Kiyoung Kim
b0aa8515b9 Deprecate VNDK-Lite
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
2020-07-20 05:46:11 +00:00
Yo Chiang
bba545e039 VNDK listing contains device modules only
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
2020-06-09 22:10:53 +08:00
Jaewoong Jung
4b79e98a6e Soong package structure refactoring
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
2020-06-01 13:44:48 -07:00
Jiyong Park
2478e4e98f Revert "Revert "Allow libz to have stub even though it's not an ..."
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
2020-05-19 10:04:55 +00:00
Jiyong Park
f133c18a00 Revert "Allow libz to have stub even though it's not an LLNDK li..."
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
2020-05-18 09:26:30 +00:00
Jiyong Park
844c3a031d Allow libz to have stub even though it's not an LLNDK library
Bug: 155456180
Test: m
Change-Id: I26417bb78a0d585eefc852c2aa118bfd71b5748b
2020-05-15 16:30:41 +09:00
Treehugger Robot
624dec0b03 Merge "Don't allow a lib having stubs to become a member of VNDK" 2020-04-13 04:05:31 +00:00
Jooyung Han
73d20d086d Build VNDK APEX for VNDK-Lite
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
2020-04-09 23:27:25 +00:00
Jiyong Park
ea97f51a29 Don't allow a lib having stubs to become a member of VNDK
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
2020-04-03 05:57:38 +00:00
Jooyung Han
61b66e9b34 Revert "Revert "Enforce min_sdk_version of apex(use_vendor:true)""
This reverts commit bacf34d986.

Reason for revert: reland with fix

Change-Id: Ia03f2808353f5640597ae7ecbf2e06fc903c6977
2020-03-21 23:23:14 +09:00
Jooyung Han
bacf34d986 Revert "Enforce min_sdk_version of apex(use_vendor:true)"
This reverts commit 380fc3615c.

Reason for revert: breaking one of internal targets

Change-Id: Ica96c44078e5a7f674410828af3ba851317775dd

Exempt-From-Owner-Approval: revert to fix build failure
2020-03-21 13:59:12 +00:00
Jooyung Han
380fc3615c Enforce min_sdk_version of apex(use_vendor:true)
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
2020-03-17 15:36:39 +09:00
Inseob Kim
eda2e9c728 Capture snapshot headers in parallel
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
2020-03-04 23:39:42 +09:00
Bob Badour
a75b057e17 Unless overridden include LICENSE files in notices.
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
2020-02-21 20:40:43 +00:00
Inseob Kim
8471cdaced Implement vendor snapshot
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
2020-02-07 02:58:29 +09:00
Jooyung Han
a57af4adc0 Revert "Revert "apex_vndk uses vendor variants only""
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
2020-01-23 14:48:29 +09:00
Jooyung Han
5df3b11f78 Revert "apex_vndk uses vendor variants only"
This reverts commit 559ad01db9.

Reason for revert: broken builds

Change-Id: Ia8a09a2bdbdc8e76f2d4b9eb54e36ccc544e9397
Bug: b/148181875
2020-01-23 05:31:05 +00:00
Jooyung Han
559ad01db9 apex_vndk uses vendor variants only
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.
2020-01-23 04:46:53 +00:00
Kiyoung Kim
e1aa8ea34e Detach VNDK using core library list from VNDK APEX
Some devices require VNDK using core library list, but this is dependent
to system image rather than VNDK version. This change removes VNDK using
core variant library list file from VNDK APEX, and also remove VNDK
version from its filename.

Bug: 142599349
Test: m -j passed && aosp_cf_x86_go_phone booted
Change-Id: Ibc53b8dfc9d38e14bbaa878154034d25a6d34089
2019-12-30 14:29:52 +09:00
Justin Yun
5f7f7e8a39 Create product variant for product partition
When PRODUCT_PRODUCT_VNDK_VERSION is set to 'current', product
modules are enforced to use only VNDK libs from the system partition
as BOARD_VNDK_VERSION does to vendor partition.

Modules with 'vendor_available: true' create product variant as well
as core and vendor variants. The product variant as an image variant
is used for the modules in /product or /system/product.

It must not affect the current build behavior without
PRODUCT_PRODUCT_VNDK_VERSION set.

Bug: 134099726
Bug: 138966004
Bug: 144534640
Test: build without PRODUCT_PRODUCT_VNDK_VERSION set
Change-Id: I4d3585c110d84493e45bf76d550dc240bb26137f
2019-12-20 17:56:08 +09:00
Jiyong Park
0b0e1b9804 AndroidMkEntries() returns multiple AndroidMkEntries structs
AndroidMkEntries now returns multiple AndroidMkEntires so that a module
can emit multiple Make modules if needed.

Bug: 128708192
Test: m

Change-Id: I56b6f76d22943b80329951c5acb80a1b932441ad
2019-12-11 17:25:27 +09:00
Inseob Kim
d110f878a7 Fix generated headers of snapshot
For VNDK snapshot and SDK snapshot, deps files have been used to capture
generated headers. But exported deps might contain intermediate phony
files instead of actual header files, which are for optimization of
ninja. To correctly capture all headers, exported generated header files
are gathered separately.

Bug: 65377115
Test: m nothing
Change-Id: Ia03fa69186490a818578190e3c0bfb0261d1fd6e
2019-12-09 12:38:34 +09:00
Jooyung Han
39edb6c6c1 VNDK APEX contains related *.libraries.txt files
These files were highly coupled with vndk version, so having them inside
the corresponding VNDK APEX is reasonable.

These files are used by linkerconfig and libnativeloader. In the future,
they reference these files from and VNDK APEX.

Bug: 141450808
Test: m com.android.vndk.current
Change-Id: I055a979d2636ddd8844a0afff81f6ba441f7965e
2019-11-07 16:47:38 +09:00
Jooyung Han
2216fb1f51 Make vndk*.libraries.txt as soong modules
Migrating from Make to Soong.

These files are generated by singleton and had to be defined as PREBUILT
modules in Make (system/core/rootdir/Android.mk)

Now, they are converted as soong modules.

To make things easier, a special kind of module 'vndk_libraries_txt' is
added which works like prebuilt_etc but its src file is generated by
soong.

Bug: 141450808
Test: m llndk.libraries.txt
Change-Id: Ia77e6af73f760fcd77020218c5bc37892b2cda1f
2019-11-07 15:12:03 +09:00
Inseob Kim
242ef0c4de Fix and generate vndk snapshot entirely in Soong
- VNDK snapshot now respects stem and suffix.
- ld.config.txt is removed from snapshot as linkerconfig has become default.
- Soong builds entire snapshot, and make just calls dist-for-goals.

Bug: 142589718
Test: build and install snapshot
Test: development/vndk/snapshot/update.py with past version of snapshot
Change-Id: Id1ed658c22bb2e41c0ee50d1fe2a97924a76d7dc
2019-11-04 17:03:25 +09:00
Treehugger Robot
1f056cd69d Merge "delete redundant code" 2019-11-01 18:15:33 +00:00
Jooyung Han
a463f720aa delete redundant code
no need to use separate test-only key for config.Once().

Test: m
Change-Id: I9e05d413504114df8f8ea8d9ef521db1d5da5d01
2019-11-01 09:00:11 +09:00
Jooyung Han
0302a84ddc Soong generates vndk-related .libraries.txt files
This is a follow-up CL of I9a24f6975bd4b226a94f61a13d43857dcdce6b88

Generated files are passed to make via MakeVars:
- SOONG_LLNDK_LIBRARIES_FILE
- SOONG_VNDKCORE_LIBRARIES_FILE
- SOONG_VNDKSP_LIBRARIES_FILE
- SOONG_VNDKPRIVATE_LIBRARIES_FILE
- SOONG_VNDKCOREVARIANT_LIBRARIES_FILE
- SOONG_VNDK_LIBRARIES_FILE

Previously filenames were "guessed" from module names. Now VndkMutator
stores filenames as well and generate those files with them.

Bug: 142963962
Bug: 141450808
Test: m && device boots && TH
Change-Id: I0c248b707188f904df60ead50059fefe90bfd17f
2019-11-01 04:35:21 +09:00
Jooyung Han
87a7f3064f Fix apex_vndk with TARGET_VNDK_USE_CORE_VARIANT
When TARGET_VNDK_USE_CORE_VARIANT is set, vndk apex should have only
- vndk sp libraries
- vndk core libraries which are marked as "must use vendor variant"

Previously, vndk sp libs are discarded when TARGET_VNDK_USE_CORE_VARIANT
is set.

Bug: 143374795
Bug: 139772411
Test: TARGET_VNDK_USE_CORE_VARIANT=true m com.android.vndk.current
      see if vndk sp lib(e.g. libunwindstakc) is included.

Change-Id: Iae218fff5c354eb874839a1f71be30633fb8a9ab
2019-10-30 09:04:13 +09:00
Ivan Lozano
52767be335 Add support for Rust C libraries.
Adds the ability for rust modules to be compiled as C libraries, and
allows cc modules to depend on these rust-generated modules. This also
means that soong-rust should not have any dependencies on soong-cc aside
from what's required for testing.

There's a couple small fixes included as well:

 - A bug in libNameFromFilePath that caused issues when library's had
 "lib" in their name.
 - VariantName is removed from rust library MutatedProperties since this
 was unused.

Bug: 140726209
Test: Soong tests pass.
Test: Example cc_binary can include a rust shared library as a dep.
Test: m crosvm.experimental
Change-Id: Ia7deed1345d2423001089014cc65ce7934123da4
2019-10-28 22:09:01 -07:00
Ivan Lozano
183a3218e2 Add a common interface for cc linkable libraries.
Adds an interface, CcLinkableInterface, for cc linkable dependencies
which come from other toolchains such as Rust.

Bug: 140726209
Test: Soong tests pass, rust modules still compile.
Change-Id: I7378a46fad94fd0b735746aaf4e265fd2c2c04d8
2019-10-28 13:45:12 -07:00
Jooyung Han
6db2f177db Partial reverts of vndk-apex
This installs vndk libs under system/lib/vndk
instead of vndk-apex.
(Partial reverts of 31c470b5d5)

Also fixes the bug 097087be53 brought.
This produced incomplete list of vndkcorevariant.libraries.txt.

Bug: 143374795
Test: m && boot
Change-Id: I17864de4770a84431756e0c3765b601d3dc2abb1
2019-10-28 14:12:48 +09:00
Treehugger Robot
b480debbd8 Merge "Change exportedDirs and exportedSystemDirs from []string to android.Paths" 2019-10-28 02:24:41 +00:00
Treehugger Robot
7d6b21c265 Merge "Soong generates libraries.txt files for vndk" 2019-10-26 01:52:39 +00:00
Jooyung Han
097087be53 Soong generates libraries.txt files for vndk
These files were generated by Make. This is an effort to converting make
to soong.

These files are created under a known location: $SOONG_OUT_DIR/vndk
- llndk.libraries.txt
- vndksp.libraries.txt
- vndkcore.libraries.txt
- vndkprivate.libraries.txt
- vndkcorevariant.libraries.txt
- vndk.libraries.txt: merged all of above with tags

The last one is used by 'check-vndk-list'.
(See the topic)

Others will be packaged by VNDK APEX of current VNDK.
(This is not merged yet. After landing, a follow-up CL will be
followed.)

Bug: 141019581
Bug: 141450808
Test: m check-vndk-list
Change-Id: I9a24f6975bd4b226a94f61a13d43857dcdce6b88
2019-10-25 14:08:28 +09:00
Jiyong Park
7495504db4 Change exportedDirs and exportedSystemDirs from []string to android.Paths
exportedDirs and exportedSystemDirs are now changed to android.Paths so
that we can later manipulate the paths via Rel(), etc.

Test: m

Change-Id: I6fb02ea4983bcebac351bc284f75b44885379e8f
2019-10-25 09:52:08 +09:00
Jooyung Han
31c470b5d5 Revert "Revert "Supports VNDK APEX with different versions""
This reverts commit 48dd4b5ea4.

Bug: 141451661
Bug: 139772411
Test: m (soong tests)
Test: boot with aosp_arm64 system image on Q vendor device
2019-10-19 02:28:39 +09:00
Jooyung Han
48dd4b5ea4 Revert "Supports VNDK APEX with different versions"
This reverts commit 394951da73.

Reason for revert: some targets are broken

Bug: 142773030
Change-Id: I4ce2e4a4c683c71958bc4f73e45a5ddd4a4ae32a
2019-10-16 23:50:39 +00:00
Jooyung Han
394951da73 Supports VNDK APEX with different versions
Older VNDK libraries are provided as vndk_prebuilt_shared modules. Those
are added to corresponding VNDK APEX as dependencies.

With VNDK APEX installed, VNDK libs are unnecessary. By the way, since
there can be vendor modules which depend on VNDK libs, Make targets are
still emitted with UNINSTALLABLE=true.

Android.mk has additional modules for vndk libraries which are named
with apex name as suffices. For example, if libfoo is a vndk library,
then libfoo.vendor is its vendor variant and it would be in
/system/lib/vndk. But with vndk apex, it has additional
libfoo.com.android.vndk.current variant.

Bug: 141451661
Bug: 139772411
Test: m (soong tests)
Test: boot with aosp_arm64 system image on Q vendor device
Change-Id: I269c28a4d4c4e2f1518bd51df558438fe5316774
2019-10-15 07:33:49 +09:00
Inseob Kim
64c4395386 Add version to vendor variants
Vendor variant is now divided into several vendor.{version} variants,
depending on their intended usages:

vendor.{BOARD_VNDK_VERSION}: vendor and vendor_available modules
vendor.{PLATFORM_VNDK_VERSION}: VNDK modules in the source tree
vendor.{snapshot_ver}: VNDK snapshot modules

This also affects exported module names from Soong to Make. But to
maintain backward compatibility, ".{BOARD_VNDK_VERSION}" suffix will not
be emitted for modules having version BOARD_VNDK_VERSION, so that vendor
modules still can be referred as-is.

Bug: 65377115
Bug: 68123344
Test: clean build and boot blueline
Change-Id: Ib9016a0f1fe06b97e9423fd95142653a89a343fa
2019-09-18 10:53:30 +09:00
Justin Yun
7390ea3d79 Skip native_bridge modules when listing VNDK libs
native_bridge modules cannot be VNDK modules at the same time.

Bug: 137709824
Test: build cf_x86_64_phone
      check if llndk.libraries.*.txt has libclang_rt.asan for arm

Change-Id: I974e89b9da522e26531a576015e98dc54834282d
2019-09-08 11:34:06 +09:00
Inseob Kim
ae55303f36 Include headers and props to VNDK snapshot
For all vndk snapshot libraries, header files exported by the libraries
will be included to the snapshot. Android.bp will contain necessary
information to link against/install vndk snapshot libraires:
export_include_dirs, export_system_include_dirs, export_flags, and
relative_install_path.

Bug: 132818174
Test: 1) m nothing && mv out/soong/build.ninja /tmp && m nothing &&
         diff -u -u out/soong/build.ninja /tmp/build.ninja
Test: 2) VNDK_SNAPSHOT_BUILD_ARTIFACTS=true \
           development/vndk/snapshot/build.sh
Test: 3) development/vndk/snasphot/update.py
Test: 4) see contents of Android.bp and include directories
Change-Id: I791ab181545eb483242b04446afd40958bbb2b17
2019-08-08 18:45:59 +09:00
Roland Levillain
dfe75b389c Fix some typos in Soong.
Test: m
Change-Id: I5b332ce12d70f13eca93b23060620c0ea4f46db7
2019-07-23 17:29:57 +01:00
Colin Cross
4c2c46f0a7 Fix nondeterminstic iteration of vndk modules map
Sort the list of libraries when iterating over the vndk modules
map to avoid a non-deterministic output file.

Test: m nothing && mv out/soong/build.ninja /tmp && m nothing && diff -u out/soong/build.ninja /tmp/build.ninja
Change-Id: I889736715dab491bb7e69f3499ab1a5e2c876171
2019-06-03 15:52:27 -07:00
Dimitry Ivanov
656833e0c8 Merge "Skip native_bridge modules when installing vndk snapshot" 2019-05-31 12:51:55 +00:00
dimitry
51ea18a437 Skip native_bridge modules when installing vndk snapshot
Do not install natively bridged libraries as part of vndk snapshot.

Bug: http://b/77159578
Test: Enable 4arch build -> make
Change-Id: I519ef92ca356ee6438abb3c85fa639af2170c2ef
2019-05-23 13:35:13 +02:00