Commit graph

32319 commits

Author SHA1 Message Date
Colin Cross
1f8c272984 Merge changes from topic "llndk_cc_library"
* changes:
  Don't rewrite LLNDK dependencies with .llndk suffix
  Don't strip stub libraries
2020-12-22 18:55:34 +00:00
Anton Hansson
0a2afd183a Merge "Remove sdk_version: "none" restriction" 2020-12-22 11:41:27 +00:00
Ulyana Trafimovich
b630c37d61 Merge changes I6a512209,I56437f26
* changes:
  Unify addition of class loader subcontext from dependencies.
  Move ClassLoaderContexts() method to UsesLibraryDependency interface.
2020-12-22 10:14:41 +00:00
Jiyong Park
459feca5cc rust modules in APEX don't get installed to the system partition
Otherwise, we get duplicated build rules.

Bug: N/A
Test: OUT_DIR=out DIST_DIR=out/dist
build/soong/scripts/build-ndk-prebuilts.sh

Change-Id: I2be0695d284bd72a19e02c8b7509a7f39afade8b
2020-12-22 15:10:00 +09:00
Colin Cross
127bb8b9f6 Don't rewrite LLNDK dependencies with .llndk suffix
Rewriting LLNDK dependencies with .llndk suffix requries referencing
a global data structure to determine if a given library is an LLNDK
library and therefore needs the .llndk suffix.  References to
global data structures from mutators must be removed to support
incremental Soong analysis.  Instead, move the LLNDK stubs rules
into the vendor variant of the implementing cc_library so that
the original name can be used.

As an incremental step, the llndk_library modules are left in
place, and the properties are copied into the cc_library via
the dependency specified by the llndk_stub property.  A followup
will move the LLNDK properties directly into the cc_library and
delete the llndk_library modules.

The global list of LLNDK libraries is kept for now as it is used
to generate the vndk.libraries.txt file.

Bug: 170784825
Test: m checkbuild
Test: compare Soong outputs
Test: all Soong tests
Change-Id: I2a942b21c162541a49e27b2e5833c9aebccff1d0
2020-12-21 17:53:30 -08:00
Colin Cross
adc81a0783 Don't strip stub libraries
LLNDK and NDK stubs are already not stripped, don't strip APEX stubs
either.

Test: m checkbuild
Change-Id: I9a50df4b8b73d764ca81634a8a3014726eceda99
2020-12-21 15:54:09 -08:00
Ulya Trafimovich
88bb6f6342 Unify addition of class loader subcontext from dependencies.
Previously CLC construction was scattered across different module types
and dependency tags. This CL moves all logic to one function, which
handles all special cases. This will allow to simplify CLC API and
reduce the number of different ways in which CLC is constructed.

Previously some of the cases failed early (at the time when a library is
added to CLC) if the build/install paths were unknown. Other cases did
not fail early, but were validated later before CLC was used. Late
failures are necessary because some of the libraries with unknown paths
still have to be processed by manifest_fixer (which doesn't need library
paths), but they do not use dexpreopt (which needs library paths). This
CL removes the early failures (all paths are still validated later).

The CLC tests do not fail because they use a private method that toggles
the "strict" flag (that enforces early/late failure mode) manually in
the method call.

The CL also makes a functional change in the way CLC is constructed for
component libraries that have an OptionalImplicitSdkLibrary(), or
libraries that are disguised as SDK libraries via `provides_uses_lib`.
Previously such a component/disguised library X was added to its own CLC
as a sibling element of X's own <uses-library> dependencies, which
created incorrect CLC structure. Now this is handled by addCLCFromDep,
when X is processed as dependency and added as a top-level CLC element
with its sub-CLC properly nested under it.

Bug: 132357300
Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: I6a512209b87b81d785875f10f76b21c81b2ed579
2020-12-21 22:16:21 +00:00
Bob Badour
d8065c606c Merge "getNamespacesToSearchForModule to use blueprint.Namespace" 2020-12-21 20:56:32 +00:00
Jaewoong Jung
f9b44657c8 Break up app.go.
Test: m nothing + TreeHugger
Change-Id: I64c6d7f10530c424bc282d8111dfaf9159426f00
2020-12-21 12:31:51 -08:00
Treehugger Robot
cef48e956b Merge "Support writing a ZIP64 file header" 2020-12-21 20:22:36 +00:00
Bob Badour
38620edca1 getNamespacesToSearchForModule to use blueprint.Namespace
Allow for nil argument.

