Commit graph

50691 commits

Author SHA1 Message Date
Colin Cross
063544747e Treat kotlin-annotations the same as kotlin-stdlib
Upgrading dagger uncovers an issue where java-only modules with
kotlin-containing dependencies may see org.jetbrains.annotations.NotNull
annotations.  Include the kotlin-annotations in the output jar the
same way kotlin-stdlib is included.

Bug: 227669740
Test: TestKotlin
Change-Id: Ifc33a32b121c1b9a9d1911bdec332264b78b571c
2022-05-04 19:07:32 +00:00
Treehugger Robot
be4c7eda08 Merge "Revert "Don't add uses_libs/optional_uses_libs to the manifest_fixer."" 2022-05-04 15:19:37 +00:00
Lukács T. Berki
28ba9c472f Merge "Add a test for correctness of C++ compilation." 2022-05-04 12:06:38 +00:00
Ulya Trafimovich
f5d91bb3b4 Revert "Don't add uses_libs/optional_uses_libs to the manifest_fixer."
This reverts commit 0b1c70efbc.

The reverted commit was based on the idea that uses-libraries that are
explicitly specified in build files should not be implicitly added to
the manifest, as that would mean that anything added to the build files
will flow to the manifest.

Although this logic is correct, it prevents propagation of
uses-libraries from dependencies, which is wrong: if a library has an
explicit uses-library property in Android.bp, this property is expected
to be propagated to the library's dependencies. Failing to do so would
mean that every user of that library has to add uses-library property to
their build files, which doesn't scale (see b/214255490 for example).

Bug: 214255490
Test: lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd \
    && adb wait-for-device && adb root \
    && adb logcat | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
    # empty output, no errors at boot
Change-Id: I6f420e76a89aa2f37be99f877711736640f2c361
2022-05-04 12:10:06 +01:00
Lukacs T. Berki
e3487c8848 Add a test for correctness of C++ compilation.
This required the following:

- Adding Platform_base_sdk_extension_version to default soong.variables
- Teaching the symlink tree creation code to understand symlinks
- Making finder.go follow symlinks when requested

Adding yet another knob is unfortunate, but I can't allow that
unconditionally because the Android code base contains a number of
symlinks giving rise to infinite directory trees because they point back
to their parent and this seemed preferable to adding complicated logic
like "follow symlink but if only its fully resolved version does not
point under the source tree".

I could be convinced about the latter, though.

Test: Presubmits.
Change-Id: I453f6b7e5334771f5832c700db00f9d24ed1d82f
2022-05-04 09:12:01 +02:00
Ge Bian
d906ddc70a Merge "Revert "Add support to max-target-s to generate_hiddenapi_lists"" 2022-05-03 23:04:00 +00:00
Ge Bian
93b542459a Revert "Add support to max-target-s to generate_hiddenapi_lists"
Revert submission 1931011-max-target-s

Reason for revert: Seems to cause build breakage
Reverted Changes:
I2b513f93a:Add support to max-target-s to generate_hiddenapi_...
Ifdd7b7a71:Add support for max-target-s
I06d05840e:Add support for max-target-s

Change-Id: I67413a3deda42c503b876727377e932f7e4652e9
2022-05-03 20:41:53 +00:00
Mark Dacek
390df4c181 Merge "Log information for Mixed Builds modules. Test: Output matches expected. https://paste.googleplex.com/5913495636803584?raw Performance evaluated: https://docs.google.com/spreadsheets/d/1X7eOVBKEZUwUWl5i8CDfBo9yUeZrDPXWi2JYO4BEZt4/edit?resourcekey=0-co8crIFW9dpiedhCMkhAgw#gid=0" 2022-05-03 20:04:10 +00:00
Treehugger Robot
dd58c3fe2b Merge "Add cross-referencing support for Rust" 2022-05-03 19:10:17 +00:00
MarkDacek
ff851b83b6 Log information for Mixed Builds modules.
Test: Output matches expected. https://paste.googleplex.com/5913495636803584?raw
Performance evaluated: https://docs.google.com/spreadsheets/d/1X7eOVBKEZUwUWl5i8CDfBo9yUeZrDPXWi2JYO4BEZt4/edit?resourcekey=0-co8crIFW9dpiedhCMkhAgw#gid=0

Change-Id: I88780c7cc52a189a72216c5e2e499c96574b3731
2022-05-03 18:11:32 +00:00
Artur Satayev
4df5f992e3 Merge "Add support to max-target-s to generate_hiddenapi_lists" 2022-05-03 17:28:38 +00:00
Trevor Radcliffe
cd8fd67753 Make isolated true by default for gtest
This change sets everything up to do this, but does not actually
enable it. jdesprez will follow up by making a one line change
that actually turns the default to true when he does test
debugging/verification.

Bug: 178498003
Test: build. Relying on @jdesprez for the rest of the verification
Change-Id: I3b1b6b57279dd4f9f7fc559e2d3ad76911b045e8
2022-05-03 14:51:16 +00:00
Paul Duffin
0038a8d374 Prevent non-app/non-test modules from statically including jacocoagent
(cherry picked from commit 3953153c9e)

