Commit graph

18696 commits

Author SHA1 Message Date
Patrice Arruda
85f227eed7 Generate the build_error protobuf file on first build action error.
buld_error protobuf file is created the moment a build action failed.
This is for external system to detect immediately what caused the
build failure while monitoring the build_progress.pb file.

Bug: b/150401146
Test: * m nothing
      * Built successfully aosp_arm-eng and checked build_error file
        was not created.
      * Modified a cpp file to cause a build failed. Ran m and build
        failed. Checked immediately during the build that the
	build_error file was created.
      * m clean; m and during build, checked if build_error was
        removed.
Change-Id: I778616ae8cf242b49ad263b79c93321959112caa
2020-03-19 18:23:26 -07:00
Treehugger Robot
f597301853 Merge "Add build progress in Soong UI" 2020-03-19 22:09:02 +00:00
Treehugger Robot
0835c1b27a Merge "Do not write build_error proto file if there are no build errors." 2020-03-19 21:57:51 +00:00
Patrice Arruda
36b5e31f62 Do not write build_error proto file if there are no build errors.
For successful builds, a blank build_error proto file is created.
This slows down the data processing part where it reads the build_error
file and there are no errors to be processed.

Bug: 142277430
Test: Did a successful build and checked if the build_error file
      was not available. Changed a source file to make the build
      failed and checked if the build_error file was available.
Change-Id: I300dffe32fb7f8bf984fa20ae368bdd02bf12992
2020-03-19 13:20:55 -07:00
Patrice Arruda
74b43998e7 Add build progress in Soong UI
Soong UI generates a proto file named build_progress.pb in $(OUT_DIR)
output directory that contains build action numbers (how many are executing,
finished and total) during the course of a build. This is for external
systems that invokes the Platform Build Systems and would like to know
the completion status.

Bug: b/150401146
Test: Wrote a bash script that continuously read the
build_progress.pb file and computed the build completed percentage
while building the aosp_arm-eng target. Compared the percentage between
the Soong output console and the one reported by the bash script.

Change-Id: I7c7347bc8e41958093892d8e2731c4f4169937dd
2020-03-19 13:15:05 -07:00
Treehugger Robot
ddd7d0cac9 Merge "Fix vndk snapshot suffix on Makefile" 2020-03-19 07:40:51 +00:00
Treehugger Robot
4726b9c8a0 Merge "Apply EnforceRROExemptedTargets in Soong" 2020-03-19 01:47:54 +00:00
Inseob Kim
752edec290 Fix vndk snapshot suffix on Makefile
When exporting Soong modules to Makefile, each VNDK snapshot module
whose version is BOARD_VNDK_VERSION has ".vendor" suffix. So makeLibName
should also return ".vendor", not the full vndk snapshot suffix like
".vndk.29.arm64.vendor".

Exempt-From-Owner-Approval: cherry-pick

Bug: 151274994
Test: manual build with snapshot
Change-Id: I48f606f90f6c5ca55d0a5bc29bad491c38a44f47
Merged-In: I48f606f90f6c5ca55d0a5bc29bad491c38a44f47
(cherry picked from commit 7ac1fa7823)
2020-03-19 10:43:31 +09:00
Bob Badour
0528180f4b Merge "Fix bug caused by set -e" 2020-03-19 01:02:59 +00:00
Bob Badour
455b3cb38f Fix bug caused by set -e
Empty results cause grep/egrep to return a non-zero status.

Bug: 145347092
Bug: 141258651
Bug: 69058154
Bug: 143285996

Test: manual run for notice files

Change-Id: I25d54ae307b97a07a98e99c54f283437718fe657
2020-03-18 17:51:48 -07:00
Yabin Cui
7b67b9e97b Merge "Switch from clang-r377782b to clang-r377782c." 2020-03-19 00:04:39 +00:00
Tim Joines
45feb06174 Merge "Revert "Share vdex files in the ART apex between architectures (..."" 2020-03-18 19:46:48 +00:00
Tim Joines
c1ef1bb5cc Revert "Share vdex files in the ART apex between architectures (..."
Revert submission 1254009-vdex-symlinks

Reason for revert: This causing some devices to fail to boot. See b/151836042 for details.
Reverted Changes:
Iced89071b:Expect vdex files in a target-independent director...
Ifbceb8457:Share vdex files in the ART apex between architect...

Change-Id: I5bd88f8e61d442eed921d840c90777a2750ddb16
2020-03-18 18:00:41 +00:00
Treehugger Robot
2812418eac Merge changes I025ee90e,I2a9e0327
* changes:
  Extract the osTypeSpecificInfo code from module creation loop
  Extract archTypeSpecificInfo code from module creation loop
2020-03-18 14:27:04 +00:00
Ulyana Trafimovich
5d2449efe4 Merge "Share vdex files in the ART apex between architectures (via symlinks)." 2020-03-18 13:46:06 +00:00
Paul Duffin
00e4680d4d Extract the osTypeSpecificInfo code from module creation loop
Extract the functionality to create an osTypeSpecificInfo struct,
to optimize the properties, and add its properties to a property set
into methods of the *osTypeSpecificInfo struct.

This change is in preparation for adding support for link type which
is another dimension within arch type which itself sits within os type.

Test: m nothing
Bug: 142918168
Change-Id: I025ee90e1461f7389bf4a9d056b281453068cf87
2020-03-18 11:18:38 +00:00
Paul Duffin
fc8dd239ec Extract archTypeSpecificInfo code from module creation loop
Extract the functionality to create an archTypeSpecificInfo struct and
to add its properties to a property set into methods of the
*archTypeSpecificInfo struct.

Test: m nothing
Bug: 142918168
Change-Id: I2a9e0327b61bce7ad7699cd75de17aa0e5f1ebbb
2020-03-18 11:17:24 +00:00
Paul Duffin
b44b33a621 Clean up the main module creation loop
This change reorganizes the code within the main module creation loop
in preparation for delegating the work to separate types. It has been
split out into its own change to make it easier to review by keeping
the functional changes localized.

Renames the osTypeSpecificInfo archTypes field to archInfos as the
latter is more accurate.

Cleans up the arch variants handling:
1) Groups them by arch type to make them easier to process.
2) Fails fast when there is not exactly one variant per arch type as
   otherwise it results in a confusing failure later on.
