Commit graph

18824 commits

Author SHA1 Message Date
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
Jooyung Han
b04a4997b8 cc: fix a utility to make C macro name
Use the result of regex.ReplaceAllString()

Bug: 149591522 (not directly related to this)
Test: m (with new unit test)
Change-Id: Ifce07547ccc067f1ee5bd8467c2fb7d7f8387b8e
2020-03-17 15:36:39 +09:00
Treehugger Robot
4f65ea2992 Merge "Remove libselinux from the apex_available whitelist" 2020-03-17 04:55:02 +00:00
Mitch Phillips
18e6719e9f [cc_fuzz] Don't build infra-disable targets in m haiku.
`make haiku` shouldn't build fuzz targets that are disabled on the
continuous fuzzing infra. This should reduce pressure on the repackager.

Bug: N/A
Test: make haiku && verify that example_fuzzer isn't there.
Change-Id: I6a687a3ab8cbb1eb75113e96aba2c4f9f8058010
2020-03-16 23:25:17 +00:00
Baligh Uddin
c822818147 Merge "Allow for overriding container packagename for an Apex." 2020-03-16 23:07:31 +00:00
Elliott Hughes
cc868de8a7 Merge "Remove unused mips workarounds." 2020-03-16 21:06:13 +00:00
Baligh Uddin
5b57dbad86 Allow for overriding container packagename for an Apex.
Test: go test ./... -test.v -run TestOverrideApex
BUG: 148198056
Change-Id: If49042a7acbf9f0dcb505664863d97805902e459
2020-03-16 12:38:06 -07:00
Paul Duffin
bce90daf45 Add support for cc_prebuilt_library
Test: m nothing
Bug: 142918168
Change-Id: I8aacc0052812208e1892ef533545ae53bb387a0d
2020-03-16 19:27:16 +00:00
Paul Duffin
dcb4bd6fb4 Refactor prebuilt to use srcs supplier function
Previously, prebuilt had two ways to provide the src value, as a
pointer to an []string and using reflection. That meant that any code
that needed to check the src to use had to understand the two ways of
accessing it.

This change refactors the code to abstract the origin of the src values
being a supplier function. That insulates the callers from having to
know the details and makes it easy to add new suppliers in future.

Test: m nothing
Bug: 142918168
Change-Id: I5cc7517c46cce96924c9f34ba1b046b468f7684a
2020-03-16 19:27:11 +00:00
Paul Duffin
843f09723b Merge "Output properties before sets in snapshot module" 2020-03-16 11:04:33 +00:00
Paul Duffin
2c73260636 Merge "Remove SdkMemberType.FinalizeModule" 2020-03-16 11:04:26 +00:00
Jooyung Han
5417f775e5 apex: Deprecate legacy_android10_support prop
min_sdk_version = 29 implies that the module should support Android10.

Bug: 150431944
Test: m
Change-Id: Iad90a239898f59456900ae7816b90379b1b43406
2020-03-14 16:03:24 +09:00
Dario Freni
da1aefe44e Pass apex_build_info to bundle base.zip file
Fix: 150077028
Test: manual inspection of com.android.wifi-base.zip
Merged-In: Id201a3410a46e0c88a77e6f88e5b85906c7a6c8b
Change-Id: Id201a3410a46e0c88a77e6f88e5b85906c7a6c8b
(cherry picked from commit 18423788cb)
2020-03-14 06:58:46 +00:00
Treehugger Robot
8fed7d4057 Merge "Follow up a review comment that was missed" 2020-03-13 17:48:32 +00:00
Paul Duffin
07ef3cb1fd Output properties before sets in snapshot module
This ensures a consistent output irrespective of whether property sets
are created before or after the properties are added. This provides a
little more flexibility in the creation code which allows that to be
simplfied.

Also switches from using reflection to a type switch.

