Commit graph

71905 commits

Author SHA1 Message Date
Cole Faust
60f2c2677d Generate build_number.txt only once am: 583dfb426f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2768188

Change-Id: I9cc986860173da4f2148afa93d2cfb34f65af0b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 05:01:28 +00:00
Cole Faust
583dfb426f Generate build_number.txt only once
build_number.txt was generated in runKati, and runKati is run multiple
times throughout the build. If a build number is not set, then one will
be generated using the current timestamp, meaning that multiple
different build numbers will be used in different phases of the build.

Instead, generate build_number.txt during SetupOutDir(), so that we
only have 1 build number.

This is a resubmission with a change to ensure out/soong is created
before writing the build number file.

Bug: 297269187
Test: edit a bzl file to force bazel to rerun, change the code so that use_fixed_timestamp=true during partition builds, m installclean, m bazel_sandwich, and observe that the bazel/make partitions are byte-for-byte identical
Change-Id: I47abcca166c701bb66a6a7731aecad5818279244
2023-09-28 17:56:43 -07:00
Roy Luo
16f282210c Merge "Revert "Generate build_number.txt only once"" into main am: eba51bf937
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2768007

Change-Id: Ib4dcf88313ec1484939a6ce44286308e39170b66
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 00:49:50 +00:00
Treehugger Robot
2860378298 Merge "Generate build_number.txt only once" into main am: b7dbc85485
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2768665

Change-Id: Ic8578637db55e34c34cf19b97a18ce1b0c88516f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 00:49:08 +00:00
Colin Cross
56e2840a57 Delete temporary files after d8 and r8 rules
Delete files created within the d8 and r8 rules that are not considered
output files by ninja.  This should reduce disk space usage without
affecting incremental build performance.

Bug: 302573555
Test: m checkbuild
Change-Id: Ifea86888c2f385415735ade7d80cf315bc4d057e
2023-09-28 17:43:35 -07:00
Roy Luo
eba51bf937 Merge "Revert "Generate build_number.txt only once"" into main 2023-09-29 00:32:02 +00:00
Roy Luo
f852b72a22 Revert "Generate build_number.txt only once"
This reverts commit ab6e524709.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/builds/quarterdeck?branch=aosp-main&target=ndk&lkgb=10879153&lkbb=10879224&fkbb=10879224, bug b/302608661.

Change-Id: I07d47a92ea9a9f5d329e813859316decfd75cde1
BUG: 302608661
2023-09-29 00:28:32 +00:00
Thiébaud Weksteen
9c0dff9ae5 Add lint.suppress_exit_code attribute
The Android lint --exitcode parameter can be skipped using
ANDROID_LINT_SUPPRESS_EXIT_CODE. Expose a similar attribute to Java
modules to ignore the exit code.

This is useful for integration testing. It is possible to build
libraries that report an error when linted. Othewise, such module would
break the checkbuild target.

Bug: 302400088
Test: m nothing
Change-Id: I372c42184f40d25753a688c380c0c63e9758ca00
2023-09-29 10:24:13 +10:00
Treehugger Robot
b7dbc85485 Merge "Generate build_number.txt only once" into main 2023-09-29 00:12:01 +00:00
Chris Parsons
2ef472be7a Treat src=name filegroups as handcrafted targets
This is groundwork for allowlist v2, as such targets are still
effectively referencable via their file syntax; thus, rdep targets of
these filegroups should still be treated as convertible.

Fixes: 302025822
Test: Unit test update
Change-Id: I93445ff75e7c0570530725d086e47c1532833c06
2023-09-28 23:07:00 +00:00
Christopher Parsons
49ff8ddaa7 Merge "support aidl bp2build changes" into main am: dec9ce6693
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757771

Change-Id: I95902c66e394c3cdb1d1fbe77eeb62fa2b5e1709
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 21:43:33 +00:00
Cole Faust
ab6e524709 Generate build_number.txt only once
build_number.txt was generated in runKati, and runKati is run multiple
times throughout the build. If a build number is not set, then one will
be generated using the current timestamp, meaning that multiple
different build numbers will be used in different phases of the build.

Instead, generate build_number.txt during SetupOutDir(), so that we
only have 1 build number.

Bug: 297269187
Test: edit a bzl file to force bazel to rerun, change the code so that use_fixed_timestamp=true during partition builds, m installclean, m bazel_sandwich, and observe that the bazel/make partitions are byte-for-byte identical
Change-Id: I5bf3bb6c78e7529749ca9275f67db3f2f9e66af2
2023-09-28 14:11:43 -07:00
Christopher Parsons
dec9ce6693 Merge "support aidl bp2build changes" into main 2023-09-28 20:19:43 +00:00
Christopher Parsons
87a33f30b2 Merge "Update bp2build tests to use stubbed defs" into main am: e3f7a0d4d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2766386

