Commit graph

1243 commits

Author SHA1 Message Date
Jooyung Han
11b0fbdbf6 cc: fix version macro for stubs
When a cc module is built against a stub, compiler passes version macro
of the stub lib. Version macro should be numeric, so codenames or
"current" should be mapped to numbers just like how ndkstubgen maps to.

* "current" -> future (10000)
* codenames -> look up api_level.json
* otherwise -> cast to int

Bug: 179329813
Test: m / soong test / manually check the output build.ninja
Change-Id: Ic0e1dd904984e161694a0b77fad5559c06a4462f
2021-02-05 11:27:57 +09:00
Dario Freni
3627f8350d Add no_op binary.
Even if this binary is only used in a testing apex for dynamic common
library apex that will be removed once we have a production version
ready, we need said apex to be marked as updatable too.

Bug: 177879489
Bug: 179013728
Test: builds
Change-Id: I8ae519da164f1f5355d4c2dfeca88a497cda7990
(cherry picked from commit 0d3ff6d918)
2021-02-03 10:34:13 +00:00
Paul Duffin
5bbfef8718 Fix some minor issues with boot_image
Mistakenly used HostAndDeviceDefault (which builds host and device
variants by default) instead of HostAndDeviceSupported which only
builds a device variant by default.

Moved the test definitions of art and framework boot images from being
defined in all Java related tests into the test where they belong. This
is needed in order to improve the ART and framework boot image specific
testing.

Bug: 177892522
Test: m droid
Change-Id: I16771f09bd789033e18c58ae6dd4b6b9e865d831
2021-01-30 12:57:26 +00:00
Paul Duffin
a1d6025a49 Add boot_images to apex
Previously, the apex module had to hard code behavior specific to the
art apex module in order to include the art boot image. This change
adds support to the apex module to allow the boot images to be
specified per apex.

In combination with a change to add the "art-boot-image" to the ART
apex this allows the custom code for handling the art boot image in
apex to be removed.

That custom apex code also included the logic to ensure that the
GlobalSoongConfig was initialized for use by the dex_bootjars
singleton. That logic has been moved from the APEX to the boot_image
module. That ensures that it will be run if and only if a boot_image
module is present in the checked out repos. So, limited manifest
checkouts which do not contain the art or frameworks/base repos (which
is where the boot_image modules are defined) will not attempt to run
this logic, which would fail because dex2oat would not be present.

Bug: 177892522
Test: m droid
Change-Id: I02d25fbef6e864e31eb5e0f4eb50358c79486db0
2021-01-30 12:45:07 +00:00
Martin Stjernholm
c4e17317d1 Merge "Fix boot jar handling when both source and prebuilt APEXes and modules are present." 2021-01-29 13:15:02 +00:00
Nikita Ioffe
82aab58aea Turn apex compression from opt-out into opt-in
Compression is useful only for big enough apexes. We can manually opt-in
them, instead of trying to find list of apexes that should be opted-out.

Test: m
Bug: 178713634
Change-Id: Ice86fabb7c1db4a1e21e4c983d595cfd3a1c0b7a
2021-01-28 20:25:23 +00:00
Martin Stjernholm
1dc0d6d7f2 Fix boot jar handling when both source and prebuilt APEXes and modules
are present.

1) The boot jar to APEX mapping is maintained by the base names for
both of them. When building with prebuilt modules and APEXes, that
means we need to take care to compare them without regard to any
"prebuilt_" prefixes.

2) VisitAllModules can visit disabled modules and both source and
prebuilt modules, so they need some conditions to skip modules that
aren't applicable for boot jars.

Test: `m droid`
Test: `m droid SOONG_CONFIG_art_module_source_build=false`
  with fresh ART Module prebuilts in place
