Commit graph

20863 commits

Author SHA1 Message Date
Matthew Maurer
53bba5de8a Merge "Make Rust test harness optional for test binaries" 2020-08-05 21:26:45 +00:00
Ivan Lozano
d13b308960 Merge "Make source_stem required for Rust SourceProviders" 2020-08-05 19:38:19 +00:00
Steven Moreland
9cd45782e5 allow empty phony modules
In order to allow reservation of names in the build system.

Bug: 162275959
Test: build only
Change-Id: I8f1622bdbebe794dafd5c341d861da5468cd52bd
2020-08-05 19:31:54 +00:00
Ivan Lozano
80668b07d2 Merge "Add support for custom bindgen binaries." 2020-08-05 19:08:20 +00:00
Liz Kammer
9c55b0efa2 Merge "Add property api_levels_jar_filename to droidstubs" 2020-08-05 19:05:13 +00:00
Thiébaud Weksteen
6090575f63 Merge changes I275f0463,Ie736d7eb
* changes:
  rust: handle modules with same crate_name
  rust: validate existence of library source
2020-08-05 18:50:06 +00:00
Bill Peckham
6ed589039c Merge "Adds 'kernel/' to vendor proprietary dirs." 2020-08-05 18:14:52 +00:00
Ivan Lozano
ff3a5b31c0 Make source_stem required for Rust SourceProviders
This removes ambiguity for developers with the 'stem' property.

Bug: 159064919
Test: New Soong test; error is produced if this property is undefined.
Change-Id: I790fbcfa6cd7dbf6df63b5cf5c22983426ec072e
2020-08-05 13:31:34 -04:00
Pirama Arumuga Nainar
f45e152e15 [cc/coverage] Pass directory to -fprofile-instr-generate
Bug: http://b/157081822

This will be used if LLVM_PROFILE_FILE is not set at runtime.  Some
bionic tests are run without LLVM_PROFILE_FILE set and if they are run
from '/', they fail unable to write to '/default.profraw'.  This may
affect other tests as well.  Setting this to the value defined by
init.rc.

Test: Enable coverage for bionic, ensure relevant bionic-unit-tests
pass.

Change-Id: If1d0e16ce003149fb21d5472d10699ef6582e065
2020-08-05 10:23:07 -07:00
Liz Kammer
9eb51fc9d4 Merge "Refactor java compileDex" 2020-08-05 15:41:03 +00:00
Nicolas Geoffray
b0df23f201 Add platform-mainline-test-exports in list of modules to build.
Needed for ART testing.

Bug: 142935992
Test: build-mainline-modules.sh

Change-Id: I842feff85f88ecc2c7db1e84e803d9e8149923af
2020-08-05 15:56:21 +01:00
Ivan Lozano
c564d2d5a4 Add support for custom bindgen binaries.
In some cases customized logic is required to generate the expected
bindgen bindings. This adds support for rust_bindgen modules to define a
HostTool module to use instead of bindgen.

Bug: 161816141
Test: New Soong tests pass.
Test: Local test case shows custom_binary module being used for bindgen
      generation.

Change-Id: Id52aec4f25c38206d7e585d8e662be7836aa1d4b
2020-08-05 10:51:43 -04:00
Martin Stjernholm
42e6dabe81 Merge "Disable all host OS variants except those explicitly included." 2020-08-05 14:50:48 +00:00
Thiébaud Weksteen
ad8ac53581 rust: handle modules with same crate_name
crate_name do not need to be unique. A library may depend on two
different versions of the same crate. Use the module name instead of the
crate name when indexing the modules for rust-project.json.