Change-Id: I7116d9ebbb741a1bdff0e7751039cca1bc71da1d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 17:25:58 +00:00
Anton Hansson
4e34213372 Merge "Make the srcjar for bcp available in OutputFiles" into main am: 0843b79d8c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2760367

Change-Id: Ie50e0e8b4617ce3ae8e8664c59d86be795a97d7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 17:25:03 +00:00
Anton Hansson
10d91d7107 Merge "Add srcjar output for platform_bootclasspath" into main am: c38757d0c0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757569

Change-Id: Iccbf6e1571e4ed4321e9c4367590e8faac1c2acd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 17:24:25 +00:00
Anton Hansson
ea95719555 Merge "Collect transitive source files for java modules" into main am: 9231132099
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757568

Change-Id: Ie286b14529f4ff4aec1845d930b802d160be27f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 17:24:03 +00:00
Christopher Parsons
e3f7a0d4d6 Merge "Update bp2build tests to use stubbed defs" into main 2023-09-28 17:23:50 +00:00
Cole Faust
32670ab73d Merge "AVB and selinux support in partitions" into main am: 6ed1e0fd59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2766206

Change-Id: I8d89ca7a67dfd129bcd73b8758bb76703fc13283
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 17:23:44 +00:00
Zi Wang
50225c86b6 Merge "Always drop deps from android_library with no srcs" into main am: 2201343fce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2765453

Change-Id: I1f96c94d6d6a3cde283a551f9cc7b4ad0ca5369e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 17:23:28 +00:00
Ivan Lozano
a9ee22614d Merge "rust: Import protos from dependent rust_protobuf" into main am: a0d741edef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2757786

Change-Id: I236f5de0b64cab70dece6520e685a78cf2257585
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 17:21:02 +00:00
Anton Hansson
0843b79d8c Merge "Make the srcjar for bcp available in OutputFiles" into main 2023-09-28 17:09:50 +00:00
Anton Hansson
c38757d0c0 Merge "Add srcjar output for platform_bootclasspath" into main 2023-09-28 16:56:55 +00:00
Anton Hansson
9231132099 Merge "Collect transitive source files for java modules" into main 2023-09-28 16:46:30 +00:00
Cole Faust
6ed1e0fd59 Merge "AVB and selinux support in partitions" into main 2023-09-28 16:38:28 +00:00
Zi Wang
2201343fce Merge "Always drop deps from android_library with no srcs" into main 2023-09-28 16:16:51 +00:00
usta
c45478190f Skip @bazel_tools// labels from ninja
Since these bazel labels are removed from depsets anyways,
there is little reason to convert they to ninja build statements

Test: m nothing (with bazel af426041)
Bug: 301638491
Change-Id: Ie920477231d147d0b5b7dbcd1c59ed9985a80abb
2023-09-28 16:03:15 +00:00
Ivan Lozano
a0d741edef Merge "rust: Import protos from dependent rust_protobuf" into main 2023-09-28 15:58:48 +00:00
Anton Hansson
b3738ed1f4 Make the srcjar for bcp available in OutputFiles
This makes it possible for Android.bp files to depends on the srcjar.

Bug: 151360309
Test: m platform-bootclasspath.srcjar
Change-Id: Id42cc3cff89c084b55c7fb0726ad84ecd4f50f58
2023-09-28 13:22:39 +00:00
Anton Hansson
57162c515e Add srcjar output for platform_bootclasspath
This output contains all the transitive sources that are contained in
the bootclasspath.

It's currently limited to source-built bootclasspath components. Future
work will make this deal with sdk_library prebuilts.

Bug: 151360309
Test: unit test, as well as manual inspection of platform-bootclasspath
Change-Id: Ie05d8125e19736d8b4b9ebafb70b88a0a40069d5
2023-09-28 13:21:21 +00:00
Anton Hansson
0e73f9ee6d Collect transitive source files for java modules
This new entry in the JavaInfoProvider lists all the transitive source
files contained within the library. That is, the source files of the
module and all its static dependencies.

Bug: 151360309
Test: unit test in java_go + some manual testing
Change-Id: I7fe3035b9e46774095c0e9196cd77fa1027adf6d
2023-09-28 13:20:49 +00:00
Sam Delmerico
5e02a1e1b7 Merge "Revert^2 "rustSetToolchainSource to use linux-x86 srcs"" into main am: 0dfd62a391
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2761811

Change-Id: Ic7a8980c8aeb8221b62c672c38cf6d45ce39b8e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 11:09:12 +00:00
Sam Delmerico
0dfd62a391 Merge "Revert^2 "rustSetToolchainSource to use linux-x86 srcs"" into main 2023-09-28 09:53:29 +00:00
Jingwen Chen
be81da7e7e Merge "Allowlist directories for tradefed's deps." into main am: 6b73be150c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2763425

Change-Id: Ibaea54cfece3200a546989ed869f5a018e2d74ef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 08:04:41 +00:00
Jingwen Chen
6b73be150c Merge "Allowlist directories for tradefed's deps." into main 2023-09-28 06:51:29 +00:00
Maxim Siniavine
12663c872e Merge changes from topic "revert-2755310-HIIDCMFNIU" into main am: 4aa82a13db
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2766348