Bug: 142918168
Test: m nothing
Change-Id: Ia025bfc751f1217d1658de6fb8e15091ea0ea9ff
2020-03-13 17:25:23 +00:00
Paul Duffin
0174d8d2c9 Remove SdkMemberType.FinalizeModule
This was only being used to set the "stl" property for cc library sdk
member type and so that functionality was moved to AddPrebuiltModule()
and FinalizeModule was removed.

Required a few test changes to move the property to the correct
position in the generated module.

Bug: 142918168
Test: m nothing
Change-Id: If6400189833d4ff3285e7a7adf63a9b509e2a03b
2020-03-13 17:25:16 +00:00
Ivan Lozano
438d379eb6 Merge "Disable CFI only on incompatible variants." 2020-03-13 15:57:08 +00:00
Paul Duffin
9c37340492 Merge "Copy shared_libs and system_shared_libs to module snapshot" 2020-03-13 14:21:48 +00:00
Paul Duffin
7f7bb3f46d Follow up a review comment that was missed
Bug: 142935992
Test: m nothing
Change-Id: I45b3b7dd3bde3042d67f647c188d61070864f3cc
2020-03-13 14:20:42 +00:00
Treehugger Robot
0a4c18e837 Merge "Support extracting common values from embedded structures" 2020-03-13 13:42:22 +00:00
Paul Duffin
13f0271478 Copy shared_libs and system_shared_libs to module snapshot
This change ensures that the runtime dependencies between a
binary/shared library are correctly specified in the snapshot so that
the build can ensure that shared libraries are built before the targets
that use them.

It adds support for differentiating between references that are
required to refer to another sdk member (required) and those that may
refer to either an sdk member or a non-sdk member (optional). The
latter is used for shared library references as the libraries used by
an sdk member may be provided from outside the sdk. e.g. liblog is not
part of the ART module but is used by some members of the ART sdk.

Bug: 142935992
Test: m nothing
Change-Id: Ia8509ffe79b208c23beba1880fe9c8a92b732685
2020-03-13 11:14:07 +00:00
Paul Duffin
b07fa51196 Support extracting common values from embedded structures
This change also added support for excluding properties from common
value extraction by using a struct tag of `sdk:"keep"` That was needed
to prevent the fields in SdkMemberPropertiesBase from having their
values cleared.

The purpose of this change is to make it easier to share functionality
across sdk member types.

Bug: 142935992
Test: m nothing
Change-Id: Ie5160a8f854056920e411801ca20721eab7c8578
2020-03-13 10:47:14 +00:00
Treehugger Robot
845f655011 Merge "Add __ANDROID_SDK_VERSION__=<ver> macro" 2020-03-13 09:45:10 +00:00
Paul Duffin
c097e36172 Refactor common value extraction
This change pulled the common value extraction functionality out into
its own structure that can be used to extract common values from
multiple sets of properties.

Precursor to follow up changes that will allow properties to contain
embedded structures making it easier to share functionality across
sdk member types.

Bug: 142935992
Test: m nothing
Change-Id: Ic902ed61e40ced7a2c2fa4b5f793f532c6fc0034
2020-03-13 08:46:54 +00:00
Treehugger Robot
37b8759be3 Merge "Always keep rsp files" 2020-03-12 20:16:54 +00:00
Aurimas Liutikas
71a1240377 Merge "Do not include any documentation when building stubs" 2020-03-12 19:16:01 +00:00
David Srbecky
b9c99133eb Merge "Generate the ART boot image for host as well (used by ART tests)." 2020-03-12 18:20:42 +00:00
Dan Willemsen
6d3cad93e8 Always keep rsp files
It's painful to debug without these.

Test: do a build; find out -name '*.rsp'
Change-Id: I6fc25095442178c0bcbc1dea444ba51e9259c600
2020-03-12 10:30:47 -07:00
Yabin Cui
3125c990ed Switch from clang-r377782b to clang-r377782c.
Bug: 149849077
Test: N/A
Change-Id: Id8b5dd13e87d1acd8dab1431fa6859721553c49c
2020-03-12 10:09:36 -07:00
Ivan Lozano
ea0006fcc0 Merge "Fix UBSanitized host binaries missing runtime." 2020-03-12 16:53:03 +00:00
Paul Duffin
001ca325fb Merge changes Iedcff7df,I4cb294c2
* changes:
  Copy white listed apex available settings into snapshot
  Disable installation for sdk snapshot versioned prebuilts