Bug: 171061220
Change-Id: Iced269d29127bc8b8f9b3171adb60a97d115628b
2021-01-28 20:09:24 +00:00
Paul Duffin
b9d731c8a9 Merge "Add boot_image module type" 2021-01-28 15:39:57 +00:00
Treehugger Robot
99afe0d442 Merge "apex: checks min_sdk_version for preview/current" 2021-01-28 13:04:52 +00:00
Paul Duffin
57eec1007e Merge "Make com.android.art related tests more realistic" 2021-01-27 10:03:42 +00:00
Treehugger Robot
fcf2da0b29 Merge "update apex allowed deps-2" 2021-01-27 01:06:48 +00:00
Jeongik Cha
40c6ae759d update apex allowed deps-2
an aidl module should specify its version. because of that some deps
which have version on its name is added.

Bug: 150578172
Test: m
Change-Id: If5c5d66e59f33ecf37d118b2b80db820ec78ea04
2021-01-26 23:05:42 +09:00
Paul Duffin
3451e1600f Add boot_image module type
Adds a boot_image module type. Follow on changes will add instances of
boot_image to represent the ART and framework boot images in the art
and frameworks/base repositories respectively.

For the moment they retrieve their associated boot image configuration
from the map returned by genBootImageConfigs() and leave the actual
work of creating the ninja rules to create the boot images to the
dex_bootjars singleton.

Bug: 177892522
Test: m droid
Change-Id: Ib69701de0d24d996bb8e8be7a20b941be907390e
2021-01-26 13:00:07 +00:00
Paul Duffin
d376f7925a Make com.android.art related tests more realistic
Previously, some tests used "com.android.art.something" as the name of
the APEX containing the ART boot jars but that is not the valid name
for an ART APEX. This change switches that to "com.android.art.debug".

Bug: 171061220
Test: m nothing
Change-Id: I057edc58ae81cdb14076a2d7d117ca1764aa3e52
2021-01-26 12:35:08 +00:00
Paul Duffin
092153de15 Fix problems with TestPrebuiltExportDexImplementationJars
Previously, the test mistakenly configured BootJars which meant the
test was testing not just the propagation of paths to files retrieved
from the prebuilt apex to the java_import module but also the process
of finding appropriate boot jars.

It also set "prefer: true" on the prebuilt_apex instead of the
java_import when checking to make sure that it still found the correct
module when both prebuilt and source were available and the prebuilt
was preferred.

Bug: 171061220
Test: m nothing
Change-Id: I4f2fa7ea372b14d4b169cdc78bdeb1ca4ac4dff8
2021-01-26 12:35:08 +00:00
Paul Duffin
4c183c7581 Merge "Make dexpreopt tools available for all java tests" 2021-01-26 12:08:30 +00:00
Jooyung Han
ed124c308f apex: checks min_sdk_version for preview/current
If we don't check "current", it won't be checked even in the finalized
branch.

If we don't check "preview", it should be done during the SDK
finalization. It'd be better done before the SDK finalization regarding
that setting min_sdk_version is to get approval from deps library owners.

Bug: 177833148
Test: m (soong tests)
Change-Id: I712b61cfe5a134fbb69c73956d26fb3a1e5c011e
2021-01-26 12:09:07 +09:00
Jeongik Cha
0056b99972 update apex allowed deps
an aidl module should specify its version. because of that some deps
which have version on its name is added.

Bug: 150578172
Test: m
Change-Id: I4fe33974190765615069d0ba894e5ab4dcc3064f
Merged-In: I4fe33974190765615069d0ba894e5ab4dcc3064f
2021-01-26 09:59:34 +09:00
Sophie Zheng
9b6596bb60 Merge "Revert "Revert "Automated NDK API coverage used by Mainline modules build integration.""" 2021-01-26 00:13:46 +00:00
sophiez
6bde0b5f9d Revert "Revert "Automated NDK API coverage used by Mainline modules build integration.""
This reverts commit 556b2ad77e.

Original change-id: Ib1b2f0dd2f9ae85b1545c6cc5bb4c5bbdfac1c15

Reason for revert: Add excutable permission to the gen_ndk_backedby_apex.sh.

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only