Previously, the .impl library of java_sdk_library modules would end up
with the jacocoagent statically included. That is because their
Instrument flag was set to true when created by their parent. As that
was before the deps were added that meant that they ended up with a
static dependency on jacoagent (at least when UnbundledBuild() was
true).

That was not previously a problem because the .impl files were only
used at build time. However, a recent change to make updatable-media
statically include framework-media.impl (which statically included the
jacocoagent classes) broke the coverage build because the jacocoagent
classes are not in the permitted packages for the updatable-media.

When instrumenting the bootclasspath the jacocoagent library is added
to the art-bootclasspath-fragment.

The jacocoagent should only be statically included in apps, or test
apps. This change adds an extra flag to specify whether the module type
supports statically including the jacocoagent. This is set to true by
apps and test apps but not when the java_sdk_library creates the .impl
java_library preventing it from statically including jacocoagent.

Bug: 230967146
Bug: 229932396
Test: COVERAGE_MODULES=media \
      PRODUCT=mainline_modules_x86 \
      TARGET_BUILD_APPS=com.google.android.media \
      vendor/google/build/build_unbundled_coverage_mainline_module.sh
      # Fails without this change, passes with it.
Merged-In: Ic95cf11a05f59b67e623474ed3dd9be6b4442c42
Change-Id: Ic95cf11a05f59b67e623474ed3dd9be6b4442c42
2022-05-03 10:11:59 +00:00
Treehugger Robot
a0bab18a47 Merge "Clean up minSdkVersionAllowlist" 2022-05-03 09:00:15 +00:00
Treehugger Robot
a6fcf9fd92 Merge "Remove unused uses_sdks property for apexes" 2022-05-03 03:24:59 +00:00
Treehugger Robot
7f5b4e3229 Merge "Remove version_selector mutator" 2022-05-03 03:06:57 +00:00
Treehugger Robot
6c59cdb5c7 Merge "Add missing dependency on compose plugin in kapt rules" 2022-05-03 02:28:14 +00:00
Tianyu Jiang
5ae0cd2a38 Merge "Revert "Update to clang-r450784e"" 2022-05-02 23:14:38 +00:00
Tianyu Jiang
cc84ca767d Revert "Update to clang-r450784e"
Revert submission 2080443-update-clang-8508608

Reason for revert: b/230930120
Reverted Changes:
I678829f02:Update to clang-r450784e

Change-Id: I89e336ec1deffddbbbf872a3ee4a1082a65fb137
2022-05-02 23:06:49 +00:00
Colin Cross
08b0a1cd79 Add missing dependency on compose plugin in kapt rules
The kapt rule uses kotlincFlags but was not using kotlincDeps,
causing the rule to get the -Xplugin argument on the compose
compiler plugin jar, but not have a dependency on it.

Bug: 231222079
Test: TestKotlinCompose
Change-Id: I4c2cf30fb7d8cad4eededa29f67f4ffd459caa41
2022-05-02 14:00:50 -07:00
Sam Delmerico
0d1c4a0fee disable usage of plugins as static libs
Test: m auto_value_plugin
Test: m androidx.appsearch_appsearch-compiler
Test: m intdef-annotation-processor-test
Test: atest intdef-annotation-processor-test
Test: m view-inspector-annotation-processor-test
Test: atest view-inspector-annotation-processor-test
Test: m Robolectric_processor_tests
Test: atest Robolectric_processor_tests
Bug: 225388628
Change-Id: I9e3dd81f44333b680f2e81283c02a9be5a4de15b
2022-05-02 20:53:45 +00:00
Treehugger Robot
5b70a8d677 Merge "Update clang version to clang-r450784d" 2022-05-02 18:33:32 +00:00
Yi Kong
4f6c92765d Update clang version to clang-r450784d
Test: presubmit
Bug: 219872355
Change-Id: If6c2c331044a363cb8f20a2516da894e72c4b7e7
2022-05-02 23:52:44 +08:00
Martin Geisler
507f9b26d5 Merge "Tell rustc to always use color output" 2022-05-02 13:00:40 +00:00
Jooyung Han
c743039b48 Clean up minSdkVersionAllowlist
These modules have min_sdk_version set. No need to keep them in
allowlist.

Bug: 158059172
Test: m
Change-Id: Id9d3c62f4da941f26212ce69637469d82758c935
2022-05-02 12:38:26 +09:00
Treehugger Robot
a704eb1469 Merge "Update locations of apex bzl files" 2022-04-30 00:20:08 +00:00
Treehugger Robot
b69919c70d Merge "Remove warnings about mismatched types with builtins for stubs." 2022-04-29 22:29:27 +00:00
Cole Faust
5f90da372e Update locations of apex bzl files
Bug: 230893497
Test: ./build/bazel/vendor/google/build_mainline_modules.sh
Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Change-Id: Ib16bece720a9167d02d2ddd8c4f11257634d382b
2022-04-29 13:37:43 -07:00
Mitch Phillips
4e5f9a1521 Remove warnings about mismatched types with builtins for stubs.
Looks like new versions of the toolchain have an error about mismatching
the definitions used in the stubs with the builtin definitions. Since we
don't care about this when building stubs, ignore it by disabling the
builtin definitions.