3) Removes the commonArch flags and instead uses the fact that
   osInfo.archInfos is empty when the common architecture variant is
   available.

Cleans up the arch type specific property set handling.
1) Adds new archPropertySet variable to allow the choice of where the
   arch specific properties are added to be made alongside the choice
   of where the os specific properties are to be added.
2) Removes unnecessary check for commonArch around the loop to add
   properties from archInfos as the archInfos will be empty when the
   common architecture is present.

A number of other changes to make it easier to extract the code into
their own methods.

Test: m nothing
Bug: 142918168
Change-Id: I16a5fa79efff0d08c22916449eb46a5bd910723a
2020-03-18 11:02:24 +00:00
Treehugger Robot
d21a743f73 Merge "track static deps when gatherint notices for apex" 2020-03-18 01:19:26 +00:00
David Srbecky
fde5912660 Merge "Rename ART dump-oat rules." 2020-03-17 14:34:45 +00:00
Ulya Trafimovich
5b88fe36b5 Share vdex files in the ART apex between architectures (via symlinks).
Test: aosp_walleye-userdebug boots.

Test: Check symlinks to *.vdex files in the ART apex:
$ adb shell 'find /apex/com.android.art -name '*.vdex' | xargs ls -l'
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-apache-xml.vdex -> ../boot-apache-xml.vdex
  lrw-r--r-- 1 system system   25 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-bouncycastle.vdex -> ../boot-bouncycastle.vdex
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-core-icu4j.vdex -> ../boot-core-icu4j.vdex
  lrw-r--r-- 1 system system   24 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-core-libart.vdex -> ../boot-core-libart.vdex
  lrw-r--r-- 1 system system   19 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-okhttp.vdex -> ../boot-okhttp.vdex
  lrw-r--r-- 1 system system   12 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot.vdex -> ../boot.vdex
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-apache-xml.vdex -> ../boot-apache-xml.vdex
  lrw-r--r-- 1 system system   25 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-bouncycastle.vdex -> ../boot-bouncycastle.vdex
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-core-icu4j.vdex -> ../boot-core-icu4j.vdex
  lrw-r--r-- 1 system system   24 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-core-libart.vdex -> ../boot-core-libart.vdex
  lrw-r--r-- 1 system system   19 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-okhttp.vdex -> ../boot-okhttp.vdex
  lrw-r--r-- 1 system system   12 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot.vdex -> ../boot.vdex
  -rw-r--r-- 1 system system 1229 1970-01-01 01:00 /apex/com.android.art/javalib/boot-apache-xml.vdex
  -rw-r--r-- 1 system system 2043 1970-01-01 01:00 /apex/com.android.art/javalib/boot-bouncycastle.vdex
  -rw-r--r-- 1 system system 2883 1970-01-01 01:00 /apex/com.android.art/javalib/boot-core-icu4j.vdex
  -rw-r--r-- 1 system system  865 1970-01-01 01:00 /apex/com.android.art/javalib/boot-core-libart.vdex
  -rw-r--r-- 1 system system  395 1970-01-01 01:00 /apex/com.android.art/javalib/boot-okhttp.vdex
  -rw-r--r-- 1 system system 7125 1970-01-01 01:00 /apex/com.android.art/javalib/boot.vdex

Bug: 150934453

Change-Id: Ifbceb845749f4c218693f4118e8b35b59ff26de1
2020-03-17 13:36:06 +00:00
David Srbecky
46672321e4 Rename ART dump-oat rules.
Follow-up to CL/1235086 which renamed the rules.

Preserve the name for target since ART tests depends on it.

Test: m dump-oat-boot-x86
Change-Id: I67c7ea9e99fea24f089d38856811bfa320258b54
2020-03-17 11:00:46 +00:00
Jiyong Park
9918e1afd7 track static deps when gatherint notices for apex
This change fixes a bug that license info for statically linked
libraries are absent in the merged notice for APEX. The problem was that
we were iterating over the apexFiles list that represents actual files
(not Soong modules) that are included in the APEX. The problem is now
fixed by iterarting the all the modules that directly or indirectly
contribute to the APEX using walkPayloadDeps() function.

Bug: 149455933
Test: m
Change-Id: I38655da62b590b669ab4649815b61a5a8e314154
2020-03-17 19:16:40 +09:00
Paul Duffin
28e28ed2f6 Merge "Add support for cc_prebuilt_library" 2020-03-17 09:56:29 +00:00
Paul Duffin
175ef303a3 Merge "Refactor prebuilt to use srcs supplier function" 2020-03-17 09:55:58 +00: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