Commit graph

72035 commits

Author SHA1 Message Date
Wei Li
0af40657ff Merge "Change sbom_test.sh to take command line arguments for target product, release and build variant, which is for a corresponding change in CI." into main 2023-10-02 18:14:33 +00:00
Spandan Das
a7da3f0e0b Create bp2build converter for versioned_ndk_headers
This module type is used by a single soong module - `common_libc` in
bionic/libc

Implementation details
- Convert this module type to ndk_headers rule. Bazel's ndk_headers rule
  will have a boolean attribute `run_versioner` to determine if
  verioner should be run on the headers
- Add this module type to the alwaysConvert bp2build list
- Add the converted target for `common_libc` to the deps of
  `ndk_sysroot`. This ensures that unbundled apps link against the
  versioned NDK headers of libc

Test: go test ./bp2build
Test: b build //bionic/libc:common_libc --config=android
Test: for f in $(find bazel-bin/bionic/libc/common_libc.versioned -type f); do cmp $f ${f/bazel-bin\/bionic\/libc\/common_libc.versioned/out\/soong\/ndk\/sysroot\/usr\/include}; done # no diff

Bug: 301169067

Change-Id: I55be202f0589db9bdc743c8be41c9c5afd74c352
2023-10-02 17:35:55 +00:00
Christopher Parsons
aa3e435857 Merge "Treat src=name filegroups as handcrafted targets" into main 2023-10-02 17:35:44 +00:00
Zi Wang
2260933688 Allowlist tradefed-common-util and some dependents for tradefed
Test: CI

Bug: 283193845
Change-Id: Id9e8eefcf47080e786c62466658c7cb1f31b055d
2023-10-02 09:56:34 -07:00
Mark Dacek
55c467dd51 Merge "Modify symlink_forest to rerun when soong_build has changed." into main am: e20b7589b4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2758108

Change-Id: I6c6f2028868304284588ecf4fa6998b973e9f7bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 16:25:07 +00:00
Mark Dacek
e20b7589b4 Merge "Modify symlink_forest to rerun when soong_build has changed." into main 2023-10-02 15:36:43 +00:00
Romain Jobredeaux
fc6a6fd081 Merge "Use manual BUILD files in jdk8 and allowlist apache-commons-compress" into main am: e2007bfd0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2767831

Change-Id: I39fbdd11d59b1b3905cd55ebd4146913b8e64e5b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 14:19:44 +00:00
Romain Jobredeaux
e2007bfd0e Merge "Use manual BUILD files in jdk8 and allowlist apache-commons-compress" into main 2023-10-02 13:38:50 +00:00
Aleksei Vetrov
3306e5228a Merge changes I94a0e2de,I95ebfef6 into main am: bf62b334f6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2646423

Change-Id: I00b43583290322a31c1ca36bfcde5ce596327544
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 13:17:16 +00:00
Aleksei Vetrov
bf62b334f6 Merge changes I94a0e2de,I95ebfef6 into main
* changes:
  NDK library: enable feature flags for diffing ABI representations
  NDK library: enable feature flags for dumping ABI representations
2023-10-02 12:40:59 +00:00
Thiébaud Weksteen
d054436434 Add .lint tagged output to Java modules
The linter output can be referenced in other modules for further
processing.

Bug: 302400088
Test: m nothing
Change-Id: I1809b70d8d98ced5d8f3d5f068c6639c782ebebc
2023-10-02 10:12:30 +11:00
Krzysztof Kosiński
29c60f34fb Remove -Wsign-promo.
This flag has no effect in Clang:
https://clang.llvm.org/docs/DiagnosticsReference.html#wsign-promo

Bug: 296606895
Test: presubmit
Change-Id: I59c1e6b6cf541529b9f4741accdf26822572426f
2023-09-30 06:15:22 +00:00
Krzysztof Kosiński
1a4572ec9c More documentation for C++ global config.
Bug: 296606895
Test: presubmit
Change-Id: I19a4fa327bf1eac192067caf6d064a740124caf6
2023-09-30 05:49:09 +00:00
Wei Li
3b3173d5db Change sbom_test.sh to take command line arguments for target product, release and build variant, which is for a corresponding change in CI.
Bug: 276778945
Test: build/soong/tests/sbom_test.sh TARGET_PRODUCT=aosp_cf_x86_64_phone TARGET_RELEASE=trunk_staging TARGET_BUILD_VARIANT=userdebug
Change-Id: I2d9e271e4ae351e3626657aa2ac2a1a967c15fc8
2023-09-29 16:52:11 -07:00
MarkDacek
23a4120c57 Modify symlink_forest to rerun when soong_build has changed.
Also remove existing symlink_forest_version functionality.

