Commit graph

32235 commits

Author SHA1 Message Date
Jaewoong Jung
8584130063 Remove patricearruda from OWNERS.
Test: None
Change-Id: I95cbe15188913839352abd9ba37621014885389d
2021-01-06 09:21:00 -08:00
Jaewoong Jung
8bfb63c5a9 Merge "Break up app.go." 2020-12-28 17:50:44 +00:00
Bill Peckham
3d419e3b3d Merge "Automatically set uncompress_dex for java_import." 2020-12-28 17:20:14 +00:00
Justin Yun
31094b10d2 Skip product variant for core-variant VNDK
VNDK "mustUseVendorVariant" option checks only for the vendor
variant. Since the product variant of the VNDK is skipped from
installing, we don't need check product variant for
"mustUseVendorVariant" check.

Bug: 176268903
Test: m libxml2.product
      m libxml2.vendor
Change-Id: I3b10f0579aceca1fb32fa4d6fb21dc020a35874d
2020-12-24 16:11:23 +09:00
Treehugger Robot
2187e41f05 Merge changes I81769f57,I28fb6886
* changes:
  Define vndk.private property for VNDK-private libraries
  'vendor_available: *' will not create product variant
2020-12-24 05:11:31 +00:00
Treehugger Robot
b2d77d4a52 Merge "Use soong_zip -srcjar for proto and aidl srcjars" 2020-12-24 03:04:37 +00:00
Justin Yun
fd9e804470 Define vndk.private property for VNDK-private libraries
To define VNDK-private libraries, we used `vendor_available: false`.
Because of it, `vendor_available == nil` had different meaning from
`vendor_available: false` for the VNDK libraries.
To clarify this, we change the logic for defining VNDK-private
libraries which was:

cc_library {
    name: "vndk_private",
    vendor_available: false,
    product_available: false,
    vndk: {
        enabled: true,
    },
}

It must be replaced with

cc_library {
    name: "vndk_private",
    vendor_available: true,
    product_available: true,
    vndk: {
        enabled: true,
        private: true,
    },
}

Bug: 175768895
Test: m nothing
Change-Id: I81769f57c2231e54b682a28e4b82631ab9f3d390
2020-12-24 10:51:07 +09:00
Colin Cross
cf02ec8747 Use soong_zip -srcjar for proto and aidl srcjars
IntelliJ's indexer is unhappy with the full paths in the proto
and aidl srcjars.  Use the -srcjar argument to soong_zip, which
causes it to extract the correct filename for .java files based on
the package statement in the file.

Bug: 176209347
Test: manual
Change-Id: I63d9d4f6ba670e3b851835d719519d675ae54c7f
2020-12-23 17:13:16 -08:00
Bill Peckham
ff89ffae0b Automatically set uncompress_dex for java_import.
Setting uncompress_dex for java_import in the same way
as java_library enables using a java_import as an art
jar or a boot jar.

Bug: 175619567
Test: m nothing
Test: TestHiddenAPISingletonWithPrebuilt
Change-Id: I0b552a11d1630a014cf978520ccc5977fdf74066
2020-12-23 16:13:04 -08:00
Treehugger Robot
7dbc5786e3 Merge "Fix library order in class loader context to agree with PackageManager." 2020-12-23 19:58:25 +00:00
Ulya Trafimovich
c9f2b9494d Fix library order in class loader context to agree with PackageManager.
PackageManager adds compatibility libraries for different SDK versions
in descending order, and Soong should do the same.

Bug: 132357300

Test: lunch aosp_cf_x86_phone-userdebug && m \
  && launch_cvd \
  && adb wait-for-device \
  && adb logcat | grep -E 'ClassLoaderContext [a-z ]+ mismatch'

  [no messages "ClassLoaderContext classpath element mismatch"]

Change-Id: Ib1d981808ae4022b2c6e73f407a003e8b8e9c7d6
2020-12-23 18:22:26 +00:00
Justin Yun
6977e8a80c 'vendor_available: *' will not create product variant
With this patch, `vendor_available: true` will no longer creates
product variant. Instead, modules need to set `product_available:
true` if they have to be available to product vanriant.
If both properties are defined for VNDKs, they must have the same
values.

Bug: 150902910
Test: m nothing
Change-Id: I28fb6886e6114583227a31151136627c8516ac9c
2020-12-23 18:14:30 +09:00
Anton Hansson
74c8436ce0 Merge "Add attribute to disable last-api compat tracking" 2020-12-23 09:05:46 +00:00
Jaewoong Jung
e794b1e302 Merge "Remove unnecessary snake case variables." 2020-12-23 01:21:28 +00:00
Kalesh Singh
98dea94982 Merge "Reland: Add android.hardware.memtrack-unstable-ndk_platform" 2020-12-23 01:20:51 +00:00
Treehugger Robot
109d9ccdcb Merge "rust modules in APEX don't get installed to the system partition" 2020-12-23 00:42:20 +00:00
Kalesh Singh
7b63b2677d Reland: Add android.hardware.memtrack-unstable-ndk_platform
Bug: 175021432
Test: Fixes build failure on aosp/1518666
Change-Id: Id53bb93bfce35347637a271b7f6aa3c1c4d8c839
2020-12-22 20:49:54 +00:00
Jaewoong Jung
18aefc1977 Remove unnecessary snake case variables.
Test: m nothing + TreeHugger
Change-Id: I99f7162944daa6c57c6ae4763261e108bb5cb6b1
2020-12-22 12:38:35 -08:00
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
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