Change-Id: Ib587ba200cd7f2f61d478452b43c329d72b2de06
2021-01-25 19:52:10 +00:00
Paul Duffin
635aa0834f Make dexpreopt tools available for all java tests
Bug: 177892522
Test: m nothing
Change-Id: I594bddae692ef76dc8c3da504934d0151b13d4c9
2021-01-25 19:15:19 +00:00
Riddle Hsu
f17b07fc52 Merge "Revert "Automated NDK API coverage used by Mainline modules build integration."" 2021-01-25 06:15:29 +00:00
Riddle Hsu
556b2ad77e Revert "Automated NDK API coverage used by Mainline modules build integration."
This reverts commit 87ff51db84.

Reason for revert: build breakage b/178327796

Change-Id: I51c56938540794097eda579ebe47fa5c0a4d8c12
2021-01-25 01:44:34 +00:00
Sophie Zheng
0bf77198b5 Merge "Automated NDK API coverage used by Mainline modules build integration." 2021-01-22 22:15:21 +00:00
Paul Duffin
8479ea296d Merge "Allow createGlobalSoongConfig() to be used from tests" 2021-01-22 17:42:00 +00:00
Paul Duffin
c44075b710 Merge "Add java.RegisterRequiredBuildComponentsForTest function" 2021-01-22 17:41:02 +00:00
Hai Zhang
496baeec09 Add new dependencies for moving role into module.
Bug: 173606718
Test: build
Test: manually verify role related functionality works
Change-Id: Iba390110453a8e4e24df554901ceadfb2e94ee2a
2021-01-22 11:42:00 +00:00
Hai Zhang
6ff02b2d00 Add framework-permission-s java_sdk_library.
This will host the moved framework classes for role.

Bug: 158736025
Test: build
Change-Id: I567bc46dda319b82e4c165ad89e1636e339f1753
2021-01-22 11:35:49 +00:00
sophiez
87ff51db84 Automated NDK API coverage used by Mainline modules build integration.
Add gen_ndk_usedby_apex.sh script to generate NDK API list used by Mainlain modules when modules get build.

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only

Change-Id: Ib1b2f0dd2f9ae85b1545c6cc5bb4c5bbdfac1c15
2021-01-21 18:08:50 +00:00
Paul Duffin
9f04524673 Allow createGlobalSoongConfig() to be used from tests
Previously, the createGlobalSoongConfig() function was explicitly
prevented from being used in tests because it would fail. However, it
turns out that is no longer the case and it does now work.

That allows the following changes to be made:
* Tests no longer need to use GlobalSoongConfigForTests() to
  prepopulate the cache.
* GlobalSoongConfigForTests() is only needed in the dexpreopt
  package.

Bug: 177892522
Test: m nothing
Change-Id: Ifcbb1a44254c5d2d10c1d02ab23227488d1d1ed1
2021-01-21 15:44:30 +00:00
Hyundo Moon
2b7d4e1ba4 Merge "Allow service-media-s in apex" 2021-01-21 15:00:13 +00:00
Treehugger Robot
d684e04247 Merge "LOCAL_REQUIRED_MODULES from apex has ":32" or ":64" suffix" 2021-01-21 14:34:37 +00:00
Paul Duffin
c059c8c9a0 Add java.RegisterRequiredBuildComponentsForTest function
Insulate tests that exercise code in the java package from having to
register the build components provided by the java package by providing
a single function that registers them all. This follows the pattern
currently used in the cc and rust packages.

This change is in preparation for switching the dex_bootjars singleton
from a singleton, which does not require a module definition in order
to be instantiated, to a singleton module which does. That will require
adding a module definition into java.GatherRequiredDepsForTest() and
this change ensures that the required components will have been
registered in every test.

