Commit graph

66959 commits

Author SHA1 Message Date
Colin Cross
df0ed707a5 Revert "fix failing rust_aconfig_library test"
This reverts commit 521eb20dc2.

Reason for revert: b/301463284

Change-Id: I45f4793694654f3afd2dee6188e0bf58cfb48992
2023-09-22 22:05:39 +00:00
Colin Cross
7ba7e8232b Revert "rustSetToolchainSource to use linux-x86 srcs"
Revert submission 2758566

Reason for revert: b/301463284

Reverted changes: /q/submissionid:2758566

Change-Id: Ia4966732e9bec105c854f09aa0523329ef4d8fd0
2023-09-22 22:02:28 +00:00
Colin Cross
05cbcb3539 Revert "remove rust deps on clang prebuilts"
Revert submission 2758566

Reason for revert: b/301463284

Reverted changes: /q/submissionid:2758566

Change-Id: I54f0ecbbd922deb23009ca89ff79689e128f4f31
2023-09-22 22:02:28 +00:00
Sam Delmerico
476e876119 remove rust deps on clang prebuilts
Prebuilt modules for some clang tools were created in aosp/2746469, but they do not exist for darwin builds. Adding the same modules in prebuilts/clang/host/darwin-x86/Android.bp results in duplicate module names. Instead we can just get a path to these files directly in Soong.

Test: CI
Test: https://android-build.googleplex.com/builds/abtd/run/L90700000963131594
Change-Id: I620cfd7b1ab34bd0959feea562d599b963717198
2023-09-21 08:15:36 +00:00
Sam Delmerico
fbec3a5f5c rustSetToolchainSource to use linux-x86 srcs
This was hardcoded in previously, and aosp/2746467 changed this to use
the HostPrebuiltTag instead which caused errors. Reverting back to
original implementation.

Change-Id: I8ed1919aa2ea737f7836fab39f9ee0663fb455d2
2023-09-21 05:25:56 +00:00
Sam Delmerico
521eb20dc2 fix failing rust_aconfig_library test
Bug: 301290764
Test: go test .
Change-Id: I4220738595067365be0c2236a05a365a2e90c734
2023-09-20 19:30:47 +00:00
Sam Delmerico
52d1cc334b Merge changes from topics "revert-2746976-revert-2605644-rulebuilder-ninja-vars-OAAWYCDDLT-KMAGKVIXAT", "sandbox-rust-inputs" into main
* changes:
  support sandboxed rust rules
  conditionally escape rule builder command
  Revert^2 "allow Ninja variables in RuleBuilder API"
  Revert^2 "add crate_root property to rust modules"
  Revert^2 "add rust_toolchain_rustc_prebuilt module type"
2023-09-20 18:48:21 +00:00
Christopher Parsons
c331812a59 Merge "Have ConvertWBp2build use Bp2buildMutatorContext" into main 2023-09-20 17:56:24 +00:00
Dennis Shen
6c1121d31b Merge "build system implementation for c/cpp test mode codegen" into main 2023-09-20 16:48:56 +00:00
Liz Kammer
8e9ccda5d8 Merge "Don't panic for unhandled product vars" into main 2023-09-20 15:10:18 +00:00
Chris Parsons
637458d326 Have ConvertWBp2build use Bp2buildMutatorContext
This no-op refactoring facilitates some upcoming functional changes for
"bp2build allowlist v2". The work requires that the bp2build conversion
mutator be changed from a TopDown mutator to a BottomUp mutator.
Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext
makes it easier to make this functional change without touching tens of
files and multiple projects.

Bug: 285631638
Test: m bp2build
Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
2023-09-20 14:49:35 +00:00
Dennis Shen
c5e39f521b build system implementation for c/cpp test mode codegen
Bug: b/300488560
Test: added unit test and tested with AconfigDemoActivity app
Change-Id: I6ad71cc2dada8feb53662ec47c8acad5bc43d5ce
2023-09-20 14:27:18 +00:00
Liz Kammer
9e12c78637 Merge changes from topic "prebuilt-cc-shared-always" into main
* changes:
  Implement bp2build for java_sdk_library_import
  Always convert prebuilt libraries
  Always convert prebuilt cc library headers