Test: m all

Change-Id: I03e3afe00d72905f259ce1af5085387b796ebc3d
2020-12-21 18:40:53 +00:00
Anton Hansson
dff2c78a20 Add attribute to disable last-api compat tracking
Setting this to true by default is dangerous as it can mask bugs. Create
a dedicated attribute for java_sdk_library to enable this behavior
instead. The default will be flipped in a future CL when all the current
offenders have been fixed.

Fix all the tests to have the right API files.

Bug: 176092454
Test: m nothing
Change-Id: Ieab94bcb74abf8d018365a56fb447fe3dbd46957
2020-12-21 17:25:30 +00:00
Jaewoong Jung
4eb5048585 Merge "Remove the return value from dexpreopt" 2020-12-21 16:19:23 +00:00
Martin Stjernholm
7461e3c19a Merge "Set the Soong config variable to keep building ART from source." 2020-12-21 15:15:11 +00:00
Martin Stjernholm
2a9013ee17 Set the Soong config variable to keep building ART from source.
Without this Soong may run into inconsistencies due to stale prebuilts.
This amends https://r.android.com/1529658.

Test: TH build of NDK
Bug: 175918603
Bug: 172480615
Change-Id: I14680e4547d7d5f560d31ef61b71af8d159c4c53
2020-12-21 13:37:22 +00:00
Anton Hansson
69c43e40ad Merge changes I6d1be1a9,Ie5e9310e
* changes:
  Skip mainline_sdk by default in build_test.bash
  Allow multiple --skip-products and --products arguments to multiproduct_kati
2020-12-21 09:59:32 +00:00
Colin Cross
bad07a2fb9 Merge "Fix NDK build in downstream branches" 2020-12-20 05:36:26 +00:00
Treehugger Robot
15d46f15d7 Merge "variable: Update product_variables.arc struct" 2020-12-19 08:07:42 +00:00
Patrice Arruda
175500f016 Merge "Read the proc status file when PID is given for metrics purpose." 2020-12-18 04:14:09 +00:00
Colin Cross
e6a83e65d1 Fix NDK build in downstream branches
The NDK build in downstream branches with prebuilt apexes break
with multiple rules to copy the apex after
I8038ed5c6f05c989ac21ec06c4552fb3136b9a7a renamed SkipInstall to
HideFromMake, which is shadowed by an existing HideFromMake method.
Call through from the existing HideFromMake as a quick-fix for the
build.

Fixes: 175911330
Test: NDK build
Change-Id: Id475671d5dad888913bfb1af2e4be1f2454c3211
2020-12-17 18:22:34 -08:00
Satoshi Niwa
54f4826672 variable: Update product_variables.arc struct
- Add whole_static_libs
- Add `android:"arch_variant"` so arc struct can be used inside
  target.android.product_variables

Test: m
Bug: 171847983
Change-Id: Iaa99b007302462ef66d0d943bc16d37a6e8ecdc7
2020-12-18 09:53:26 +09:00
Treehugger Robot
d9d59fb57c Merge "SOONG_* variables are emitted only for the BuildOS variants" 2020-12-17 23:44:37 +00:00
Colin Cross
373147baa9 Support writing a ZIP64 file header
If the length of a stored file is more than 2^32 and a data descriptor
is not being used then a ZIP64 extra is required in the file header to
store the uncompressed and compressed lengths.

Bug: 175055267
Test: TestCopyFromZip64
Change-Id: Id414b4c04f48aefabfd835bd8339333d36576375
2020-12-17 15:08:50 -08:00
Patrice Arruda
04157e186f Read the proc status file when PID is given for metrics purpose.
To measure the MaxRSS memory correctly, read the proc status file
under /proc/<pid>/status and extract the MaxRSS value from it. The
implementation is only available for Linux based distributions.