Bug: 177892522
Test: m nothing
Change-Id: I6475db8240894947dd07c89a940a3e4f201aa598
2021-01-21 11:47:32 +00:00
Hyundo Moon
8bee1b00ea Allow service-media-s in apex
Bug: 175511943
Test: Builds successfully
Change-Id: I5d76087d3c537205e8b8ca837c13ca1aeb641b4c
2021-01-21 02:21:23 +00:00
Ulyana Trafimovich
0caabb6e27 Merge "Support building boot images with disabled dexpreopt." 2021-01-20 17:46:02 +00:00
Bill Peckham
1c8e5e817e Merge changes from topic "prebuilt-hiddenapi"
* changes:
  Supply LOCAL_SOONG_DEX_JAR for java_import with compile_dex.
  Enable an apex to include a java_import.
  Enable prebuilt hiddenapi CSV files.
2021-01-20 17:43:48 +00:00
Mohammad Islam
43c2fe1620 Merge "Fix capex build rule when building using RBE" 2021-01-20 14:21:17 +00:00
Ulya Trafimovich
a4a1c4ee98 Support building boot images with disabled dexpreopt.
Bug: 176171716
Test: build_mainline_modules.sh and ensure that the ART boot image is
    built: `find out -type f -name '*.art'` is nonempty for every arch.
Change-Id: Ibc45581eef2b205c750a30709780cf659ba7cfa1
2021-01-20 14:03:07 +00:00
Jiyong Park
57621b29c4 LOCAL_REQUIRED_MODULES from apex has ":32" or ":64" suffix
Currently, when a module is included in an APEX, the dependencies of the
modules are listed in LOCAL_REQUIRED_MODULES of the APEX. There are two
purposes for this:

1) for native dependencies, they are installed to
$(TARGET_OUT)/apex/<apexname> directories which isn't packaged as an
*.img. However, as a side effect of the installation, their symbol files
are placed under $(TARGET_OUT)/symbols directory to aid debugging.

2) to implement the symlink optimization. When the APEX is not
updatable, the dependencies are not included inside the APEX, but
installed directly to /system partition because the same files might be
used outside of the APEX. The files in the APEX are replaced with
symlinks to the system copy.

So far, the module name like "libfoo" was directly used in
LOCAL_REQUIRED_MODULES. This becomes problematic when only a single arch
variant of the module is used by the APEX. The build system will install
both arch variants to the system partition.

This change fixes the problem by appending ":32" or ":64" suffix
when composing LOCAL_REQUIRED_MODULES.

Bug: N/A
Test: m
Test: Cherry-pick I285c5d1bb9b27265c8589f2588d95eafa324d412 and its
dependencies from internal master. `m nothing` doesn't show the artifact
path requirement error.

Change-Id: I78feae1d5b18f93b0f984d3b1558812fd1689a96
2021-01-20 20:44:35 +09:00
Ryan Prichard
809eac3057 Merge "Switch platform EH unwinder to prebuilt LLVM libunwind" 2021-01-20 00:10:59 +00:00
Bill Peckham
a41a6963b4 Enable an apex to include a java_import.
With the addition of the compile_dex property to the
java_import module it becomes possible to include a
java_import module in an apex. This change allows the
dependency and adds a test.

Bug: 177228901
Test: m nothing
Test: new TestApexWithJavaImport
Change-Id: I9336dade1857109e2fd21f7d57e1dc4abc4a402c
2021-01-19 18:15:03 +00:00
Mohammad Samiul Islam
9ac0e32979 Fix capex build rule when building using RBE
Presubmit builds were failing cause they were being built using RBE.

Bug: 172911362
Test: presubmit-builds are passing now
Change-Id: I65ffd912ccf2f4fb8cb9824e7a9579f66908d7b3
2021-01-19 11:32:29 +00:00
Paul Duffin
064b70c918 Export dex implementation jars from prebuilt_apex
Dexpreopt and boot jars package check all require access to dex
implementation jars created for java_library and java_sdk_library. They
were available when building from source but not when building from
prebuilts, even though they are embedded within the .apex files that
are referenced from prebuilt_apex.

This changes adds support to prebuilt_apex to export the dex
implementation jars and updates java_import to use those exported dex
implementation jars.

In a source build dexpreopt/boot jars package check access the apex (or
platform) specific variant of a java_library, e.g. core-oj, from which
it retrieves the dex implementation jar path.

