Commit Graph

34111 Commits

Author SHA1 Message Date
Treehugger Robot 5b72de988f Merge "Add ctx to AndroidMkExtraEntriesFunc" am: 277303f042
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1360943

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5bd4388e45b8e09998819fc5417900d2b9fba58f
2021-02-23 00:45:42 +00:00
Treehugger Robot 3e97f39674 Merge "Limit the number of the Java source files in a single compilation unit" am: a61a042fa6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1590694

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib2fc03fc0e30e99b530bb130c16a358511b027ce
2021-02-23 00:45:18 +00:00
Treehugger Robot 7daedc9c56 Merge "Add modules-utils-build_system to allowed deps" am: 4c666e81d0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1596933

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic87c8e30200b566ef8209154f84d27d64b31b0f0
2021-02-23 00:44:44 +00:00
Treehugger Robot 05785f0023 Merge "bootimg supports building (non-vendor) boot.img" 2021-02-22 23:53:15 +00:00
Paul Duffin d24432aaf0 Merge "Add tests for exported generated headers" am: bc179bc44f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1595275

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaf8fbc43d59ad31c722ab04f925bbdf6e0f2c387
2021-02-22 23:27:46 +00:00
Treehugger Robot 277303f042 Merge "Add ctx to AndroidMkExtraEntriesFunc" 2021-02-22 22:40:31 +00:00
Treehugger Robot a61a042fa6 Merge "Limit the number of the Java source files in a single compilation unit" 2021-02-22 19:54:00 +00:00
Paul Duffin 7a7d067c74 Generated headers may not be arch specific
Previously, it was assumed that generated headers must be arch specific
and so prevented the fields referencing the paths to those headers from
being automatically optimized by the sdk generation code. That is not
always the case, e.g. with headers generated from protos so this change
allows those fields to be optimized.

Bug: 180427921
Test: m nothing
Change-Id: Id2af419d58ae3c30ea6d9e87f71e33a9ff6ba13b
2021-02-22 18:23:22 +00:00
Paul Duffin 42dd4e6cd6 Fix the snapshot handling of generated headers
Previously, the snapshot handling code did not preserve the directory
structure of generated include directories and instead just copied the
headers into the same module specific directory and added that single
directory to the export_include_dirs (or similar) property.

That had a couple of issues:
* The include directory was repeated in the ..._include_dirs property.
* It did not work when the include directories overlapped.

In the latter case it had a couple of issues:
* Code which compiled fine against the source would not compile against
  the prebuilt.
* Header files were duplicated in the output.

e.g. assume the following generated header file structure:
  foo/
      foo.h
  bar/
      bar.h
      baz/
          baz.h

When the sdk snapshot was passed include directories of "foo", "bar" and
headers of "foo/foo.h", "bar/bar.h", "bar/baz/baz.h" it would generate a
snapshot with the structure:
  include_gen/
      foo.h
      bar.h
      baz/
         baz.h

And:
  export_include_dirs: ["include_gen", "include_gen"]

However, when the include directories overlapped and include directories
of "foo", "bar" and "bar/baz" were passed in the directory structure
would be the same and the export_include_dirs would contain 3 usages of
"include_gen".

That meant that source code which used the following would build
against the source (because it would find "baz.h" in the "bar/baz"
include directory) but would fail when built against the prebuilts
because the "include_gen" directory did not contain "baz.h":
    #include "baz.h"

This change preserves the input directory structure for generated files
in a similar way to how it does it for source files. So, the snapshot
structure looks something like this:

  include_gen/
      foo/
          foo.h
      bar/
          bar.h
          baz/
              baz.h

And:
  export_include_dirs: [
    "include_gen/foo",
    "include_gen/bar",
    "include_gen/bar/baz",
  ],

Bug: 180427921
Test: m nothing
Change-Id: Id69eef8cf5eecd033841d3b7cd0c044a697ce404
2021-02-22 18:23:22 +00:00
Paul Duffin 86b02a7962 Differentiate usages of word "include" in cc_sdk_test.go
A number of tests in cc_sdk_test.go use "include" for the input include
directory which results in the output containing "include/include"
(because the snapshot code uses "include" as the directory into which
native headers will be output). This change switches the inputs from
"include.." to "myinclude.." to differentiate between the two sources.