Bug: N/A
Test: Build platform with ToT LLVM compiler.
Change-Id: I4e449c5fb96d0d5442fd57a7fea02ba69463324b
2022-04-29 13:12:28 -07:00
Cole Faust
7940585cf0 Merge "Convert firstword/lastword to starlark functions instead of index operators" 2022-04-29 18:32:40 +00:00
Matthew Maurer
e91f9d439e Merge "Allow BoringSSL's Rust bindings to build" 2022-04-29 17:40:24 +00:00
Treehugger Robot
9c60cc4f22 Merge "java_sdk_library_import: Delegate OutputFiles to impl library if needed" 2022-04-29 17:27:23 +00:00
Christopher Parsons
f485a95d3a Merge "Preserve depset structure from bazel aquery" 2022-04-29 14:49:31 +00:00
Paul Duffin
1e940d5b44 java_sdk_library_import: Delegate OutputFiles to impl library if needed
Bug: 230846030
Test: m nothing
      # Cherry pick into build with prebuilts enabled to verify.
Change-Id: I5ac9b1cdd2fc61efbc988e84556202ff6cd57146
2022-04-29 14:42:04 +01:00
Paul Duffin
a09d95f605 Merge "hiddenapi: Prevent libraries for Q/R from include S+ flags." 2022-04-29 13:37:35 +00:00
Martin Geisler
d352e3b788 Tell rustc to always use color output
By default, rustc will disable color output when it detects that its
stdin isn’t connected to a terminal. However, since we will print the
output to the user’s terminal, it makes sense to override this.

Test: Manually by triggering a compilation error. I ran
  * m pdl
  * atest --host --no-bazel-mode pdl_inline_tests
  * atest pdl_inline_tests
  and got useful color output in my terminal in each case.
Change-Id: I8b593d2eb59d13db17a3456e3fb053556fc16f07
2022-04-29 15:21:15 +02:00
Victor Chang
99666e2720 Merge "Revert "Fix erroneous "Field requires API level 33 (current min is 32)" warnings"" 2022-04-29 10:34:41 +00:00
Nataniel Borges
5d80d895b6 Revert "Fix erroneous "Field requires API level 33 (current min is 32)" warnings"
This reverts commit 8b7f627f30.

Reason for revert: b/230821289

Change-Id: I3032103b174c78586b38b64d2748ec5a42fa9522
2022-04-29 09:49:16 +00:00
Treehugger Robot
2fe7af01af Merge "Fix crash in MakeString.EndsWith()" 2022-04-29 08:18:05 +00:00
Jooyung Han
fbcf7e1c91 Merge "Put rust_test.data_libs under lib[64]" 2022-04-29 04:00:13 +00:00
Treehugger Robot
979a64f810 Merge "Clean up min_sdk_version allowlist" 2022-04-29 02:22:24 +00:00
Vinh Tran
775b44fa50 Merge "bp2build converts java_version property to javacopts attribute" 2022-04-29 01:43:20 +00:00
Treehugger Robot
28881cbd55 Merge "Update to clang-r450784e" 2022-04-29 01:00:33 +00:00
Cole Faust
01624a9c33 Merge "Show load cycles when running mk2rbc" 2022-04-29 00:44:12 +00:00
Cole Faust
2b6a312662 Merge "Recognize some unsupported functions" 2022-04-29 00:41:15 +00:00
Jooyung Han
10bea7d44a Put rust_test.data_libs under lib[64]
Rust test binary depending on native libraries would require them under
lib[64] directory so that the test binary can open them with default
rpath values.

Bug: 204562227
Test: presubmit
Change-Id: I029bb32c4c98fba21bd28e579a9df9f184a7f045
2022-04-28 23:55:43 +00:00
Cole Faust
35b994e1e7 Fix crash in MakeString.EndsWith()
Bug: 226974242
Test: go test
Change-Id: I21ff26d00ed7be145ae2c1175f1438b6e7d60834
2022-04-28 16:08:02 -07:00
Vinh Tran
3ac6daf47c bp2build converts java_version property to javacopts attribute
This CL also converts `external/rappor` (which already set `java_version` to `1.7`) to be bazelable to testify the changes.

Results from `b build //external/rappor && cat bazel-bin/external/rappor/librappor.jar-0.params`: https://paste.googleplex.com/5518725462622208.

Test: go test ./bp2build/...
Bug: 227618664
Change-Id: I8d370d4639f70fba51e6de6ceb7bcb5ace9ccd91
2022-04-28 18:52:48 -04:00
Treehugger Robot
184a6b87e5 Merge "Prototype changes for multitree" 2022-04-28 22:20:47 +00:00
Treehugger Robot
f8c3412822 Merge "Convert $(words) to Starlark" 2022-04-28 22:18:07 +00:00