Bug: b/169453825
Test: go test
Change-Id: I32e3068fee7447f9ef5dfb5a8d8dcb6934e0af23
2020-12-17 14:52:14 -08:00
Martin Stjernholm
56b584c4b2 Merge "Change default for source_build config variable to true." 2020-12-17 22:31:04 +00:00
Colin Cross
97a1be6e7b Merge changes from topic "sbox_tools"
* changes:
  Sandbox genrule tools
  Call ctx.InstallFile for uninstallable cc modules
  Don't copy uninstallable variants of NDK libraries to sysroot
2020-12-17 22:01:06 +00:00
Anton Hansson
785a31ab58 Skip mainline_sdk by default in build_test.bash
This product does not work in build_test yet for two reasons:
- it's a soong-only build and kati does not pass
- it requires the FORCE_BUILD_LLVM_COMPONENTS env variable to be set

Bug: 174315599
Test: build_test
Change-Id: I6d1be1a9779028fb6b7504b6853edcd6db71e35a
2020-12-17 20:27:45 +00:00
Liz Kammer
40ddfaae7a Check whether value_variables are set
If value variable had not been set by a user, previously we would error
out. Now, we just skip it.

Test: go test soong tests
Test: m nothing
Change-Id: Ibab67e00b28055b5feee2f4fd79bf4dfb2fc6704
2020-12-17 12:18:37 -08:00
Treehugger Robot
41351b5334 Merge "Add test & documentation for PropertiesToApply" 2020-12-17 19:55:25 +00:00
Colin Cross
f2f3d31549 Allow multiple --skip-products and --products arguments to multiproduct_kati
Concatenate multiple comma separated lists passed to --skip-products
and --products.

Test: manual
Change-Id: Ie5e9310e1ebcb9c7fa88e9c8b45fb29f64f9cce7
2020-12-17 19:33:18 +00:00
Liz Kammer
fe8853d2e6 Add test & documentation for PropertiesToApply
Document PropertiesToApply expectations about props, and suggest it
should generally be generated via CreateProperties.

Test: go soong tests
Test: m nothing
Change-Id: I7cc2590db96865382ad6e0da333d4a4e2c697f45
2020-12-17 18:59:41 +00:00
Colin Cross
ba9e403703 Sandbox genrule tools
This relands I38393900677c5dbe8e72fe06a7dd7d71f3c09f82 after
I8038ed5c6f05c989ac21ec06c4552fb3136b9a7a, which makes the ASAN
variants of libraries have PackagingSpecs so they can be copied
into sandboxed genrules.

Copy tools used by genrules into the sandbox directory.  This
ensures correct dependencies on all files used by tools, and
is one step closer to enabling genrules inside unselected
namespaces.

Bug: 124313442
Test: genrule_test.go
Test: rule_builder_test.go
Test: m checkbuild
Change-Id: I57c0d5fc8bba216fac4deb972d0d2098593e8963
2020-12-17 10:02:56 -08:00
Colin Cross
a9c8c9f145 Call ctx.InstallFile for uninstallable cc modules
SkipInstall is actually primarily used to prevent making a module
visible to Make, rename it and add new SkipInstall that actually
skips installation without affecting Make.

Call c.SkipInstall() for uninstallable cc modules to allow calling
c.installer.install, which will collect PackagingSpecs for
uninstallable cc modules, allowing them to be used by genrules.

Bug: 124313442
Test: m checkbuild
Change-Id: I8038ed5c6f05c989ac21ec06c4552fb3136b9a7a
2020-12-17 10:02:18 -08:00
Colin Cross
95b07f2b59 Don't copy uninstallable variants of NDK libraries to sysroot
After the next patch libraryDecorator.install will be called for
uninstallable variants of modules, manually filter them out when
copying to the NDK sysroot.

Bug: 124313442
Test: m checkbuild
Change-Id: I28b538d4ae271dc5e27c386d7cfa538ac0ed841b
2020-12-17 10:02:18 -08:00
Jaewoong Jung
4b97a56615 Remove the return value from dexpreopt
dexpreopt doesn't strip dex files from the input jar anymore, so there's
no point returning the input jar path untouched.

Test: m nothing + TreeHugger
Change-Id: I8fde6cdc19e85a2fbc946513696417b945c5de0f
2020-12-17 09:43:28 -08:00
Anton Hansson
0af20effc1 Remove sdk_version: "none" restriction
Not entirely sure what the history behind requiring only libcore
projects use this, but it is a bit annoying to have to allow-list every
use.