Bug: 180427921
Test: m nothing

Change-Id: Iba1e6d94647c74b31307b18254c03580e64c91cf
2021-02-22 18:23:22 +00:00
Paul Duffin a43f927cd6 Add sdk test for incorrect handling of generated headers
Bug: 180427921
Test: m nothing
Change-Id: I3d7ff2625eb5c6f5ed5e094da2a5ce6acc0c987c
2021-02-22 18:23:22 +00:00
Paul Duffin 75b902a964 Separate versioned/unversioned testing in sdk/cc_sdk_test.go
Uses new capability added in previous change to separate the testing of
the versioned and unversioned snapshots in sdk/cc_sdk_test.go. Any test
that generated an _snapshot module that simply listed the modules and
did not check a new type only tests the unversioned output to reduce
the duplication and cost of changing the tests.

Bug: 180479010
Test: m nothing
Change-Id: If11f82b3dd8ec79110b3a2f5adf193b6464000ab
2021-02-22 18:23:22 +00:00
Paul Duffin d075907d29 Support testing versioned/unversioned sdk Android.bp files separately
Previously, the only way to test the Android.bp file generated by the
sdk module was to test both the unversioned and versioned parts
together. This change allows them to be tested separately.

Bug: 180479010
Test: m nothing
Change-Id: I3d695bcfbff030a6da393283ab30ec0979fb2826
2021-02-22 18:23:22 +00:00
Treehugger Robot 4c666e81d0 Merge "Add modules-utils-build_system to allowed deps" 2021-02-22 18:22:46 +00:00
Paul Duffin 37e0de5004 Only export sysprop headers in exported sysprop include directory
Bug: 180712399
Test: m nothing
Change-Id: Ia93d20fe0fecf977773257fa43fe40e7fe9f024f
2021-02-22 18:05:18 +00:00
Paul Duffin 33056e8a9a Export aidl, proto and sysprop generated headers separately
Previously, a cc library that included .aidl, .proto and/or .sysprop
files and exported headers generated from at least one of those types
would actually export generated headers from all of them.

While headers generated from .sysprop files are always exported those
generated from .aidl or .proto should only be exported when explicitly
requested.

This change treats them separately as expected. It has the potential
to break the build as it could reduce the set of headers exported and
so a dependent module that needed those would break. The fix in that
case is to simply add one (or both) of the following to the module
that previously exported those headers:

  aidl: {
    export_aidl_headers: true,
  }

  proto: {
    export_proto_headers: true,
  }

Bug: 180712399
Test: m droid
Change-Id: I488182e27dd423d261443612f98d5c112dd3ef8f
2021-02-22 18:05:10 +00:00
Paul Duffin bc179bc44f Merge "Add tests for exported generated headers" 2021-02-22 18:03:00 +00:00
Treehugger Robot bcf3d3411c Merge "update apex/allowed_deps.txt" am: d4b9d04557
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1597975

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iafdcea7b0191e1beffc22e5ace5e4ed5eb716496
2021-02-22 17:19:32 +00:00
Ulya Trafimovich 8c35fcf4d5 Add non-fatal mode for verify_uses_libraries check.
The new mode is enabled with environment variable
RELAX_USES_LIBRARY_CHECK. If the variable is set to true, then a
verify_uses_libraries check failure does not fail the build, instead it
sets a special compiler filter "extract" for dexpreopt, which means that
the DEX file will be extracted, but it won't be compiled to native code.
Class loader context will be set to empty in this case (not &, as it is
going to be deprecated soon).

If the variable RELAX_USES_LIBRARY_CHECK is unset or set to something
other than "true", then the old behaviour of the verify_uses_libraries
check is preserved.

The intended use case for this flag is to have a smoother migration path
for the Java modules that need to add <uses-library> information in
the build files. The flag allows to quickly silence build errors. This
flag should be used with caution and only as a temporary measure, as it
masks real errors and affects performance.

verify_uses_libraries check is reworked so that it writes the error
message to a status file (which is used instead of the former timestamp
file). Currently the stored error message is not used, but it may be
used later to produce a warning. Dexpreopt command checks if the status
file exists and is nonempty; if that is the case, then compiler filter
is set to "extract".
Bug: 132357300