Change-Id: I51b0213f78192a3a6d8fc92a3e995e2fb16a606f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 01:55:28 +00:00
Maxim Siniavine
57639c5e65 Revert "Add flagged api hide conditional to droidstubs" am: 1180919dda
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2766347

Change-Id: Iecdfb508043d33ed23479d4fe758980943b629d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 01:55:22 +00:00
Treehugger Robot
b942e672f9 Merge "Make platform_mappings file deterministic" into main am: f51ed265e4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2766205

Change-Id: I314177684139793026d3bbbc375f6d9427dad054
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-28 01:54:52 +00:00
Maxim Siniavine
4aa82a13db Merge changes from topic "revert-2755310-HIIDCMFNIU" into main
* changes:
  Revert "Add soong config variable Release_expose_flagged_api"
  Revert "Add flagged api hide conditional to droidstubs"
2023-09-28 01:08:44 +00:00
Maxim Siniavine
1180919dda Revert "Add flagged api hide conditional to droidstubs"
Revert submission 2755310

Reason for revert: Broken build b/302407753

Reverted changes: /q/submissionid:2755310

Change-Id: I56306fc3b7e5608d21dbefe18d6a886561599f40
2023-09-28 01:01:59 +00:00
Maxim Siniavine
5548bf3053 Revert "Add soong config variable Release_expose_flagged_api"
Revert submission 2755310

Reason for revert: Broken build b/302407753

Reverted changes: /q/submissionid:2755310

Change-Id: Ib5c01033882500296989a7c4476a723d95292aab
2023-09-28 01:01:59 +00:00
Ivan Lozano
d106efe76d rust: Import protos from dependent rust_protobuf
rust_protobuf were unable to import protos from other rust_protobuf
modules. This CL adds support for that. rust_protobuf modules which are
listed in rustlibs will have their modules imported into the generated
protobuf stub. Additionally, rust_protobuf modules which define
"exported_include_dirs" will export those include paths to dependent
rust_protobuf modules.

Bug: 301266700
Test: m rust
Change-Id: I132edffa4d77e0ac80a7ac934f873374c8e94c1b
2023-09-27 20:53:54 -04:00
Treehugger Robot
f51ed265e4 Merge "Make platform_mappings file deterministic" into main 2023-09-28 00:37:51 +00:00
Chris Parsons
8a532b78e5 Update bp2build tests to use stubbed defs
bp2build tests should not use bp2build_available:false test deps,
because, with the "allowlist v2" feature, this will cause these modules
to stop being converted with bp2build. Instead, such test deps should be
"stubbed", which effectively treats them like targets in pre-existing
BUILD files on the filesystem.

Bug: 301312260
Test: m nothing
Change-Id: Ib1ce7c87cd1e98568fdaf2a52a893dafa74ab327
2023-09-27 23:11:26 +00:00
Romain Jobredeaux
b0e61183f3 Merge changes from topic "bazel_framework_res" into main am: 641b62b205
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2720593

Change-Id: Ifb2c83f9d7390a2f40083ab4e3f8625bbe5f45af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-27 21:47:27 +00:00
Chris Parsons
2173b5f578 support aidl bp2build changes
- Allowlist an aidl module by package, not name (to support a small
  module name change)
- Implement some unit test framework changes which facilitate better
  aidl bp2build testing
- Support a convenience function to add a load hook for registering a
  module as "has a bazel definition of a given target name"

Bug: 301676937
Test: m bp2build, verified the aidl target was generated before/after
this CL.
Test: Presubmits
Test: Ran bp2build progress and ensured that aidl_interface targets
under frameworks/ continued to appear converted

Change-Id: I62412057d6f61a2ce2bc39488c75af793eb14c94
2023-09-27 21:30:19 +00:00
Cole Faust
b5055394a9 AVB and selinux support in partitions
Bug: 297269187
Test: m bazel_sandwich (updated partition_inspector to show selinux contexts, but still haven't figured out how to show avb information)
Change-Id: I6911c2fc75495f9722887925d8609c9a171901c6
2023-09-27 14:14:14 -07:00
Cole Faust
e136ddac77 Make platform_mappings file deterministic
Fixes: 301473943
Test: presubmits
Change-Id: I24a1fef87c1fb59b5aeb8ac9c05306cddee32399
2023-09-27 14:14:01 -07:00
Romain Jobredeaux
641b62b205 Merge changes from topic "bazel_framework_res" into main
* changes:
  bp2build support for framework-res
  Keep rules_testing BUILD files
2023-09-27 20:52:50 +00:00
Sam Delmerico
7a346cdaa0 Revert^2 "rustSetToolchainSource to use linux-x86 srcs"
7ba7e8232b

Change-Id: Ia10aede6a8b7422848146500506458ae495f7b9a
2023-09-27 20:45:48 +00:00