Commit graph

20631 commits

Author SHA1 Message Date
Jooyung Han
3992b7c486 Merge "Fix __ANDROID_SDK_VERSION__=0" 2020-07-24 02:07:03 +00:00
Dan Willemsen
1a4ab20c1a Merge "Revert "Support per-module MakeVars"" 2020-07-23 21:43:04 +00:00
Dan Willemsen
613564eed4 Revert "Support per-module MakeVars"
This reverts commit 2019658b86.

Reason for revert: broke builds where makefiles were using M4 without depending upon it

Change-Id: I18304246e7a8a8f8c2620dd2c65ed77acd256be2
2020-07-23 21:37:35 +00:00
Dan Willemsen
4ec839a251 Merge changes from topics "prebuilt_build_tool", "prebuilt_build_tool_make"
* changes:
  Support per-module MakeVars
  Switch cc's use of bison and flex to prebuilt_build_tool
  Add prebuilt_build_tool to allow genrules to use prebuilt tools
2020-07-23 21:10:04 +00:00
satayev
71c96d1e1d Merge "Revert "Track allowed transitive deps in any updatable module."" 2020-07-23 15:20:18 +00:00
satayev
53bbc085e4 Revert "Track allowed transitive deps in any updatable module."
Revert submission 1312796-apex-allowed-deps

Reason for revert: b/161974327
Reverted Changes:
I52a4be72e:Add a check for apex/allowed_deps.txt to droidcore...
I56771ba3f:Track allowed transitive deps in any updatable mod...

Change-Id: I3be0a1b0dd824dafeadb485daca8e58b81a3ec5c
2020-07-23 15:15:54 +00:00
Treehugger Robot
0ec8c508a4 Merge "Add SettingsRoboTests to the allow-list for legacy core/platform API." 2020-07-23 13:33:46 +00:00
Ivan Lozano
f90e64a34f Merge "Call rustfmt on rust_bindgen bindings." 2020-07-23 12:41:58 +00:00
satayev
a71cf86853 Merge "Track allowed transitive deps in any updatable module." 2020-07-23 12:41:11 +00:00
Pete Gillin
9f4893d86f Add SettingsRoboTests to the allow-list for legacy core/platform API.
Bug: 161967461
Test: m SettingsRoboTests
Merged-In: I15e5a6c2f07e73718803501d705de0d7ab9bec90
Change-Id: If4e58fba5f74dd06457497c1d131bc1f273f6f5b
2020-07-23 12:34:07 +01:00
Pete Gillin
4ab239ec57 Merge "Enforce the legacy core/platform API restriction." 2020-07-23 10:40:37 +00:00
Pete Gillin
84c3807b99 Enforce the legacy core/platform API restriction.
This change silently decides whether modules which depend on either
sdkPrivate or sdkCorePlatform get the legacy or the stable version of
the core/platform API, based on whether the module's name is on a
hard-coded list or not.

Test: m java
Test: make a target from the list when its entry is commented out, which correctly fails
Bug: 157640067
Change-Id: I15e5a6c2f07e73718803501d705de0d7ab9bec90
Merged-In: I15e5a6c2f07e73718803501d705de0d7ab9bec90
Merged-In: Iaa97ddaa015e8079fcb3426585c5101c7ec9e22a
(cherry picked from commit c0f4373106)
2020-07-23 09:06:52 +01:00
Jooyung Han
de34d2375f Fix __ANDROID_SDK_VERSION__=0
__ANDROID_SDK_VERSION__ for a cc module means API level of which the
module should work with.

For APEX variants, it should be apex.min_sdk_version and tracked by the
variable cc.Module.apexSdkVersion.

The variable was set in the wrong place and used uninitialized
sometimes, which results __ANDROID_SDK_VERSION__=0.

Bug: n/a
Test: m
Test: checked build.ninja manually
      => no __ANDROID_SDK_VERSION__=0
Change-Id: Iba532b2c62773983414a061f5291a73363322487
2020-07-23 05:01:56 +00:00
Paul Duffin
50f0da4205 Improve IDE navigation to SdkBase methods
Previously, it was not possible to navigate directly from the interface
methods in SdkAware to the implementations in SdkBase as the former
embeds android.Module but the latter did not implement those methods
and so did not implement SdkAware. Finding the implementation of those
methods required explicitly searching for them.

