Commit graph

72042 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
Alix
141ab6adde use message in android.AssertStringMatches()
function does not currently use the message argument  passed to it.
outputting this as part of the error message would be helpful for any
failures.

Change-Id: I5307df1567e79d85f81edd5a9eb3d4a093041535
2023-10-04 20:19:54 +00:00
Treehugger Robot
c2c6d39f72 Merge "Don't create withres-withoutdex files for R8" into main am: 31a5b2c1ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2768496

Change-Id: Ic3d9e6756d6ac8cbf7580bac1b6125fea2b4b84d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 17:46:21 +00:00
Treehugger Robot
31a5b2c1ef Merge "Don't create withres-withoutdex files for R8" into main 2023-10-04 17:32:52 +00:00
Treehugger Robot
1f02fc33a2 Merge "Remove unnecessary flag for Kotlin compiles" into main am: c68afc4e9f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769266

Change-Id: I2aacf5397e71d94a56841341524e97d535e6667b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 17:14:42 +00:00
Vinh Tran
50de8becd1 Export rust flags to bazel
Bug: 290790800
Test: Inspect out/soong/soong_inspection folder after running `m bp2build`
Change-Id: Iffc43a540f67e5f07d109a0a87f3248fae035267
2023-10-04 13:14:32 -04:00
Treehugger Robot
c68afc4e9f Merge "Remove unnecessary flag for Kotlin compiles" into main 2023-10-04 17:07:22 +00:00
Colin Cross
57a30b28df Merge "Don't pass -lrt or -lgcc_s to darwin rust compiles" into main am: ff4d5b40ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2771124

Change-Id: I9728cca90fca6477f7f8a5be3a083a44ab7b539f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 17:00:50 +00:00
Colin Cross
ff4d5b40ca Merge "Don't pass -lrt or -lgcc_s to darwin rust compiles" into main 2023-10-04 16:36:03 +00:00
Anton Hansson
dc99bafb1d Merge "Support passing lint baseline to doclava" into main am: ddbfdb7f7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769206

Change-Id: I93f042dbda1980e5eb3a8d9e097fa688b7c9cc46
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 16:13:39 +00:00
Anton Hansson
ddbfdb7f7e Merge "Support passing lint baseline to doclava" into main 2023-10-04 15:53:49 +00:00
Liz Kammer
1f309f3ac9 Allowlist AndroidFrameworkLintChecker
Test: bp2build.sh
Bug: 299463632
Change-Id: I72def76df4f105a3496c7b2dd1588910e62d562b
2023-10-04 10:37:05 -04:00
Liz Kammer
e10fef75f1 Remove unnecessary flag for Kotlin compiles
This has been fixed in upstream Kotlin

Test: add /tmp/build.txt file and m metalava
Change-Id: I6d088548ee5a31452ad637bbdd75e26c8863926d
2023-10-04 10:37:05 -04:00
Justin Yun
dead374d4d Merge "Generate product variants by default" into main am: ce12ea8f95
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2762829

Change-Id: I31046c62e08a60dbc460f3ac8393782d868d630d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 07:07:47 +00:00
Justin Yun
ce12ea8f95 Merge "Generate product variants by default" into main 2023-10-04 06:29:31 +00:00
Colin Cross
e18bd2097b Don't pass -lrt or -lgcc_s to darwin rust compiles
Fix mac builds by removing the -lrt and -lgcc_s flags from darwin
rust compiles.

Bug: 293349612
Test: builds
Change-Id: I99a9fea963761730efc4d3236135ee6d83dbca57
2023-10-03 21:45:33 -07:00
Treehugger Robot
31f5c0d738 Merge changes Ib2667798,I9a1fa32b into main am: 4cbd49810c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2771005

Change-Id: I80f97088df6104a3e69846ffcf995c24b71bb1ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 00:25:38 +00:00
Treehugger Robot
3afb5d8c7b Merge "Revert "Split Rust crate builds into compile and link phases."" into main am: 2d1bf53169
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2768553

Change-Id: I978411fe3639ad3684cb9d5941fd38369a2ac764
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 00:24:55 +00:00
Treehugger Robot
4cbd49810c Merge changes Ib2667798,I9a1fa32b into main
* changes:
  Symlink to rules_testing in soong integration test.
  Remove AconfigJavaHostTest from the allowlist.
2023-10-04 00:22:57 +00:00
Treehugger Robot
2d1bf53169 Merge "Revert "Split Rust crate builds into compile and link phases."" into main 2023-10-04 00:01:08 +00:00
Yu Liu
d61dcef2ff Symlink to rules_testing in soong integration test.
Bug: None
Test: CI
Change-Id: Ib2667798ba4ae330ff46978b37c9c50a5a0cd477
2023-10-03 14:49:50 -07:00
Treehugger Robot
4003606c5f Merge "Don't delete withres-withoutdex jar from R8 rules" into main am: 72928074f5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769925

Change-Id: I138e00eec2622acd40b8329fe1d04b9c31c9b6c6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 19:52:57 +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
4ea798d3fd Merge "Revert "Modify symlink_forest to rerun when soong_build has changed."" into main am: 4ac292ffd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769443