2023-09-20 13:13:51 +00:00
Treehugger Robot
187af6648d Merge "Make bp2build_all_srcs manual." into main 2023-09-20 12:58:00 +00:00
Aleksei Vetrov
ed8fb7a6a6 Merge "NDK library: use prebuilts to check next level ABI" into main 2023-09-20 11:16:59 +00:00
Jingwen Chen
5802d0795b Make bp2build_all_srcs manual.
So that ... and :all target patterns don't pick it up.

Test: b build //bionic/libc/... and check that none of the filegroups
are built.

Change-Id: I79cd6fb6f7559409ae3e5b95b8b260970810cf7f
2023-09-20 10:25:09 +00:00
Cole Faust
c0f7bd1a15 Merge "Move the android_platform next to it's entrypoint product config file" into main 2023-09-19 20:42:52 +00:00
Liz Kammer
9e2a5a7d6d Don't panic for unhandled product vars
Instead, we return an error. This allows us to access some product
variable information earlier when it will not be used as an attribute
without panicing

Test: m nothing
Change-Id: Id094b2b9e1364a8d174d99b3824fa149fb235b3e
2023-09-19 15:58:22 -04:00
Liz Kammer
9a97a8f62a Implement bp2build for java_sdk_library_import
Test: go test bp2build conversion tests
Test: enable modules build from prebuilt and m nothing
Bug: 300640274
Change-Id: I8c015aec546d052bef6c42869e12db4e87d39780
2023-09-19 15:58:22 -04:00
Liz Kammer
e0cbc983ec Always convert prebuilt libraries
Test: CI
Test: patch in CL using prebuilt mainline modules & build
Bug: 300640274
Change-Id: Ie00b111a04198b266985f3e1c34c960844c0a327
2023-09-19 15:58:22 -04:00
Liz Kammer
86a407f284 Always convert prebuilt cc library headers
Test: go tests
Test: CI
Test: patch in CL using prebuilts for mainline modules and build
Bug: 300640274
Change-Id: I73f70dac679e341670e1484ce57bc984f413d409
2023-09-19 15:58:20 -04:00
Christopher Parsons
06ac78ce40 Merge "Refactor bp2build tests for allowlist v2" into main 2023-09-19 19:42:40 +00:00
Chris Parsons
cd209035aa Refactor bp2build tests for allowlist v2
Allowlist v2 will change bp2build by automatically disabling rdeps of
unconvertible modules. Many bp2build tests create bp2build stub modules
without an implementation,
This CL changes setup of such tests to also contain a BUILD file with
"stub implementations" of equivalent targets, to keep these test targets
convertible.

To verify this change in-place, this CL removes `bp2build_available:
false` from these dependencies.

This is a test-only change for bp2build tests.

Bug: 285631638
Test: m bp2build
Change-Id: I489480cbc4158a416b7abf57c35a6e2bc2ad6173
2023-09-19 17:04:11 +00:00
Cole Faust
b4cb0c857f Move the android_platform next to it's entrypoint product config file
Because we're going to start generating partition images for the
product, and the partitions will eventually be checked in, we want
them to be in sensible locations. And the platform should be there as
well so all the targets for a product are co-located.

Bug: 297269187
Test: m nothing && b build --config=android //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Change-Id: Iaa25c44aa00295ada279d5fd49b5498bbafb89d5
2023-09-19 09:54:59 -07:00
Aditya Kumar
a1a29b75db Merge "Revert "Revert "riscv64: enable V.""" into main 2023-09-19 16:52:31 +00:00
Sami Tolvanen
95ad0a9226 Merge "Reapply "Enable CFI for riscv64"" into main 2023-09-19 16:11:26 +00:00
Aleksei Vetrov
8c02bbc533 NDK library: use prebuilts to check next level ABI
NDK has two ABI checks:

1. Check that prebuilt ABI exactly matches compiled binaries.

2. Check that ABI of level X compatible with level X+1.

The second check used compiled binaries for level X and prebuilts for
level X+1. But this approach may confuse people, because ABI change will
be shown "reversed". For example, adding new field to ABI monitored
binary of level X would be shown as "removed" when compared to level X+1
prebuilt.