This change extracts sdkAwareWithoutModule interface to allow use of
the IDE capability to navigate directly to implementations of an
interface method.

Test: m nothing
Change-Id: I0cd25180ea0081a54681b58e3202ff9491563131
2020-07-22 23:36:11 +01:00
Ivan Lozano
ec54eec571 Call rustfmt on rust_bindgen bindings.
This makes debugging easier when the bindings contain errors.

Bug: 161730753
Test: Generated bindings are formatted.
Change-Id: Ic46f69d8b6d07b4dc6912b7f02d7427ea6c11cde
2020-07-22 16:51:33 -04:00
Ivan Lozano
9429c612ff Merge "Add source collision test, rust_bindgen doc." 2020-07-22 17:44:03 +00:00
Christopher Parsons
6b3d9c3fe8 Merge "Create 'cc_prebuilt_test_library_shared' module type" 2020-07-22 17:35:34 +00:00
Chris Parsons
1f6d90f4c7 Create 'cc_prebuilt_test_library_shared' module type
This new module type allows cc_test modules to depend on prebuilt
shared libraries and have them included as data dependencies alongside
the test binary.

Test: Manually verified to facilitate mk-to-bp migration of
bionic-unit-test prebuilt dependencies (aosp/1339035)

Change-Id: Idbac0854f1f9e2e01bbfa63591de458b61733e17
2020-07-22 16:06:37 +00:00
Ivan Lozano
10735d90d6 Add source collision test, rust_bindgen doc.
Bug: 159064919
Test: Soong tests pass (and fail if error is modified).
Change-Id: Id4f76e53e11e46ae495f9613a2699c598e7daea4
2020-07-22 09:18:13 -04:00
Treehugger Robot
188f2ee1ee Merge "Use RelativeInstallPath for DataPaths in apex" 2020-07-22 05:55:01 +00:00
Treehugger Robot
d2946c3ea3 Merge "Provide generated sources to clippy." 2020-07-22 01:30:49 +00:00
Yi Kong
f9a78248b0 Merge changes I90df9c04,I70bb8dc2
* changes:
  [pgo] Allow profile gather and use flags to coexist for sampling PGO
  [pgo] Sampling PGO does not require benchmark property
2020-07-22 00:46:42 +00:00
Liz Kammer
0a51aa2c98 Use RelativeInstallPath for DataPaths in apex
The RelativeInstallPath is currently unused for apexes; however, as it
stands, relative install paths would be handled differently for
flattened and unflattened apexes.

Test: go java test
Test m nothing

Change-Id: Iad9350642cad27c4f745cea6e5fc9e11e7b06ee4
2020-07-21 13:29:37 -07:00
Ivan Lozano
bae62bee7d Provide generated sources to clippy.
clippy was not being provided generated sources previously, so it would
error out on being unable to locate the sources.

Test: Clippy no longer errors out on generated sources.
Bug: 161748694
Change-Id: I85907327ca40c82a9520e0c0dbd643bfba6b7315
2020-07-21 14:24:35 -04:00
Yi Kong
a575ff38a8 [pgo] Allow profile gather and use flags to coexist for sampling PGO
Bug: 79161490
Test: presubmit
Change-Id: I90df9c04dbe2a423c06e9a966fe9bcaed0a84a65
2020-07-22 02:01:49 +08:00
Yi Kong
84803c50a6 [pgo] Sampling PGO does not require benchmark property
Test: build with Sampling PGO
Bug: 79161490
Change-Id: I70bb8dc2e4492d6a3713ca16fcb3f1216615f8ac
2020-07-22 01:36:20 +08:00
Christopher Parsons
fef9d4b601 Merge "Install data_libs using relative_install_path property" 2020-07-21 17:26:57 +00:00
Jingwen Chen
8481186d56 Fix dist(s)-with-tag and add tests to prevent regression.
While AndroidMkEntries' DistFiles were populated from java_library
properly, there was a bug in the conditionals that dropped the tagged
DistFiles.

Fixes b/152834186
Fixes b/161339864

Test: soong tests, m sdk dist (creates out/dist/test.jar with
aosp/1363578)