Bug: 173606718
Test: m nothing
Change-Id: I66f71e67d3f17e7f983c8537dff537fe8419da95
2020-12-17 15:43:29 +00:00
Ulya Trafimovich
dbf31665ab Move ClassLoaderContexts() method to UsesLibraryDependency interface.
This method logically belongs with other UsesLibraryDependency methods,
as it is used in the same context when computing class loader context.
Previously it was part of Dependency interface, which doesn't cover SDK
libraries. We do not currently have the necessary information for
SdkLibraryImport (so ClassLoaderContexts() returns nil for it), but we
do have it for SdkLibrary (via Library).

Bug: 132357300
Test: m nothing
Change-Id: I56437f260efc6a9af3f45b334e84e915244ccce1
2020-12-17 15:05:26 +00:00
Jiyong Park
ad429d0cd2 SOONG_* variables are emitted only for the BuildOS variants
When HOST_OS=linux and HOST_CROSS_OS=linux_bionic, then a module enabled
for the target "linux" is mutated for both linux(linux_glibc) and
linux_bionic. Although this is WAI for most of the host modules, but
also causes duplocated SOONG_* variables from prebuilt_build_tools
modules. They are configured as HostSupportedNoCross, but linux_glibc
and linux_bionic are not considered as HostCross on the regular
linux/x86 machines, because it can run artifacts from both variants
natively.

Since the problem is at SOONG_* variables, not in the fact that
linux_bionic is not considered as HostCross, fixing the problem by
emitting the variable only for the variants whose OS is the same as the
build system OS (android.BuildOS).

Bug: N/A
Test: apply aosp/1512778, lunch mainline_sdk && m nothing.
out/soong/make_vars-mainline_sdk.mk doesn't have duplicated SOONG_*
variables.

Change-Id: Ieb51d180b7c1ee758e7a376a960a8c3b91c836c9
2020-12-17 19:31:17 +09:00
Treehugger Robot
1a74be780b Merge "Assert android.ApexModule interface for types having ApexModuleBase" 2020-12-17 04:14:35 +00:00
Rupert Shuttleworth
e808dae1fd Merge "Skip Bazel dist dir migration if not in dist mode or if Bazel dist dir does not exist." 2020-12-17 03:26:12 +00:00
Rupert Shuttleworth
534f15708f Skip Bazel dist dir migration if not in dist mode or if Bazel dist dir does not exist.
Test: DIST_DIR=/tmp/foo USE_BAZEL=1 m dist and DIST_DIR=/tmp/foo USE_BAZEL=1 m dist installclean
Change-Id: Ibf576d2f3ba506e0f45c30a5dbea69de5c475c9a
2020-12-17 01:01:33 +00:00
Treehugger Robot
f1c48afc31 Merge "arch specific dependencies are supported for apex" 2020-12-17 00:15:26 +00:00
Patrice Arruda
c7ed779e5a Merge "Add and update comments in ui/metrics/metrics.go." 2020-12-16 19:34:56 +00:00
Liz Kammer
13548d7fa8 Correct mismatched string format in bazel_handler
Test: go test soong tests
Change-Id: Ic48d2e75e8d246f490f46f4619e739b0fa565902
2020-12-16 11:13:30 -08:00
Treehugger Robot
2df93e550b Merge "Remove soong_metrics_proto from the import of the protobuf file." 2020-12-16 17:22:09 +00:00
Treehugger Robot
f747e75119 Merge "Add setup_tools performance metrics to Soong protobuf file." 2020-12-16 17:21:50 +00:00
Christopher Parsons
61f6eb6664 Merge "Use aquery to declare bazel actions in the ninja file." 2020-12-16 15:59:27 +00:00
Treehugger Robot
abada78f05 Merge "Always track transitive dependencies for host." 2020-12-16 13:14:28 +00:00
Colin Cross
7cd23e3d02 Merge "Revert "Sandbox genrule tools"" 2020-12-16 02:53:25 +00:00
Colin Cross
0096047180 Revert "Sandbox genrule tools"
This reverts commit 3a150d6951.

Reason for revert: b/175743249

Bug: 124313442
Bug: 175743249
Change-Id: Id1695df7b83bf057511f856b40cf7d5413030270
2020-12-16 02:52:32 +00:00