This change uses prebuilts for both level X and level X+1. Given, that
prebuilts are checked to match compiled binaries, this should be enough.

Change-Id: If942e4319744bc5a2674cdd65f6a6f664fdfaa7e
Signed-off-by: Aleksei Vetrov <vvvvvv@google.com>
2023-09-19 15:50:47 +00:00
Jingwen Chen
088c4b652b Merge "[bp2build] android_test bp2build." into main 2023-09-18 23:27:14 +00:00
Jihoon Kang
18a33e51c6 Merge "Create java_api_contribution_import from sdk_library_import" into main 2023-09-18 22:24:51 +00:00
Treehugger Robot
e50b0f5558 Merge changes I8466db71,I83180699 into main
* changes:
  Sort api files by api surface in java_api_library
  Add java_api_contribution_import module type
2023-09-18 22:23:33 +00:00
Sami Tolvanen
ed78fc8553 Reapply "Enable CFI for riscv64"
This reverts commit 49dcf79550.

The previous init crash was caused by the kernel defaulting to Sv57 and
the CFI shadow implementation in bionic assuming a 48-bit virtual
address space. With 5-level paging disabled in cuttlefish, we can again
enable CFI.

Bug: 293884796
Link: https://github.com/google/android-riscv64/issues/45
Test: cuttlefish boots
Change-Id: Ibcc02cf7ca6e396fd58674c648abf9f84daa260e
2023-09-18 13:41:29 -07:00
Jihoon Kang
71c868340e Create java_api_contribution_import from sdk_library_import
This change modifies sdk_library_import so that it directly creates
java_api_contribution per api scope. The module creates api_contribution
module for api scopes where the api file is specified.

Test: m nothing && MODULE_BUILD_FROM_SOURCE=false m nothing
--build-from-text-stub and inspect ninja dependency of java_api_library
Bug: 300175323

Change-Id: I74be3b4f1efef7f7d1cb8bd7b6c893b9cef0f370
2023-09-18 19:33:28 +00:00
Jihoon Kang
8fe1982e8b Sort api files by api surface in java_api_library
metalava requires api files to be sorted in the narrower api scope to
the wider api scope when passed as inputs. Previously, the api files
were sorted based on the naming convention, but some api files in
prebuilts do not necessarily follow the naming convention (i.e.
*-current.txt). Therefore, utilize the api surface information provided
by the java_api_contribution provider instead of the naming convention
to sort the api files.

Test: m nothing
Bug: 300175323
Change-Id: I8466db712bff8fef906186bd272d85682877533d
2023-09-18 19:33:01 +00:00
Treehugger Robot
8c04f3fd7a Merge changes Ie081e153,If9745083 into main
* changes:
  Stub/Impl selection for sdk variants
  bp2build converter for ndk_library
2023-09-18 19:21:15 +00:00
Treehugger Robot
46465666cc Merge "Unconditionally generate hash-based proguard mapping files" into main 2023-09-18 18:33:38 +00:00
Treehugger Robot
35bc07cb2a Merge "don't compress JNI libs extracted from aar_import" into main 2023-09-18 18:20:52 +00:00
Treehugger Robot
35f1ae0721 Merge "Sort always convert by type list" into main 2023-09-18 18:03:58 +00:00
Jared Duke
b832fbb643 Unconditionally generate hash-based proguard mapping files
Previously, this was restricted to targets that enable R8 full mode, but
that was really just a temporary carveout to avoid disrupting other
targets. Since then, R8 full mode has been enabled by default for all
app targets, and the hash-based mapping mechanism is further integrated
into various debugging and retracing pipelines.

As of now, there are are only a very small number of targets that have
enabled optimization/obfuscation and are still using R8 compat mode, so
the build-time impact of this change should be minimal, and there should
be no functional runtime side effects.