Test: SOONG_GEN_RUST_PROJECT=1 m nothing
Bug: 162896400
Change-Id: I275f04639ef05f2b649c30168046e13b2efcacb9
2020-08-05 16:34:38 +02:00
Ivan Lozano
b14e141519 Merge "[rust] Disable clippy for rust_bindgen modules." 2020-08-05 12:47:14 +00:00
Andrei-Valentin Onea
fe58347aef Merge "Rename hiddenapi manual lists" 2020-08-05 12:42:18 +00:00
Thiébaud Weksteen
891cd578c7 rust: validate existence of library source
While rust_bindgen modules may be interpreted as libraries, they do not
have a reference to the generated source until bindgen has been
executed. For now, ignore these modules.

Update the unit tests to cover the rust_bindgen case.

Test: SOONG_GEN_RUST_PROJECT=1 m nothing
Bug: 162881856
Change-Id: Ie736d7ebb115f2c1f9a90be006c972ce24265c6a
2020-08-05 11:29:33 +02:00
Ulya Trafimovich
249386ad69 Add structured representation for colon-separated jar lists.
With the addition of apexes and /system_ext some of the bootclasspath
and system server jars have moved from /system to the new locations.
This has been implemented by using lists of colon-separated strings
called "apex-jar pairs" (although "apex" was misleading as it could
refer to "platform" or "system_ext", not necessarily a real apex).

Using the colon-separated string representation is inconvenient, as it
requires splitting and reassembling the list components many times,
which harms performance and makes error handling difficult. Therefore
this patch refactors the colon-separated lists into a struct that
hides the implementation details.

Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: Id248ce639a267076294f4d4d73971da2f2f77208
2020-08-05 09:59:30 +01:00
Inseob Kim
74d255698b Separate lists of soong sanitize modules
Dependencies of makefile modules are being redirected according to
SOONG_CFI_STATIC_LIBRARIES and SOONG_HWASAN_STATIC_LIBRARIES. But the
variables are shared among all variants (e.g. core, vendor, product,
arch), which can cause build error.

This splits the Makefile variables into several lists, one list per each
arch and each image variant, to correctly make the redirection.

Bug: 162476652
Test: build and inspect ninja
Change-Id: Icc753382f1c53de8468cc85243a6954e1986297a
2020-08-05 04:47:41 +00:00
Inseob Kim
e498dd9ac3 Move image mutator things to image.go
Bug: N/A
Test: m
Change-Id: I2d1a24fc067c376ed2e0741313d48248ad78ee78
2020-08-05 04:47:28 +00:00
Ivan Lozano
32267c88c4 [rust] Disable clippy for rust_bindgen modules.
bindgen generated code may not pass clippy checks, so preemptively
disable clippy for these.

Bug: 162828070
Test: clippy is not called when compiling rust_bindgen library variants.
Change-Id: I9632c889417bdfd1adf96d9cfbccbe6340824205
2020-08-04 16:27:16 -04:00
Stephen Crane
da931d4abd [rust] Disable lints for generated bindings
Bindgen generated bindings will not pass lints, so we need to disable
them when building bindings crates.

Test: m libbinder_ndk_bindgen
Change-Id: I4536f15f8505ff8d5436f1e6cbc2035e6801276d
2020-08-04 13:04:32 -07:00
Stephen Crane
12e2cb71c7 [rust] Escape flags for bindgen
Bindgen flags and cflags should be escaped, as they may contain shell
globs or other special characters.

Test: Updated Soong test passes.
Change-Id: I3df8ef25391f53a191f0494c5ff8c641d4d4b6f8
2020-08-04 12:29:54 -07:00
Yifan Hong
ea3574b5fa Merge "Support com.android.gki.* in apex_available." 2020-08-04 19:06:08 +00:00
Stephen Crane
02a623d8d3 Make Rust test harness optional for test binaries
Adds a test_harness field to Rust test blueprint properties. If this
field is explicitly set to false, do not build the test binary with
`--test`. This is necessary for Rust tests which cannot use the standard
test harness.

