Commit graph

67148 commits

Author SHA1 Message Date
Kousik Kumar
ca390b2f00 Update symlinks in output directory when TOP dir changes
When TOP dir changes and we reuse the same output between the old and new checkouts, we need to rewrite all the symlinks used by Bazel and other tools in the out-directory to point to the new top directory. Otherwise, if the old source dir is deleted, the build will fail.

I used the OUT_DIR/soong/soong.environment.available file to find out the previous PWD.

Tested:
1. Create source dir 1, run build, create source dir 2, remote source dir 1, reuse out dir and rerun build => build succeeded with this change.
2. m libc after moving build TOP. Only the analysis phase was rerun, the actual build was not rerun.

Bug: b/300498226

Change-Id: I196625baa1f4efe7a4734accfa1f0be7c98a7920
2023-10-04 21:07:36 +00:00
Treehugger Robot
72928074f5 Merge "Don't delete withres-withoutdex jar from R8 rules" into main 2023-10-03 19:17:56 +00:00
Mark Dacek
4ac292ffd8 Merge "Revert "Modify symlink_forest to rerun when soong_build has changed."" into main 2023-10-03 18:39:46 +00:00
Jihoon Kang
a7e5e29ec1 Merge changes from topic "expose_flagged_api_revert" into main
* changes:
  Revert^2 "Add flagged api hide conditional to droidstubs"
  Revert^2 "Add soong config variable Release_expose_flagged_api"
2023-10-03 17:55:16 +00:00
Spandan Das
29af2a470d Merge "Handle symlinks in isPackageBoundary" into main 2023-10-03 17:51:41 +00:00
Yu Liu
7a90fcfa45 Merge "Convert java_aconfig_library to bazel." into main 2023-10-03 17:29:26 +00:00
Colin Cross
b716ceb832 Don't delete withres-withoutdex jar from R8 rules
R8 rules produce a depfile generated by R8.  R8 sees the withres-withoutdex
jar as an input, and so adds it to the depfile.  If the jar is deleted
after running R8 then ninja will always consider the rule dirty, as the
input file listed in the depfile is missing.

Fixes: 303064127
Test: m Calendar && m Calendar
Test: m framework-minus-apex &&  m framework-minus-apex
Change-Id: I5cbd780b56fc131b58598d6e569a8a78b7fe9395
2023-10-03 16:42:48 +00:00
Zi Wang
33befd0c58 Merge "Allowlist tradefed-common-util and some dependents for tradefed" into main 2023-10-03 16:31:29 +00:00
Vinh Tran
85455887b7 Merge "Change bp2build to switch to using custom fdo_profile macro" into main 2023-10-03 14:58:21 +00:00
Jihoon Kang
c831389625 Revert^2 "Add flagged api hide conditional to droidstubs"
This reverts commit 1180919dda.

Test: go test ./java && m TARGET_PRODUCT=sdk TESTING_TARGET_RELEASE_NEXT=true nothing and inspect ninja command for generating stubs and verify the flag is included && m TARGET_PRODUCT=sdk TARGET_RELEASE=trunk_food nothing and inspect ninja command for generating stubs and verify the flag is not included
Bug: 299570421
Change-Id: I4967376c0236bad729398af80fa59b48dbab5f21
2023-10-03 01:04:00 +00:00
Jihoon Kang
f3aa3225b6 Revert^2 "Add soong config variable Release_expose_flagged_api"
This reverts commit 5548bf3053.

Test: m nothing
Bug: 299570421
Change-Id: I9f70648fb6657bbf4f5681cd6d40517d70a8fefb
2023-10-03 01:00:42 +00:00
Mark Dacek
aa5cc2cd6a Revert "Modify symlink_forest to rerun when soong_build has changed."
This reverts commit 23a4120c57.

Reason for revert: broke soong_integration

Change-Id: I4d51841756675b3745244d23e13aefda0916614b
2023-10-02 23:40:33 +00:00
Thiébaud Weksteen
77b232da24 Merge changes from topic "linter_integration_tests" into main
* changes:
  Add .lint tagged output to Java modules
  Add lint.suppress_exit_code attribute
2023-10-02 23:26:39 +00:00
Treehugger Robot
2eff89a8ce Merge "Remove -Wsign-promo." into main 2023-10-02 23:14:26 +00:00
Krzysztof Kosiński
eae6635a0f Merge "More documentation for C++ global config." into main 2023-10-02 22:27:21 +00:00
Yu Liu
f2b94010c8 Convert java_aconfig_library to bazel.
Bug: 297357579
Test: Unit test and AconfigJavaHostTest
Change-Id: Icf944cc0b2a7382107923d49b2d2ff0eb4113638
2023-10-02 15:04:19 -07:00
Dwayne Barry
e298d42044 Merge changes from topic "revert-2646423-HDQXAAHWBW" into main
* changes:
  Revert "NDK library: enable feature flags for dumping ABI repres..."
  Revert "NDK library: enable feature flags for diffing ABI repres..."
2023-10-02 21:40:32 +00:00
Android Culprit Assistant
cd44909edc Revert "NDK library: enable feature flags for dumping ABI repres..."
This revert was created by Android Culprit Assistant. The culprit was identified in the following culprit search session (http://go/aca-get/e18f14a6-af8b-4b9e-8f8e-73515c608887).

Change-Id: Ia32769fc520459ce7cb61f8e5b1def623eee93ff
2023-10-02 21:26:39 +00:00
Android Culprit Assistant
6dabfdda65 Revert "NDK library: enable feature flags for diffing ABI repres..."
This revert was created by Android Culprit Assistant. The culprit was identified in the following culprit search session (http://go/aca-get/e18f14a6-af8b-4b9e-8f8e-73515c608887).

Change-Id: I4e0b62eea9e1c0ff49fbbf92e900606ccf93b93a
2023-10-02 21:26:39 +00:00
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
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
e20b7589b4 Merge "Modify symlink_forest to rerun when soong_build has changed." into main 2023-10-02 15:36:43 +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
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
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
477a31271d Merge "Added new framework-pdf jar inside MediaProvider module" into main 2023-09-29 12:21:33 +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
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
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
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
e3f7a0d4d6 Merge "Update bp2build tests to use stubbed defs" into main 2023-09-28 17:23:50 +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