Test: Manually add some mismatch between the libraries in the Android.bp
      and Android.mk files for dexpreopted apps, build with
      RELAX_USES_LIBRARY_CHECK=true and obsserve that the build doesn't
      fail and they are compiled with compiler-filter "extract".
      Unset RELAX_USES_LIBRARY_CHECK and observe that the build fails.

Change-Id: Ibb5d993a25b1df1d2e70b7d5aafc6997f9d64e67
2021-02-22 15:41:03 +00:00
Treehugger Robot d4b9d04557 Merge "update apex/allowed_deps.txt" 2021-02-22 15:38:08 +00:00
Jingwen Chen ba369adff1 bp2build: Unexport GenerateBazelTargetsForDir.
Resolving a comment from aosp/1595678

Test: build/bazel/scripts/milestone-2/demo.sh
Change-Id: Ia7aba2b149fc09615fbafee67838632c71320f1b
2021-02-22 10:22:58 -05:00
Anton Hansson 17a2d5439d Merge "Remove sdkext apex_available allowlist" am: f19be717c6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1597936

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I00f4c829c6954ee446bd7221ed035e7774fe1326
2021-02-22 13:24:42 +00:00
Anton Hansson f19be717c6 Merge "Remove sdkext apex_available allowlist" 2021-02-22 12:20:00 +00:00
Christoffer Quist Adamsen e850737ee4 Allow missing classes in R8 builds
Bug: 180878971
Bug: 72683872
Test: TARGET_PRODUCT=aosp_arm64 m -j core-oj
Change-Id: I663220567eb8f034d3efccc60228aef91c716e8e
2021-02-22 12:09:01 +00:00
Treehugger Robot 1326be14e1 Merge "Add phony target for depsinfo." am: 4b5c5f9283
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1594091

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I58eed9ca879b5ebeac93f3db517b9f96f44cbc39
2021-02-22 11:47:23 +00:00
Lorenzo Colitti 97ca28e990 Add the new NetworkStack shim libraries to APEX allowed deps.
These are not currently tracked before because the shims are just
filegroups. aosp/1598155 is turning them into libraries so each
shim can build with the appropriate SDK version.

Test: m
Change-Id: I9df3dd98d46f49943211cb0893493d628ddd157c
Merged-In: I9df3dd98d46f49943211cb0893493d628ddd157c
2021-02-22 20:32:34 +09:00
Anton Hansson 6536ad7d0f Remove sdkext apex_available allowlist
Not needed anymore.

Bug: 180886919
Test: m
Change-Id: I1f716076eeb44c979e92b767ea67692649e1bfb4
2021-02-22 10:08:40 +00:00
Thiébaud Weksteen 9997ea73a3 Setup ANDROID_RUST_VERSION env variable
Some crates (i.e. rustversion) probe at build time the version of Rust
to enable features or tests. Pass the version via an environment
variable so it can be used by a patched crate.

Bug: 178357400
Test: m librustversion
Change-Id: If57a6339b71d2188c56e7dc6709075e4537403b4
2021-02-22 10:56:43 +01:00
Treehugger Robot 4b5c5f9283 Merge "Add phony target for depsinfo." 2021-02-22 09:32:21 +00:00
Jingwen Chen 2789ba7d90 Merge "bp2build: add a simple UI to report migration progress." am: 2391d08872
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1595678

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic82236128dd783244312e02fe52d9e4fc07281a0
2021-02-22 03:50:36 +00:00
Jingwen Chen 2391d08872 Merge "bp2build: add a simple UI to report migration progress." 2021-02-22 03:23:13 +00:00
Xin Li 982c52b034 Merge ab/7061308 into stage.
Bug: 180401296
Merged-In: I4638ba660a8cc1748693224ac15e6aa6cad33646
Change-Id: I24dd13b52b3f3a007d79753e32cb64e7f36df47c
2021-02-21 09:24:23 -08:00
Justin Yun efb6015365 Merge "Update test_min_api_level for cc_test" am: b4697b8125
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1581288

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2fb48996e24f3e2077f24d2cd315f90408c5f29b
2021-02-21 06:15:11 +00:00
Justin Yun b4697b8125 Merge "Update test_min_api_level for cc_test" 2021-02-21 05:36:37 +00:00
Jeongik Cha 79f4ab21db update apex/allowed_deps.txt
Bug: 150820813
Test: m