This remedies issues pertaining to b/300122962 - symlinks not
clearing after a revert

Timing wise - this doesn't present a performance regression
on a clean build. When soong_build changes, it's considerably longer
but no different from the time when symlink_forest_version is changed.

Bug: 300288299
Test: build/soong/tests/symlink_forest_rerun_test.sh
Change-Id: I0e95aac315dfea7ea3b8bb9a3eb0c6408300bd3b
2023-09-29 22:53:07 +00:00
Spandan Das
dc7d7f7557 Handle symlinks in isPackageBoundary
isPackageBoundary looks at ShouldKeepExistingFile before checking if
that directory contains a BUILD file or not. ShouldKeepExistingFile
should be complemented with a isSymlink check. This is necessary because
we copy all symlinks to the synthetic workspace, and the resolved
symlink might point to a directory containing a BUILD file.

This additional clause is redundant if the directory has been
allowlisted for keepExistingBuildFile (e.g. build/bazel, recursive)

Test: b build //bionic/libc:versioner-dependencies (top of stack)

Change-Id: I5b23262f89ea34a78de4ccade6d27e4c5dd95c2e
2023-09-29 21:04:30 +00:00
Romain Jobredeaux
3fe1edde31 Use manual BUILD files in jdk8 and allowlist apache-commons-compress
Bug: 302008402
Bug: 302587886
Change-Id: I91401bf3fcda4c83ad2bb9d782b4021ffe6fd103
2023-09-29 15:08:55 -04:00
Liz Kammer
79ff08f12c Expand regex for likely aidl filegroups
Test: go test soong tests
Change-Id: Iab7abea8e2d11583cb4a8ecd4b27368f61dd40e0
2023-09-29 12:38:42 -04:00
Trevor Radcliffe
9b81d79ef6 Implement bp2build for Sysprop Java
Bug: 297356813
Test: bp2build and inspect BUILD files
Test: Conversion Unit Tests
Change-Id: Ib70400eb91bca946df1d99d953d7a0e7e63fb7cf
2023-09-29 15:42:00 +00:00
Jason Wu
7e1bbc9629 Merge "Skip @bazel_tools// labels from ninja" into main am: fc5ff341e8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2761148

Change-Id: I48f8d8ab339461a435d18d38a001176570d488aa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 14:28:24 +00:00
Treehugger Robot
737cf4dc67 Merge "Delete temporary files after d8 and r8 rules" into main am: 956f79c5d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2768187

Change-Id: I2fadedf0bf0dc36452139d77c70b1d8d1f98535f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 14:28:07 +00:00
Jason Wu
fc5ff341e8 Merge "Skip @bazel_tools// labels from ninja" into main 2023-09-29 14:26:37 +00:00
Treehugger Robot
956f79c5d4 Merge "Delete temporary files after d8 and r8 rules" into main 2023-09-29 13:27:57 +00:00
Mark White
14a6903e77 Merge "Added new framework-pdf jar inside MediaProvider module" into main am: 477a31271d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2760586

Change-Id: I2ae058860ad10e700934ff3648a2d51ad81bf0ba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 13:26:48 +00:00
Mark White
477a31271d Merge "Added new framework-pdf jar inside MediaProvider module" into main 2023-09-29 12:21:33 +00:00
Sam Delmerico
54e057563b Merge "add testcases for rust output file paths" into main am: 1579a91352
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2764070

Change-Id: Ia864038ab39fb7515517e0a6029e41cd97a37dc2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 09:13:51 +00:00
Sam Delmerico
1579a91352 Merge "add testcases for rust output file paths" into main 2023-09-29 08:35:28 +00:00
Sam Delmerico
079a97c778 add testcases for rust output file paths
Prepare for changing rust rules by testing that output file names will
match. A build failure in b/301463284 was partially caused by output paths changing and resulting in old files building up on buildbots which filled the disk. This unit test will ensure that the file paths of rust modules do not change and cause the same failure.

Bug: 301463284
Bug: 286077158
Change-Id: I1baba2c63ad29a2c98e378fce0a2ed32bc319c1e
2023-09-29 08:35:04 +00:00
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