Test: atest rustBinderTest
Test: atest --host proc-macro2_tests_test
Change-Id: Icbcb54422cc716348feae56b2d71f013516b0ac0
2020-08-04 18:57:10 +00:00
Daniel Norman
713387dc75 Adds 'kernel/' to vendor proprietary dirs.
Bug: 161722183
Test: m nothing
Change-Id: I45c9e8623304617268a725ea5f0c353352f80590
2020-08-04 11:36:45 -07:00
Ivan Lozano
89e4882d37 Merge "[rust] Add SourceProviders as crates support." 2020-08-04 17:46:22 +00:00
Liz Kammer
a7a64f3c5b Refactor java compileDex
We want to support a compile_dex property for java_import. This splits
dex-related properties into a dexer struct which can be embedded in
relevant modules.

Test: m
Test: soong tests
Bug: 160455085
Change-Id: If56a51dac43f630d49483a36db29cd50e9ccd529
2020-08-04 10:15:04 -07:00
Liz Kammer
3d894b728a Add property api_levels_jar_filename to droidstubs
The default is android.jar to maintain current behavior but allows users
to specify a different filepath to support generating api-versions for
docs other than the platform (e.g. auto).

Bug: 162552181
Test: m doc
Test: go test java_test
Change-Id: I9e51abaf7d5451d68ca782157d9b739f76c5da82
2020-08-04 09:55:13 -07:00
Andrei Onea
ca79081bde Rename hiddenapi manual lists
Use new names for lists from go/hiddenapi-list-renaming
Bug: 162827370
Test: m

Change-Id: I9522f32faa46d1d49aefad0921ba6d9c427d8779
2020-08-04 15:34:35 +01:00
Ivan Lozano
26ecd6c597 [rust] Add SourceProviders as crates support.
This allows SourceProvider modules to create rust_library variants so
that generated source can be referenced as an external crate rather than
via an include macro. This is done by including rust_bindgen modules
like any other library, as a dependency in either rlibs, dylibs, or
rustlibs.

This renames the stem and flags properties for rust_bindgen modules to
source_stem and bindgen_flags, respectively. This deconflicts with the
usage in baseCompiler.

This also removes 'subName' from the Module struct and moves it over to
SourceProvider, which was the only user. This allows us to set it in
baseSourceProvider's AndroidMk; setting it in Module's AndroidMk was
causing problems finding NOTICE files for bindgen library variants.

Bug: 159064919
Test: New Soong tests pass.
Test: Local test rust_binary can use rust_bindgen module as a crate.

Change-Id: Ieb2cb614c2dd0b5aa7120541d77f6f822a6a1806
2020-08-04 08:13:24 -04:00
Thiébaud Weksteen
9b7b8f169a Fix dependency merging for rust-project.json
Test: SOONG_GEN_RUST_PROJECT=1 m nothing; inspect rust-project.json
Bug: 159591910
Change-Id: I95beb2e75f2306ae2bf2be02ab5f1a348d134b56
2020-08-04 06:36:20 +00:00
Janis Danisevskis
8b7eb8d86a Rust: allow system/security
Bug: 160623310
Test: None
Change-Id: I00ddb0fb26e7e67f832fb321186f7313209c2669
2020-08-03 21:27:41 +00:00
Martin Stjernholm
caa47d7eed Disable all host OS variants except those explicitly included.
Necessary to avoid problems with implicitly enabled host OS'es, e.g.
linux_glibc getting enabled when we only supply a linux_bionic linker
in runtime-module-host-exports. That will then cause a non-functional
prebuilt to take precedence over source if the prebuilt is preferred.

We don't do this for device since we so far only support a single
device OS (android).

This introduces the notion that SDK member types can be host OS
dependent or not. That way java members with host prebuilts don't get
restricted to a specific host OS.

Test: m nothing
Test: build/soong/scripts/build-aml-prebuilts.sh runtime-module-host-exports
  Check that the generated Android.bp correctly disables the bionic
  linker prebuilt for linux_glibc.
Test: art/build/apex/runtests.sh
  on master-art with an updated runtime SDK snapshot
Test: art/tools/buildbot-build.sh {--host,--target}
  on master-art with an updated runtime SDK snapshot