Change-Id: Ib8ada6607b628a120103b64ea83132b3f3e6492e
Merged-In: Ib8ada6607b628a120103b64ea83132b3f3e6492e
2021-02-21 00:11:59 +09:00
Jeffrey Vander Stoep 5d74189766 Merge "Disable unnecessary_wraps clippy lint" am: 8348e09173
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1595277

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If201dbc06c358a1a8efb09877cec12c96f9d516a
2021-02-20 08:01:58 +00:00
Jeffrey Vander Stoep 0c9997fa96 Merge "Update Rust toolchain to 1.50.0" am: 92c674dc32
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1593172

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I196245cc33e47c3379889a7d138e2df84f8dd692
2021-02-20 07:59:33 +00:00
Jeffrey Vander Stoep 8348e09173 Merge "Disable unnecessary_wraps clippy lint" 2021-02-20 07:06:41 +00:00
Jeffrey Vander Stoep 92c674dc32 Merge "Update Rust toolchain to 1.50.0" 2021-02-20 07:06:41 +00:00
Treehugger Robot 7a7c1491c4 Merge "Remove EnforceRROExemptedTargets" am: f0a869847a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1596231

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If42cf3890310274bed9fd9b9e2679c9abb59a82b
2021-02-20 03:06:04 +00:00
Treehugger Robot f0a869847a Merge "Remove EnforceRROExemptedTargets" 2021-02-20 01:47:43 +00:00
Justin Yun 107a4cb56c Update test_min_api_level for cc_test
By replacing MinApiLevelModuleController with
ShippingApiLevelModuleController, we don't need to define
api-level-prop option. The property name must not be a parameter but
be defined in the module controller.

test_min_sdk_version is removed as it is not used.

Bug: 178990561
Test: atest vts_core_liblp_test
Change-Id: Ib4660b91c7adb2ec8b970197dc6f65b8e6952a66
2021-02-20 00:46:21 +00:00
Elliott Hughes 8198c438ca Merge "__ANDROID_UNGUARDED_AVAILABILITY__ is gone now." am: 272649ceb5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1596932

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I875ed4c6f9557776f5a699f492d534bca618bf1d
2021-02-19 23:19:51 +00:00
Colin Cross aa2555387d Add ctx to AndroidMkExtraEntriesFunc
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.

Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2021-02-19 23:05:40 +00:00
Elliott Hughes 272649ceb5 Merge "__ANDROID_UNGUARDED_AVAILABILITY__ is gone now." 2021-02-19 22:27:11 +00:00
Evan Severson 5149805dcc Add modules-utils-build_system to allowed deps
Test: Treehugger
Bug: 178426097

Change-Id: I4c485b32c3479e08077206d497185b21aad45631
2021-02-19 10:59:54 -08:00
Elliott Hughes 5a8c9531e4 __ANDROID_UNGUARDED_AVAILABILITY__ is gone now.
So no need to keep `-D`ing it.

Bug: http://b/179067538
Test: treehugger
Change-Id: If5bcead40d3bb355c241e363a8f1a956cb144438
2021-02-19 10:43:19 -08:00
Julien Desprez fb7470923a Merge "Switch cc_test host_supported: true to unit tests" am: 251261d01b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1576042

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I36b3a8637e0f44de1f8372dc3b59419eba4933fa
2021-02-19 17:36:32 +00:00
Paul Duffin 3cb603eb51 Add tests for exported generated headers
Improves the test coverage for exporting of generated headers. These
tests highlight the bug described in b/180712399.

Follow up changes will refactor and fix bugs in this code. Adding the
tests separately help ensure that those changes do not inadvertantly
change the behavior.

Test: m nothing
Bug: 180712399
Change-Id: I0225b0cf53259071edb99a94be5014ed0e019bde
2021-02-19 17:12:01 +00:00
Julien Desprez 251261d01b Merge "Switch cc_test host_supported: true to unit tests" 2021-02-19 16:55:04 +00:00