2020-03-12 08:07:55 +00:00
Jiyong Park
1731f6ae3f Remove libselinux from the apex_available whitelist
libselinux no longer is included in any APEX. Only the platform variant
of it (/system/lib/libselinux.so) exists and APEXes link to it.

Removing the lib name from the whitelist to make it clear that the
library is not available to any APEX.

Bug: 151053366
Bug: 150999716
Test: m
Change-Id: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
2020-03-12 14:16:07 +09:00
Ivan Lozano
f3b190f8e7 Fix UBSanitized host binaries missing runtime.
Host binaries by default use the UBSan runtime whether or not
diagnostics are requested in the module definition. The rest of the code
assumes the runtime is only needed when diag properties are set.

This makes sure to add the runtime to the dependency graph of host
binaries that are UBSanitized.

Bug: 150336284
Test: ./art/tools/dist_linux_bionic.sh com.android.art.host
Test: runtime appropriately identified as a dependency of libziparchive
Change-Id: I2704aaba4abc7f4e6d96747917c77b5147fd1d56
2020-03-11 20:40:21 -04:00
Aurimas Liutikas
39de325122 Do not include any documentation when building stubs
We only need documentation (javadocs) when building docs stubs,
for regular stubs, we can drop printing out all the docs.

Tested with:
touch frameworks/base/core/java/android/view/View.java && time make -j framework

Before (with just r.android.com/1254909)
Run #1 2m4.779s
Run #2 2m6.672s
Run #3 2m4.179s

Average: 125.2 seconds

After (with this patch and r.android.com/1254909)
Run #1 1m58.682s
Run #2 1m58.820s
Run #3 1m57.724s

Average: 118.4 seconds

Speedup ~6.8 seconds (5.4%)

Bug: 151160048
Test: make checkapi
Change-Id: I27eafb5a61bb9d26a74ca25f84c9daca17a8394f
2020-03-11 23:53:13 +00:00
Dan Willemsen
bc32a50ff4 Don't check elf properties of python prebuilts
We're not doing a great job of copying over all the library dependencies (especially when using sanitizer libraries). Just omit these from the checks, which shouldn't really matter.

Bug: 151093572
Change-Id: I8470bbfbf36a51739e8a7e699ad090a66c9db8b2
Test: treehugger
2020-03-11 20:55:17 +00:00
Paul Duffin
7d74e7bea3 Copy white listed apex available settings into snapshot
Makes sure that the module snapshots do not rely on the white list
of apex available settings so that when those lists are removed it is
not necessary to update any snapshots.

Bug: 142935992
Test: m nothing
Change-Id: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
2020-03-11 18:31:45 +00:00
Paul Duffin
0cb37b9ce1 Disable installation for sdk snapshot versioned prebuilts
The sdk snapshot creates two prebuilts for each member one that is
versioned and one that is not. If they are both installed then they
lead to duplicate rules in make for creating the same installed file.

This change adds an installable property to cc modules that will
prevent the installation of the file and then adds installable: false
on the versioned prebuilt for cc modules.

Bug: 142935992
Test: m nothing
Change-Id: I4cb294c2b0c8a3f411eea569775835d9e41726d6
2020-03-11 18:31:45 +00:00
Treehugger Robot
f53737fadc Merge "Remove special handling of test_ apexes" 2020-03-11 17:52:56 +00:00
Nikita Ioffe
643953d170 Merge "Always use "${codename}.${sha}" if UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true" 2020-03-11 17:45:34 +00:00
Treehugger Robot
de77904484 Merge "Remove special handling of com.android.art.debug/release" 2020-03-11 16:46:21 +00:00
Treehugger Robot
2d80d382fa Merge "Define a proto file that generates the current build completion status." 2020-03-11 16:28:08 +00:00
Paul Duffin
57380a902e Remove special handling of test_ apexes
Test apexes no longer check to see whether their contents are available
so the special handling is no longer necessary.

