Commit graph

18622 commits

Author SHA1 Message Date
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
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
Bob Badour
02ad5e4de6 Scripts to evaluate dependency transitive closures.
Bug: 145347092
Bug: 141258651
Bug: 69058154
Bug: 143285996

Test: run manually

Change-Id: I29d674f97ccff19ff61f675022dce052f14e0dd8
2020-03-10 21:53:39 +00:00
Paul Duffin
865171ed40 Allow sdk members to vary by os type
Adds support for specifying separate members to an sdk/module_exports
for different os types, e.g. separate ones for android and host.

Adds 'android:"arch_variant"' tag to the dynamically generated fields
for the sdk member types.

Merges the exported members from all variants together.

Determines the device/host_supported flags of the member snapshots by
whether the OsClasses used by their variants rather than the sdk's
host/device supported properties as they may be different.

Bug: 150451422
Test: m nothing
Change-Id: I41fbbcd8723aafd54826aad9b78eced9f66ef51c
2020-03-10 10:39:24 +00:00
Treehugger Robot
04c93a40f1 Merge "DO NOT MERGE: Remove AppSearch from Android R." 2020-03-10 08:19:05 +00:00
Treehugger Robot
9948420715 Merge "Apply sdk version check to product apps" 2020-03-10 01:34:47 +00:00
Paul Duffin
a81668628e Merge "Add support for multiple os types" 2020-03-09 20:23:15 +00:00
Ulyana Trafimovich
a8e37b98bb Merge "Set '--force-determinism' option for boot image compilation." 2020-03-09 17:00:13 +00:00
Paul Duffin
a04c107bfa Add support for multiple os types
Updates the member snapshot creation code to support multiple os types.
It basically sorts the variants by os type, then applies the code to
optimize the arch properties and then it optimizes the properties that
are common across architectures and extracts any properties that are
common across os types.

The java and cc member types needed to be modified to make the location
of the generated files within the snapshot os type dependent when there
is more than one os type. That was done by adding an OsPrefix() method
to the SdkMemberPropertiesBase which returns the os prefix to use when
there is > 1 os type and otherwise returns an empty string.

Added three tests, one for cc shared libraries, one for cc binary and
one for java header libraries.

Bug: 150451422
Test: m nothing
Change-Id: I08f5fbdd7852b06c9a9a2f1cfdc364338a3d5bac
2020-03-09 15:54:31 +00:00
Ulya Trafimovich
c0c98d51d6 Set '--force-determinism' option for boot image compilation.
Test: aosp_walleye-userdebug boots.
Change-Id: I0edf7fbfe18ea2f3d1cfda5138a48bdc1420aa6a

Bug: 150934453
2020-03-09 14:19:17 +00:00
Paul Duffin
71754bf640 Merge "Copy sdk_version to cc library snapshots" 2020-03-09 14:15:54 +00:00
Treehugger Robot
a377311b90 Merge "Refactor java_library/java_test snapshot processing" 2020-03-09 13:14:32 +00:00
Paul Duffin
0c394f3919 Copy sdk_version to cc library snapshots
Bug: 142935992
Test: m nothing
Change-Id: Ib77c548b1971c841749c87115108af8b092bb809
2020-03-09 11:10:04 +00:00
Paul Duffin
b3c763711a Merge "Refactor snapshot module creation" 2020-03-09 11:02:29 +00:00
Treehugger Robot
06b362fad7 Merge "Apex_available check failure reveals dependency" 2020-03-09 10:59:36 +00:00
Jiyong Park
65cc4f7777 Apex_available check failure reveals dependency
When the check for apex_available has failed, the build system now shows
the module that brought the unavailable module into the APEX.

Bug: 151051671
Test: m
Merged-In: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
(cherry picked from commit 7bd9444b0f)
Change-Id: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
2020-03-09 18:56:54 +09:00
Nicolas Geoffray
714538fb5d Merge "Add a build script to compile modules and SDKs in AOSP." 2020-03-09 08:09:15 +00:00
Alexander Dorokhine
466d39a18c DO NOT MERGE: Remove AppSearch from Android R.
Test: presubmit
Bug: 150249538
Merged-In: I0a87b9d893bc76acf5ac5e8684f450b9a4f2a0cd
(cherry picked from commit c9c7116721)
Change-Id: I0a87b9d893bc76acf5ac5e8684f450b9a4f2a0cd
2020-03-09 15:14:42 +09:00
Treehugger Robot
c6453295a2 Merge "Do not explicitly link ucrt, ucrtbase" 2020-03-07 21:22:23 +00:00
Treehugger Robot
7423398025 Merge "Add version suffix for stub modules' Android.mk" 2020-03-07 08:44:32 +00:00
Treehugger Robot
5bf449c597 Merge "Stop using the host python3" 2020-03-07 05:02:46 +00:00
Pirama Arumuga Nainar
b8eefa8956 Do not explicitly link ucrt, ucrtbase
This was required before MinGW's default crt was set to ucrt.  In the
new setting, libmsvcrt.a is similar to libucrt.a and is implicitly
linked-in by the Clang driver.  Not explicitly linking in ucrt avoids
the link-order issue discussed in
https://github.com/android/ndk/issues/1198.