After this change in a prebuilt build dexpreopt/boot jars package check
behave in the same way except in this case they retrieve the dex
implementation jar path from the apex (or platform) specific variant of
the java_import, e.g. core-oj.

The work to export files from a `.apex` file for use by other modules
is performed by a new `deapexer` module type. It is not used directly
in an `Android.bp` file but instead is created implicitly by
`prebuilt_apex`,

In order to do that this contains the following changes:
* Adds a new `dexapexer` module type to handle the exporting of files
  from the `.apex` file.
* Adds an exported_java_libs property to prebuilt_apex to specify the
  set of libraries whose dex implementation jars need exporting.
* Creates apex specific variants of the libraries listed in the
  exported_java_libs property.
* Adds the set of exported files to the ApexInfo to make them available
  to the apex specific variants.
* Prevents the prebuilt_apex variants from being merged together as
  they will not be compatible.
* Modifies java_import to use the exported file for variants of a
  prebuilt_apex.
* Adds a ninja rule to unpack (using deapexer) the contents of the
  prebuilt_apex's apex file, verify that the required files are present
  and make them available as outputs for other rules to use.
* Some minor refactorings to support these changes.
* Adds tests to cover prebuilt only, prebuilt with source preferred,
  and prebuilt preferred with source.

Test: m nothing
Bug: 171061220
Change-Id: Ic9bed81fb65b92f0d59f64c0bce168a9ed44cfac
2021-01-15 18:14:10 +00:00
Treehugger Robot
2463ec5ad5 Merge "Update apex/allowed_deps.txt" 2021-01-14 11:35:06 +00:00
Paul Duffin
4746ae400c Merge "Extract ApexFileProperties from apex PrebuiltProperties" 2021-01-14 11:07:16 +00:00
Mill Chen
797e067b1c Update apex/allowed_deps.txt
Import intermediate-AndroidX Design Library from local Maven ZIP.

Bug: 177216791
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: Iffdf5e03f76fa5583a751d048ccb85b69c091de2
Merged-In: Iffdf5e03f76fa5583a751d048ccb85b69c091de2
2021-01-14 17:57:05 +08:00
Maciej Żenczykowski
47dbd2619b Merge "Add bpf_syscall_wrappers for tethering apex and update allowed-deps.txt" 2021-01-14 07:36:50 +00:00
Ryan Prichard
b35a85ee8b Switch platform EH unwinder to prebuilt LLVM libunwind
For the platform libc++ STL, remove the
-Wl,--exclude-libs,libunwind_llvm.a argument, which is redundant with
the same argument in deviceGlobalLdflags.

Bug: http://b/153025717
Test: device boots
Change-Id: Idd7791d52f74aab2d5f59419fb75f841fc29a2eb
2021-01-13 19:51:06 -08:00
Paul Duffin
851f3995bc Extract ApexFileProperties from apex PrebuiltProperties
The properties and logic to select the appropriate arch specific src
property will need to be shared between the 'prebuilt_apex' module type
and an upcoming 'deapexer' module type to which the `prebuilt_apex`
will delegate responsibility for exporting the '.apex' file's contents.
This refactoring extracts them into the new ApexFileProperties struct
for reuse.

Bug: 171061220
Test: m nothing
Change-Id: Iac321a28afc469e885ee5b19ad33fecd94117236
2021-01-13 23:22:13 +00:00
Hungming Chen
e261c0107a Add bpf_syscall_wrappers for tethering apex and update allowed-deps.txt
Split the BPF system calls header definition into a new header library
(bpf_syscall_wrappers). Both platform and tethering apex require the
BPF system call definition. Move the definition from system/bpf/
libbpf_android/include/bpf/BpfUtils.h to frameworks/libs/net/
common/native/bpf_syscall_wrappers

Test: build, flash and run atest BpfMapTest
Change-Id: Ief5ffbb96c216796e4f0f4cacbde7c08f4af274a
2021-01-13 17:09:21 +00:00