Bug: 160349757
Change-Id: Idad7ef138cdbcbd209d390bf6c10ca8365d4619f
2020-08-03 21:06:50 +01:00
Thiébaud Weksteen
0d333752cf Merge "Move getEdition to a baseCompiler method" 2020-08-03 18:28:43 +00:00
Martin Stjernholm
b4bfd148eb Merge "Set compile_multilib for SDK snapshots for device." 2020-08-03 17:55:25 +00:00
Thiébaud Weksteen
e81c924f0c Move getEdition to a baseCompiler method
Test: cd build/soong; mma
Test: cd external/rust/; mma
Change-Id: Ide63b2e633e7c4345c6338e107f5d66688e4cf58
2020-08-03 11:00:43 +02:00
Nicolas Geoffray
d118b1c2b7 Merge "Fix the lib directory being used for fetching libraries." 2020-08-03 08:24:49 +00:00
Patrice Arruda
79dcf732cc Add newline to each generated bash script in rbe_test.go.
"exec format error" showed up on Mac when running the rbe_test.go.
The generated bash scripts did not have a newline at the end of
the file.

Bug: b/162600461
Fixes: b/162600461

Test: "m blueprint_tools" on Android Mac builder.
Change-Id: I425fa5f428733b6569c3fcdaa312023f9761d020
2020-08-01 17:51:52 +00:00
Treehugger Robot
6aed6a385e Merge "Disable() must not be enabled unexpectedly" 2020-08-01 08:40:06 +00:00
Patrice Arruda
fcb53d9d2a Disable additional RBE metrics upload test errors for now.
Disable the error test cases to allow developers to build
AOSP on Mac.

Bug: b/162600461
Test: m nothing

Change-Id: Ic8c6fe04743a8e4fe197a1bb71259036fb749edc
2020-08-01 01:02:33 +00:00
Treehugger Robot
5acee49d8a Merge "Disable RBE metrics upload test errors for now." 2020-08-01 00:30:33 +00:00
Treehugger Robot
f856693344 Merge "Skip llndk_library and llndk_headers for vendor snapshot" 2020-08-01 00:01:49 +00:00
Treehugger Robot
cf04073b43 Merge "Update language to comply with inclusive guidance" 2020-07-31 22:50:49 +00:00
Patrice Arruda
a8d04fd8ac Disable RBE metrics upload test errors for now.
Disable the error test cases to allow developers to build
AOSP on Mac.

Bug: b/162600461
Test: m nothing
Change-Id: Iac4373dcb10710d8a2325eeb3ee20a6eeca6143f
2020-07-31 22:11:37 +00:00
Ivan Lozano
bbec4c4325 Merge "[rust] Clean up unused link variations." 2020-07-31 20:03:40 +00:00
Treehugger Robot
703ea006e0 Merge "Default to not creating stubs for droiddoc" 2020-07-31 19:32:11 +00:00
Treehugger Robot
0659a96a38 Merge "Update language to comply with inclusive guidance" 2020-07-31 19:18:36 +00:00
Yifan Hong
60a3e7e7ca Merge "Introduce BOARD_KERNEL_BINARIES to soong" 2020-07-31 19:13:44 +00:00
Ivan Lozano
89435d1a50 [rust] Clean up unused link variations.
rust_library modules no longer produce "link" variants alongside
"rust_libraries" variants as the former have been moved to rust_ffi
modules. rust_library modules however still create empty link variants
and code paths still assume that modules can support both rust linkage
and cc linkage. This adds unnecessary complexity that no longer serves a
purpose.

This cleans this up by removing the unused "link" variant for
rust_library modules and simplifies code paths that can now assume
modules are either a rust library or a cc library, but not both.

This also fixes a bug where Shared() was returning the wrong value.

Bug: 159064919
Test: cd external/rust/; mma
Test: cd external/crosvm/; mma

Change-Id: I3b5498c80b315c56b621dcb1388022fecc1bfc1b
2020-07-31 13:53:13 -04:00