Test: m native-host-cross, go/android-llvm-windows-testing.
Change-Id: Idc125e550cae2f0eb812ca310d1d4be898a29ab4
2020-03-06 15:07:19 -08:00
Dan Willemsen
669f769470 Stop using the host python3
We've now got a prebuilt in prebuilts/build-tools

Test: treehugger
Change-Id: Ic0fb09c8970f3a1c9f3b7b0303168520dcbfc3d8
2020-03-06 10:28:04 -08:00
Jooyung Han
ad4c18765e Add version suffix for stub modules' Android.mk
Becase there can be more than one stub libraries, LOCAL_MODULE should be
suffixed with SubName just like NDK stub.

Note that suffix should not be appended to the latest version if the
library is provided by APEX, Otherwise, those libs always need to be
referenced with suffix in .mk files.

Bug: 145796956
Test: m
Change-Id: If503fa651a63b0b215742553b250ecf5e0a30971
2020-03-07 03:12:45 +09:00
Jooyung Han
03b5185b88 apex: choose stub according to min_sdk_version
Native modules within APEX should be linked with proper stub version
according to its min_sdk_version.

For example, when min_sdk_version is set to "29", libfoo in the apex
would be linked to libbar of version 29 from platform, even if it has
a newer version like 30.

Bug: 145796956
Test: m nothing (soong tests)
Change-Id: I4a0b2002587bc24b7deeb5d59b6eeba5e1db5b1f
2020-03-07 03:12:45 +09:00
Nicolas Geoffray
90bc3cd304 Add a build script to compile modules and SDKs in AOSP.
Test: build-mainline-modules.sh
Bug: 142935992
Change-Id: I80a9bf8ce03d77705ba677f95b03aeb2ac2451d5
2020-03-06 14:35:48 +00:00
Paul Duffin
8c3fec4c37 Enable androidmk processing in sdk testing
Previously, while sdk tests would pass the sdk code would often fail
in androidmk processing. This change makes the tests more realistic
and will catch the errors earlier.

Bug: 142935992
Test: m nothing
Change-Id: Ifd0b2d7cf24e941c919f6b6e0beb2403a67d4308
2020-03-06 09:45:54 +00:00
Colin Cross
1ec3fce9b6 Disable goma for javac actions in Soong
goma can't handle the --system argument that Android must pass to
javac.

Bug: b/143658984
Test: treehugger
Change-Id: I207668d8baa4ab28160938732a38f696aeac3f44
2020-03-05 20:46:15 +00:00
Paul Duffin
14eb4679a6 Refactor java_library/java_test snapshot processing
Adds support for handling the common arch to the sdk module type
snapshot generation code and then refactors the java_library
and java_test snapshot processing to take advantage of that.

Bug: 150451422
Test: m nothing
Change-Id: If746f375f1c4288ab6b67c7d216593b70258b043
2020-03-05 13:00:26 +00:00
Paul Duffin
88f2fbe92e Refactor snapshot module creation
Generalize the processing of arch specific properties to reduce
duplication in snapshot module creation and simplify addition of
support for handling multiple os types.

Supporting multiple os types with the current method for building
snapshot modules would require every affected module type to add
support for it. Rather than duplicate multiple os type handling code
across those module types this work generalizes the process cc modules
use for handling arch types as it can be used as a basis for handling
multiple os types. Migrating module types over to this new process
will insulate them from having to handle multiple os types.
OB
SdkMemberType changes:
* BuildSnapshot is deprecated in favour of the new AddPrebuiltModule()
  method.
* Additional methods, CreateVariantPropertiesStruct() and
  FinalizeModule() are added.
* A new interface SdkMemberProperties, is defined that handles
  extracting information from the variant (prior to common value
  optimization) and adding properties to a property set.

The sdk module type uses these new methods and types to delegate the
member type specific processing to the relevant member types while
handling the behavior that is common across all members types, e.g.
extracting common values across multiple architectures. A future change
will leverage this processing to add support for multiple os types.

This change also refactors the cc module processing to use the new
process.