Bug: 297566172
Test: m framework-appsearch + inspect proguard mapping
Change-Id: I5dfea60f60dc37b8445c8fddba6a4eab0dc41d96
2023-09-18 16:05:16 +00:00
Liz Kammer
4fc71fff30 Sort always convert by type list
Test: CI
Change-Id: Icdf1f4e8132d959b494e2570854ee06973a816b0
2023-09-18 09:11:18 -04:00
Jingwen Chen
e12c083198 [bp2build] android_test bp2build.
android_test is just an android_app, but the test bits are handled
purely in Starlark (tradefed_test_impl).

This enables building HelloWorldTests (android_test) with Bazel.

Bug: 297030120
Bug: 297029612
Test: WIP
Change-Id: I6d287c94b31698ea247da48e4cd6b5a75bc71e11
2023-09-18 12:39:06 +00:00
Treehugger Robot
faa7c7c102 Merge "Handle bad rename" into main 2023-09-16 03:52:51 +00:00
Spandan Das
1f65f9e9bd Stub/Impl selection for sdk variants
If a dependency has ndk stubs, then the sdk variant of the library
should link against the ndk stub variant and not the impl/apex_stubs variant

Unlike module-libapi, the depdendency does not go through an
@api_surfaces external repo indirection. This indirection was created to
support Multi-tree, and will likely  be removed in the future

Test: Added a unit test
Bug: 298085502
Change-Id: Ie081e153fa586b6c22db0b8e42f91149fd8e5d9b
2023-09-16 02:57:29 +00:00
Spandan Das
63acae9af1 bp2build converter for ndk_library
ndk_libary will be converted to a cc_stub_suite target. Its api_surface
attribute will be publicapi

The headers corresponding to this stub target will be added in a followup bug
(tracked in b/300504837)

Bug: 298085502
Test: Added a unit test
Change-Id: If9745083b18e0bcf5ecb89229a0f709b949d401c
2023-09-16 02:57:26 +00:00
Liz Kammer
00543dc61c Handle bad rename
Cleanspec wasn't working, so let's handle it in Soong

Test: create an invalid file, run m nothing, verify it is removed
Change-Id: I55d3c9344541b8e504887225a660044e14204427
2023-09-15 21:22:55 -04:00
Jihoon Kang
fdf323697e Add java_api_contribution_import module type
java_api_contribution_import is a prebuilt module type of
java_api_contribution. It's build actions are identical to those of
java_api_contribution.

Test: m nothing
Bug: 300174357
Change-Id: I831806990b37b340af21858eb2bab5de62fdf7a9
2023-09-15 22:52:52 +00:00
Sam Delmerico
a588d153c8 support sandboxed rust rules
This commit adds support for compiling rust rules inside the sbox
sandbox. To compile a rust module with sandboxing enabled, the entry
point to the crate must be specified via the `crate_root` property, and
all input sources and compile-time data must be specified via the `srcs`
and `compile_data` properties.

Bug: 286077158
Change-Id: I8c9dc5cf7578037a583b4be2e2f73cf20ffd4408
2023-09-15 22:46:56 +00:00
Sam Delmerico
d96a60685a conditionally escape rule builder command
For rules which use RuleBuilder with Ninja variables (using the
BuildWithUnescapedNinjaVars function) but are not sandboxed, the command
output by RuleBuilder must not be escaped, or else Ninja variables will
not be evaluated until they are run on the command line.

Test: m libnum_traits liboid_registry crosvm droid
Change-Id: I81611368ab1975220f7f517df2f57646deac2af8
2023-09-15 22:41:58 +00:00
Sam Delmerico
0e2d63e4d2 Revert^2 "allow Ninja variables in RuleBuilder API"
7b02d8159e

Change-Id: I9f2031162b019e51b869ea0db151c86db447b23d
2023-09-15 22:41:56 +00:00
Sam Delmerico
60375c4adf Revert^2 "add crate_root property to rust modules"
5162ff14fc

Change-Id: I9a76df938639676ee4aa7bdd2b2902e0e6df08d5
2023-09-15 22:41:51 +00:00
Sam Delmerico
9333ac1249 Revert^2 "add rust_toolchain_rustc_prebuilt module type"
400749d1f0

Change-Id: I63f04e13605c43f800f01f45345e4b3dc61aefb7
2023-09-15 22:40:16 +00:00