Signed-off-by: Jingwen Chen <jingwen@google.com>
Change-Id: Id895282256fd367b2f46dcb7a643465fa66c9456
2020-07-21 12:30:39 +00:00
Treehugger Robot
0bcda81dd5 Merge "Generate module lib API and scope together" 2020-07-21 04:21:07 +00:00
Treehugger Robot
30c22b9c7a Merge "Add dist target for robolectric-tests.zip" 2020-07-21 02:03:36 +00:00
Colin Cross
cf0e4220eb Add dist target for robolectric-tests.zip
Also remove stray fmt.Println.

Test: m robolectric-tests
Change-Id: Ia463c2b395fadd6ab33b2ce8364f2119b2a2be1e
2020-07-20 17:19:02 -07:00
Ivan Lozano
c3b1a61253 Merge changes from topic "rust_bindgen"
* changes:
  Allow rust module dependency on SourceProviders.
  Add SourceProviders and a rust_bindgen module type
2020-07-20 21:18:33 +00:00
Paul Duffin
15f34ef811 Generate module lib API and scope together
Previously, due to limitations in metalava the module lib API and stubs
source were generated separately. That limitation has since been
removed so this change optimizes the generating code.

Changes:
* Add an annotation field to apiScope to contain the annotation that
  identifies the scope.
* Rename droidstubArgs to extraArgs to better reflect that they are not
  passed to droidstubs.
* Rename droidstubsArgsForGeneratingStubsSource to droidstubsArgs.
* Remove droidstubsArgsForGeneratingApi and
  createStubsSourceAndApiTogether fields along with code that supports
  generating stubs source and the API separately.
* Fix the module lib test.

Test: m checkapi
Bug: 161364853
Change-Id: I821886bb68645addf5ae9c96ed2f4f3649151d1a
2020-07-20 20:51:25 +01:00
Colin Cross
dd35943b62 Merge "Add environment variables to control lint checks" 2020-07-20 18:50:09 +00:00
Colin Cross
f0ba57bf33 Merge "Package robolectric tests for tradefed" 2020-07-20 18:27:17 +00:00
Chris Parsons
216e10a0f6 Install data_libs using relative_install_path property
Test: Added to data_libs tests
Test: Manually verified with bionic-unit-tests
Test: Treehugger
Change-Id: I28a8e08e3409f1e7c7bb72f4351310b57f35f513
2020-07-20 13:59:24 -04:00
Ivan Lozano
43845688bc Allow rust module dependency on SourceProviders.
Allow rust modules to depend on and use generated source code provided
by SourceProvider modules and genrule modules without resorting to
hardcoded output paths.

All generated sources are now copied to a dependent module's
intermediates directory, then OUT_DIR is set to point to that path when
calling rustc. This matches the common convention used in most rust
crates to include generated source code from the path defined in the
OUT_DIR environment variable.

A couple other small notable changes are included in this CL:

* prebuiltLibraries can no longer include generated source files as they
  should be prebuilt.
* srcPathFromModuleSrcs now excludes the main source file from the
  second return value so its a list of only the generated sources.

Bug: 159064919
Test: Local example rust_library compiles with rust_bindgen dependency.
Test: Local example rust_library compiles with genrule dependency.
Test: Collision detected when multiple providers produce similar output.
Test: New Soong tests pass.
Change-Id: I59f54a25368c680b9086420c47ec24ab8cd1de6b
2020-07-20 13:40:31 -04:00
Ivan Lozano
4fef93c53f Add SourceProviders and a rust_bindgen module type
Add SourceProvider modules which provides a base interface for more
complex code generation usecases such as bindgen. Also adds the
rust_bindgen module type which calls bindgen to generate Rust FFI
bindings to C.

Bug: 159064919
Test: Local test module generates bindings.
Test: New Soong tests pass.

Change-Id: Ie31467bbbe423497666ad837cf5fe1acd1e76bd8
2020-07-20 13:40:14 -04:00
Treehugger Robot
5df3439377 Merge "Add compile_multilib properties to all native prebuilts (reland)." 2020-07-20 15:19:33 +00:00
Artur Satayev
453555083b Track allowed transitive deps in any updatable module.
Instead of tracking per module and per module variant, track allowed
list of dependecies for all modules combined. This avoids issues with
different products and different downstream branches having different
build graphs.