Bug: 142935992
Test: m nothing
Change-Id: Iecae7dcbb87908d19c672f74d3c1ed8810d4485b
2020-03-11 15:17:04 +00:00
Paul Duffin
50cbefd5e8 Remove special handling of com.android.art.debug/release
The whitelistedApexAvailable used to map references to
com.android.art.debug/release to com.android.art before looking it up
in the white list. This change removed that mapping and simply added
both to the white list.

Bug: 142935992
Test: m nothing
Change-Id: Ibad76fb73988688eb303e056197986ee9a6119ae
Merged-In: Ibad76fb73988688eb303e056197986ee9a6119ae
2020-03-11 15:16:47 +00:00
Jooyung Han
35155c4f96 Fix path in apex when native_bridge_supported: true
NativeBridgeRelativePath should be appended after /bin or /lib and
before subdir.

Bug: N/A
Test: m (add a soong test)
Change-Id: Id0c44c66b4900caa291e816cf3361fdec8ff9421
2020-03-11 20:07:34 +09:00
Treehugger Robot
784a53ce37 Merge "Improve error handling around username/hostname" 2020-03-11 02:10:56 +00:00
Treehugger Robot
9d3423aa07 Merge "Scripts to evaluate dependency transitive closures." 2020-03-11 01:19:04 +00:00
Jooyung Han
4c8e3509ee Merge "Fix apex_available" 2020-03-10 23:53:41 +00:00
Jooyung Han
5e9013be22 Fix apex_available
Checking apex_available was missing some corner cases.
For example, the deps of share deps of cc_library modules are missed
while those from cc_library_shared are correctly tracked.

This was due to..

* calling DepIsInSameApex in WalkDeps: both work fine separately, but
when they are used together, it fails to work. It's due to how WalkDeps
works. (We might fix this bug too risky since it is used very widely)
* incorrect receiver for DepIsInSameApex in apex_deps mutator: receiver
is supposed to be parent, but child was used before. Interestingly lots
of deps are within the same group of module types(cc to cc, java to
java), it has worked. (note that receiver's DepIsInSameApex
implementation can be different).

This change fixes them by..

* walkPayloadDeps is now relying on ApexVariation, which is calculated
correctly by TopDown apex_deps mutator.
* use correct receiver for DepIsInSameApex in apex_deps mutator, which
requires for java.SdkLibrary to override the method and for
java.Library/Import to use passed dep instead of receiver to check its
membership of sdk.

Bug: 151071238
Test: build/boot
Change-Id: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
2020-03-10 23:52:01 +00:00
Patrice Arruda
7d401482f3 Define a proto file that generates the current build completion status.
Soong UI will generate a new proto file in the out directory for
other systems to read the build completion status during a course
of a build. The proto file contains build action counters where

total_actions: represents the total build actions of a build (will
increase and may decrease during a course of the build)

finished_actions: represents the number of executed build actions.
finished_actions never decreases and finished_actions <= total_actions.

current_actions: represents the number of build actions being executed
and current_actions + finished_actions <= total_actions.

Bug: 150401146
Test: executed regen.sh script.
Change-Id: I04f4c07855723d0684b141d88cb3529ab5d9fccd
2020-03-10 16:19:22 -07:00
Dan Willemsen
a17ac9632d Improve error handling around username/hostname
If this couldn't read the current user, it would print a generic
message, then proceed to dereference the invalid user struct :(

Provide somewhat reasonable defaults, and better error messages instead.

Test: m nothing
Test: run docker with misconfigured user
Change-Id: I21af77c7d8d1d2d27cb04546667eb1094c62a7a1
2020-03-10 15:45:47 -07:00