Bug: 150451422
Test: m nothing
Change-Id: If6ab2498407b17f50391d062cd9afc01b5e01af4
2020-03-05 13:00:26 +00:00
Nicolas Geoffray
8f20563514 Merge "Add a nice install paths for module SDKs and exports." 2020-03-05 09:25:33 +00:00
Paul Duffin
befa4b91d7 Copy apex_available properties to snapshot modules
Bug: 142935992
Test: m nothing
Change-Id: I1cdaae5b4e13a89dc46541dacd34ef5a44735b6a
2020-03-05 08:29:02 +00:00
Treehugger Robot
c6d627b268 Merge "Capture snapshot headers in parallel" 2020-03-05 00:03:00 +00:00
Chih-hung Hsieh
286c318fa0 Merge "Add bugprone to global clang-tidy default checks" 2020-03-04 22:18:27 +00:00
Treehugger Robot
5d95387398 Merge "Make a soong-only copy of generate-notice-files.py" 2020-03-04 21:56:04 +00: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
Nicolas Geoffray
1228e9c0ba Add a nice install paths for module SDKs and exports.
Following how NDK also creates its own install path.

Bug: 142935992
Test: cc_sdk_test.go, java_sdk_test.go
Change-Id: I98a3656903f37f6d7c90e6cf609431b2461a6161
2020-03-04 14:20:46 +00:00
Automerger Merge Worker
ea1fcb630f PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES is applicable to override_apex am: 20bacabe0b
Change-Id: Ia1255de0c065be74bfa4be7d88a19800be2e603c
2020-03-04 05:57:11 +00:00
Jiyong Park
20bacabe0b PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES is applicable to override_apex
apex { name: "foo" }
override_apex { name: "override_foo", base:"foo" }

PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES := foo:com.android.foo

Previously, the override was done only for the overridden package "foo",
but not for "override_foo". Fixing this issue by using ctx.ModuleName()
when finding the package name to use.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 150645663
Test: m
Merged-In: I2947e5c75369216a4bbce8749503236be86771c3
(cherry picked from commit a519c54dd3)
Change-Id: I2947e5c75369216a4bbce8749503236be86771c3
2020-03-04 12:03:59 +09:00
Automerger Merge Worker
fff0ad2041 Enable vndk-ext for product variants am: 0ecf0b223f
Change-Id: I6c000e1cfb142a20c6c5ab1067ab1043bd9b7579
2020-03-04 01:40:23 +00:00
Justin Yun
0ecf0b223f Enable vndk-ext for product variants
To build vndk-ext for product variants use `vndk.extends` property
with `product_specific: true` as for the vndk-ext for vendor
variants. For example:
cc_library {
    name: "libvndk_ext_product",
    product_specific: true,
    vndk: {
        enabled: true,
        extends: "libvndk",
    },
}

It will install the vndk-ext libs for product variants in
product/lib[64]/vndk/

Test: m nothing
Bug: 147778025
Change-Id: If1ee5be93c579abad302f44f18e6316f27e70019
2020-03-04 01:22:16 +00:00
Automerger Merge Worker
8813c95bb8 Merge "Update build_broken_logs script" am: 49b445cace
Change-Id: I5962efed46aed54c2488f31181263a1e235a469a
2020-03-04 00:38:46 +00:00
Treehugger Robot
49b445cace Merge "Update build_broken_logs script" 2020-03-04 00:21:51 +00:00
Automerger Merge Worker
2db5d65577 Merge "Make __ANDROID_APEX_<NAME>__ macro optional" am: 6efd3598c5
Change-Id: I71a7d1f7e0ad08f9edd037645ed9b38f1457816d
2020-03-03 23:50:04 +00:00
Jooyung Han
6efd3598c5 Merge "Make __ANDROID_APEX_<NAME>__ macro optional" 2020-03-03 23:35:02 +00:00
Bob Badour
3911e6a1c4 Make a soong-only copy of generate-notice-files.py
This is an unchanged copy of build/make/tools/generate-notice-files.py

After this change, the make implementation of generate-notice-files.py
will change to take a required parameter for $(PRODUCT_OUT) and will
only include notices for files built under $(PRODUCT_OUT).

Because soong has the ability to walk dependency trees, the soong
version will likely change in the future to use that ability causing
both versions to move in different directions.

After those changes are complete, we can look into factoring out any
remaining shared logic.

Test: run manually and system image notices checked for changes

Change-Id: Id139a66503457615548b46e7996349ca0817e831
2020-03-03 13:50:53 -08:00
Automerger Merge Worker
27205840f4 Merge "Optimize FirstUniqueStrings and FirstUniquePaths" am: 1a0f984d43
Change-Id: Icccf040e94e300673a7a515845b8b9cac37f8d0d
2020-03-03 21:05:12 +00:00