To compare allowed_deps.txt vs head, run:
:; m -j out/soong/apex/depsinfo/new-allowed-deps.txt.check

To update source allowed_deps.txt, run:
:; build/soong/scripts/update-apex-allowed-deps.sh

Bug: 149622332
Test: m
Change-Id: I56771ba3fea748de8e9c58c80758670572f7af53
Merged-In: Ic518fbd9ebfe1b46aaf9a58df731780a7e5a676b
2020-07-20 12:22:26 +01:00
Colin Cross
8eebb135b3 Package robolectric tests for tradefed
Package a slightly modified copy of the robolectric tests with
the dependencies statically included into the testcases directory
and into a robolectric-tests.zip.

Test: m robolectric-tests
Change-Id: I73f51727695136d2a849d36af1683e93f7e156a3
2020-07-19 19:33:40 -07:00
Treehugger Robot
f70ceecc4c Merge "apex_set is force disabled when necessary" 2020-07-20 01:17:06 +00:00
Dan Willemsen
2019658b86 Support per-module MakeVars
This allows setting per-module make variables earlier in the build,
particularly for prebuilt_build_tool users like LEX/M4/BISON. I moved
filegroup over because it's a simpler common interface, but it doesn't
strictly need it.

With this, the last user of the hardcoded cc.m4Cmd variable is gone.

Test: Inspect out/soong/make_vars-*.mk, out/soong/late-*.mk
Test: treehugger
Change-Id: I195b688131feac0c100c338a0749368aa5d50f4f
2020-07-17 20:07:33 -07:00
Dan Willemsen
d2e291ae5c Switch cc's use of bison and flex to prebuilt_build_tool
Test: treehugger
Change-Id: I6150f0f39151e8073d5d59fe189f614140fed57b
2020-07-17 20:07:16 -07:00
Dan Willemsen
13af8140bc Add prebuilt_build_tool to allow genrules to use prebuilt tools
cc_prebuilt_binary doesn't work well for host tools because they'll
often be using their own versions of shared libraries that may not be
compatible with what we build.

So add a module type that allows genrules to use one of these prebuilts
as a tool. Like other prebuilts, we'll use the source module if we have
it, or the prebuilt otherwise.

It supports adding extra dependencies for shared libraries or other data
files that are necessary to run the tool. Any genrules using the tool
will be rerun if any of the dependencies change.

Bug: 128690776
Test: treehugger (builds one-true-awk with bison)
Change-Id: I82c26be1c3c9fe6cab42892ddea339c301c0b316
2020-07-17 19:34:12 -07:00
Makoto Onuki
d3cd2f5793 Merge "Repeat metalava errors at the end to make it easy to find them" 2020-07-18 02:29:36 +00:00
Makoto Onuki
0df103ae71 Repeat metalava errors at the end to make it easy to find them
Also suppress "unresolved import" messages.

Bug: 161374683
Test: Introduce a lint error, run "m update-api" and make sure the
    error shows up at the end.
Change-Id: Ib5250f7f9593dc4f89f9e7f6dc614e230a966e8f
2020-07-17 15:38:10 -07:00
Dan Willemsen
59415ca60d Merge "Add support for macOS 11 SDK" 2020-07-17 21:33:26 +00:00
Treehugger Robot
f8b85dedde Merge changes Ide9c7a6a,I706c1433
* changes:
  Add Validations to android.BuildParams
  Use validations for blueprint tests
2020-07-17 19:54:49 +00:00
Martin Stjernholm
89238f4703 Add compile_multilib properties to all native prebuilts (reland).
There was a special case in cc_prebuilt_binary only, which resulted in
prebuilt libraries getting both 32 and 64 bit variants even when their
sources only had one of them, and the other variant would be defunct
since it wouldn't get any prebuilt artefact.

This moves the handling of compile_multilib completely to the common
update code, so that SDK members don't need to deal with it. It doesn't
take SDK member defaults into account, which means a bit more
boilerplate in the snapshots, but it's simpler and less error prone
(different SDK member types have different defaults).

This relands https://r.android.com/1359962 after disabling the SDK
tests on mac once and for all.

Bug: 151303681
Test: `go test -v ./sdk` in build/soong on mac and linux
Change-Id: I05f6603b2ac9b8676b25c3e297165ca23284e9cc
2020-07-17 14:32:15 +01:00