Change-Id: If1c67dc37b57f3dd11d7805ec2a55e8ebcdb9769
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 19:04: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
Colin Cross
8484082fad Don't create withres-withoutdex files for R8
The withres-withoutdex files were added in b/195558228 because D8
produced errors when given an input jar that contained both class
and dex files:
Error: com.android.tools.r8.internal.Cc: Cannot create android app from an archive 'out/soong/.intermediates/libcore/libcore-crypto-tests/android_common/withres/libcore-crypto-tests.jar' containing both DEX and Java-bytecode content

It turns out R8 doesn't have this problem, it defaults to ignoring *.dex
files unless the com.android.tools.r8.allowDexInputToR8 system property
is set.  Remove the withres-withoutdex files when using R8, but keep
it in place for D8 for now.

Bug: 302573555
Bug: 303264288
Bug: 303064127
Test: m checkbuild
Test: m Calendar && m Calendar
Test: m framework-minus-apex && m framework-minus-apex
Change-Id: Ib6410f7fef6faf5913476c6423cdd27215c68c45
2023-10-03 18:27:28 +00:00
Yu Liu
b57dd3946e Remove AconfigJavaHostTest from the allowlist.
It was added by an accident previously.

Bug: None
Test: CI
Change-Id: I9a1fa32bb2686f336f9735a1e809a8491d38cd4c
2023-10-03 11:22:07 -07:00
Jihoon Kang
3d1cecda28 Merge changes from topic "expose_flagged_api_revert" into main am: a7e5e29ec1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769001

Change-Id: Id1645b93c56654857c6d8ae551227c728ac76e50
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 18:02:14 +00:00
Spandan Das
063030cbb7 Merge "Handle symlinks in isPackageBoundary" into main am: 29af2a470d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769118

Change-Id: Id479359b55f4b75b92817cdeb3a5aaa4333c9c6e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 18:01:43 +00:00
Yu Liu
2d7db62bcc Merge "Convert java_aconfig_library to bazel." into main am: 7a90fcfa45
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2755429

Change-Id: I298633470fbb8c41442104419b811ac59751d213
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 18:01:26 +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
Zi Wang
8cae29f34c Merge "Allowlist tradefed-common-util and some dependents for tradefed" into main am: 33befd0c58
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769103

Change-Id: Ib863c47261892d3cd594f3afd31475491a2def04
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 17:12:01 +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
63838903f1 Merge "Change bp2build to switch to using custom fdo_profile macro" into main am: 85455887b7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2763705

Change-Id: I70500dc91ed9ce7784188bd7af1c5e6ce011b593
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 15:34:56 +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
Anton Hansson
b06bb5762e Support passing lint baseline to doclava
There are many issues in the docs, so allow specifying a baseline
file that allows existing lint errors in doclava.

Bug: 217734059
Test: m docs
Change-Id: I8997e47a497e1366247e8354be492805f300a16e
2023-10-03 12:15:19 +00:00
Colin Cross
004bd3f526 Revert "Split Rust crate builds into compile and link phases."
This reverts commit e7c71c344d.
The intermediates created by the separated rust compile steps are very
large, on the order of 60GB.  This is more than CI can support for now,
revert the split into compile and link phases.  This comes at the expense
of incremental build time, especially when modifying C/C++ sources that
are dependencies of rust modules.

Bug: 293349612
Test: builds
Change-Id: I81169e7d0727330c8de5e7688dcdc87fe7b8d3b5
2023-10-02 22:15:55 -07: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
Chris Parsons
5f1b3c7ad8 create, but dont register, bp2build_deps mutator
This is the bulk of the "allowlist v2" feature. It will disable bp2build
generation for modules which have transitive dependencies without a
bazel build definition.

This CL includes this mutator, but doesn't register it as a bp2build
mutator (outside of a few unit tests). This allows us to easily iterate
on completion of this feature and ensure there are no launch blockers
before we finalize the change in AOSP.

Bug: 285631638
Test: Unit tests
Change-Id: Ifb0a079c409ca19b02cafa3fab2efa0d3deebc50
2023-10-03 00:16:30 +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
11e2cee9a6 Merge changes from topic "linter_integration_tests" into main am: 77b232da24
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2769019

Change-Id: I644f41e0eefef143396008663d02aa1c2f07b348
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 23:30:03 +00:00
Treehugger Robot
1b3e900e4c Merge "Remove -Wsign-promo." into main am: 2eff89a8ce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2770219

Change-Id: I5aa4ad1382edbb1335d83e8f2170deb53ffd4618
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 23:27:55 +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
2cf4265572 Merge "More documentation for C++ global config." into main am: eae6635a0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2770218

Change-Id: Iea1588705a75630c398bda2931123e6df94022a4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-02 23:12:35 +00:00
Krzysztof Kosiński
eae6635a0f Merge "More documentation for C++ global config." into main 2023-10-02 22:27:21 +00:00