Commit graph

58150 commits

Author SHA1 Message Date
Vinh Tran
16fe8e1cf1 Fix ProcessBazelQueryResponse of filegroup
In mixed builds currently, filegroup doesn't use path prop when creating the paths to the srcs. It defaults to ModuleDir.

Hence, when java.genAidlIncludeFlags [1] calls srcFile.Rel() to eventually create the AIDL include dir for AIDL flags, srcFile.Rel() returns the filepath relative to the module directory instead. This CL appends path prop to module dir when creating relativeRoot.

This fixes the bridge between converted filegroup that set path prop (e.g. libbinder_aidl) to unconverted module (for example, droidstubs). The fix is needed for the child CL aosp/2186599 to convert libbinder_aidl to Bazel. Without this fix, module-lib-api-stubs-docs-non-updatable (unconverted module that depends on libbinder_aidl) can't be built in mixed builds.

[1]: https://cs.android.com/android/platform/superproject/+/master:build/soong/java/gen.go;l=123?q=java%2Fgen.go

Test: go test
Bug: 243010121
Change-Id: Ic2dd2ab9199c62010303a5b8c611d722f4a4118d
2022-08-18 13:59:06 -04:00
Yi Kong
736664571b Merge "Revert "Turn on Global ThinLTO by default"" 2022-08-18 17:24:55 +00:00
Chris Parsons
9ae019cc76 Retrieve shared lib output from custom provider
Use of the native CcSharedLibraryInfo results in using a superfluous
symlink for shared libraries in mixed builds. The new provider
propagates an unwrapped output file (real file, not a symlink).

Test: With related rules changes, manually verified that installed
mixed-build libc was not a symlink. (cf_x86_64, inspected system.img
with `m droid`)

Change-Id: I2a59b348fbfc2a381c229d66c0098e87674a9ddc
2022-08-18 12:25:47 -04:00
Trevor Radcliffe
7f897fcef0 Reexport whole_static_libs in cc_library_headers
Fixes: 236268577
Test: Unit Tests
Change-Id: I3a13f850d1d593b90c79f668f1eaf5be0035db1f
2022-08-18 15:53:00 +00:00
Yi Kong
b90ff82772 Revert "Turn on Global ThinLTO by default"
This reverts commit 406e7b725b.

Reason for revert: ndk_translation causes clang to crash

Change-Id: I61b262157f9f57c739391757d5a1f95299ddadca
2022-08-18 14:53:34 +00:00
Paul Duffin
c71d2b7629 Dedup apiFile and removedApiFile fields
Previously, there were two separate fields for each of the API and
removed API files because in some cases it needed a WritablePath and in
other cases it could only be a Path.

This change refactors the code so that the WritablePath is no longer
needed, the duplicate fields deleted and the remaining field is changed
to Path. It also removes a few unused fields.

Bug: 234113632
Test: m nothing
Change-Id: If81f5fe2aa05d9d7b2bc23869fdb2397649d67b3
2022-08-18 09:40:01 +00:00
Yi Kong
3352ceb691 Merge changes from topic "global-thinlto"
* changes:
  Turn on Global ThinLTO by default
  Only enable global ThinLTO for LP64 targets
2022-08-18 08:57:07 +00:00
Kiyoung Kim
835c589a77 Fix bugs from cc_api_library build
There are some bugs found while building cc_api_library with original
library definition. This change fixes some bugs from cc_api_library.

* Generate MK information for cc_api_library.
* Mark cc_api_library as no CRT required.

Bug: 236087698
Test: ALLOW_MISSING_DEPENDENCIES=true m -j vendorimage succeeded
Change-Id: Ib411888fae41317c01378362cd5bdc87c2b588c5
2022-08-18 00:07:46 +00:00
Cole Faust
6b29f593ea Bp2build support for runtime_libs
Bug: 213201180
Test: Updated the minimal apex in the build/bazel cl to include runtime_libs so the apex diff test will test it
Change-Id: I10add1895cfa122a370d24196a33ec2dcfafccfc
2022-08-17 15:20:17 -07:00
Jihoon Kang
3690485a16 Remove unnecessary lunch output
Currently, running lunch writes multiple lines including less
informative ones.
This change removes unnecessary variables and enables the user to focus
on more useful information when running the lunch command.

Bug: 204196816
Test: m
Change-Id: Ifbbe01abf03a1701158881febe5982489f96dc65
2022-08-17 21:16:44 +00:00
Jihoon Kang
6e294b496e Merge "Update link to Bazel's documentation in README." 2022-08-17 20:38:19 +00:00
usta
406015b2da typos: SOONG_DELVE and SOONG_UI_DELVE in README.md
leading colons raise "too many colons in address" error

Test: SOONG_DELVE=:5006 m
Bug: N/A
Change-Id: I311a9b807d97f3fc33411d44e5ec8dfe02376f55
2022-08-17 14:45:12 -04:00
Colin Cross
d079e0b270 Reformat build/soong for go 1.19
Test: none
Change-Id: I132368f0fcbdb5ea088b5b84dbe4ccfdd9e94cad
2022-08-17 10:43:13 -07:00
Zhenhuang Wang
852d0c4859 Merge "Move common test_options properties into the android package" 2022-08-17 15:22:18 +00:00
Jingwen Chen
b2f584ba58 bp2build: allowlist frameworks/av/media/liberror/... and denylist broken targets.
New target from AOSP 13 drop.

Test: bp2build.sh
Change-Id: Ica819c5c5c42b52ce11514f146e09065f9690e9b
2022-08-17 10:51:27 +00:00
Paul Duffin
13fe665176 Merge "Revert "Check that API is up-to-date when building java_sdk_library"" 2022-08-17 09:13:23 +00:00
Orion Hodson
b816652ee0 Allow libcore to have NewApi warnings
The majority of libcore NewApi warnings come from references to new
methods, constants, fields added in a file and then referenced in the
same source file. Maintaining suppressions is not scalable: they need
to work across multiple API versions in different branches.

Bug: 208656169
Test: TH
Change-Id: If5e746f25f1bd34931ee8c89b363aa92c81e23b3
2022-08-17 09:34:09 +01:00
Hsin-Yi Chen
0713e4f173 Revert "Disable RBE for header-abi-dumper"
This reverts commit 6580d84f51.

Reason for revert: The bugfix for reproxy was released to this branch.

Test: make
Bug: 226497964
Change-Id: I38e30d3dc71fa7857a61fcadf5895075608fd966
2022-08-17 12:57:48 +08:00
Yi Kong
406e7b725b Turn on Global ThinLTO by default
Apply ThinLTO without optimization (--lto-O0) globally. This saves us
2.24% in binary size for system/lib64, as well as more than 4.68% build
time improvement.

Test: presubmit
Bug: 169004486
Change-Id: I1ed90c2058f9ff1fa8a2d3fd7ac1191c5d98dac1
2022-08-17 09:27:02 +08:00
Yi Kong
2121d16db8 Only enable global ThinLTO for LP64 targets
Due to the lack of engineering efforts into LP32 targets, do not enable
global ThinLTO for them by default.

Test: presubmit
Bug: 169004486
Change-Id: I79b77baecf16fda95ff5dccc5a401596a0557d5d
2022-08-17 09:22:07 +08:00
Treehugger Robot
48ec5b302a Merge "Add lint test property" 2022-08-16 21:23:12 +00:00
Colin Cross
79845f9cce Merge "Collect suggested modifications from lint" 2022-08-16 20:38:16 +00:00
Colin Cross
dae32f2174 Merge "Allow duplicate files inputs in soong_zip" 2022-08-16 19:27:13 +00:00
Xin Li
6ef4fae229 Merge "DO NOT MERGE - Merge Android 13" 2022-08-16 19:08:20 +00:00
Yilin Ma
03a9dfc44e Update link to Bazel's documentation in README.
The page was moved to a new location with launch of the new Bazel site: https://blog.bazel.build/2022/02/17/Launching-new-Bazel-site.html.

Test: m
Change-Id: I53bd60b1f51209a6e4e2e498aed68391a9e52a71
Bug: b/242351623
2022-08-16 17:34:39 +00:00
Zhenhuang Wang
0ac5a431a9 Move common test_options properties into the android package
Multiple modules (e.g. java, cc, python, rust) define the `test_options`
field. Extract the common properties in test_options to share across
different test rules.

Bug: 240928948
Test: `refreshmod` and diff with original module-info.json
Change-Id: I404a7a157b4ccaa53d800ee2217559ff695bd825
2022-08-17 01:19:15 +08:00
Yu Liu
ae7fe1697c Merge "Re-enable the base hidl modules in mixed build." 2022-08-16 17:15:31 +00:00
Paul Duffin
e7a8664a6a Revert "Check that API is up-to-date when building java_sdk_library"
This reverts commit c166b68589.

Bug: 234113632
Bug: 236187167
Reason for revert: causes problems with update-api, see b/236187167

Change-Id: I4c88151cb5e2c86bb6c1a955c5065966a4fbb3e0
2022-08-16 15:43:20 +00:00
Alan Viverette
63e738ffe0 Merge "Add support for prepending text from a file" 2022-08-16 14:47:29 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
1ad11e6fbf Merge "Add StringAttribute for bp2building" 2022-08-16 11:51:07 +00:00
Mu-Le Lee
8f74418389 Merge "Diff source dump and previous version dump for Cross-Version ABI Check" 2022-08-16 05:07:28 +00:00
Xin Li
2822186571 DO NOT MERGE - Merge Android 13
Bug: 242648940
Merged-In: I90e7df9875594a1257e582ef62bac5084f0f939d
Change-Id: I9655a6c1a7e7e5a2c29d9fcee7e1411dad45bd1c
2022-08-15 21:59:11 -07:00
Treehugger Robot
6b56c375a1 Merge "CpExecutable should not preserve symlink" am: 90fbcf1c29
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2182362

Change-Id: I70637ef2695cadd5faad9ccb04e570d905896c8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 03:22:02 +00:00
Chih-Hung Hsieh
3ffefdcd76 Make llvm-strip depend on both lib and lib64 am: d1fb75df9a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2181235

Change-Id: Ibb945c851a06b3eb651870f14e15d64b68936f22
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 03:21:47 +00:00
Treehugger Robot
90fbcf1c29 Merge "CpExecutable should not preserve symlink" 2022-08-16 03:02:53 +00:00
Treehugger Robot
162a78412d Merge "Fix broken aosp-master-plus-llvm builds" am: 9a5db000da
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2185741

Change-Id: I9042eb1ce3ff4c4204d6f26745934736a2d11c9e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 01:29:47 +00:00
Chih-Hung Hsieh
d1fb75df9a Make llvm-strip depend on both lib and lib64
* Old compilers look up lib64/libc++.so.1
* New compilers look up lib/libc++.so.1

Bug: 241836377
Test: lunch sdk-userdebug; make sdk_repo
Change-Id: I90e7df9875594a1257e582ef62bac5084f0f939d
2022-08-16 01:04:59 +00:00
Chih-Hung Hsieh
1048a73f21 CpExecutable should not preserve symlink
* When copy to an $out file, a symlink can become a dangling link.
* The following chmod +x will fail with a dangling link.

Bug: 241815504
Test: presubmit builds
Change-Id: Ic3dd9d41376a94381981fb973b41a1650f5ac946
2022-08-16 01:03:10 +00:00
Treehugger Robot
9a5db000da Merge "Fix broken aosp-master-plus-llvm builds" 2022-08-16 01:01:34 +00:00
Treehugger Robot
2081b041ac Merge "set USE_RBE=false in Soong integration tests" am: 586b8bb37a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2175922

Change-Id: I22f3c7781083649ff922d152b5f305fd950b1da0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 00:45:21 +00:00
Treehugger Robot
586b8bb37a Merge "set USE_RBE=false in Soong integration tests" 2022-08-15 23:59:34 +00:00
Colin Cross
62695b9f01 Collect suggested modifications from lint
Pass --apply-suggestions to lint, which will cause it to apply
suggested fixes to the source files in the sandbox.  Zip up the
modified sources and export them outside the sandbox.

Test: examine suggested-fixes.zip
Bug: 216456886
Change-Id: Iaeb406462c38cf4b10e51d641432ba1fda9327fa
2022-08-15 16:05:03 -07:00
Colin Cross
7ddd08ad2b Allow duplicate files inputs in soong_zip
Accept duplicate file inputs in soong_zip when they are the same
source file.  This came up when trying to zip lint srcs, as some
java modules have duplicate source files that seem to be ignored
by javac.

Test: TestZip
Bug: 216456886
Change-Id: I8c43df9aded8cf094afaed79cca2b9eb091cc861
2022-08-15 16:05:03 -07:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
3a019a635a Add StringAttribute for bp2building
Instead of a StringListAttribute of length 1,
introduce a more appropriately reduced StringAttribute
so that e.g. `select`s work properly

Test: new cases in TestGenerateBazelTargetModules
Change-Id: I0ae0e4a51e39f85caf55b0d00459222ede6de79c
2022-08-15 22:59:56 +00:00
Yu Liu
dea2c72b02 Merge "Filter out headers generated by bazel in snapshot." am: 6715377e58
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2186395

Change-Id: Ie24a8e1b6732a8015789b280b8dfceab5c288d42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-15 21:39:18 +00:00
Chih-Hung Hsieh
8b5ecb8455 Fix broken aosp-master-plus-llvm builds
* New flags cannot be added before llvm_android
  has a new version.

Bug: 241941550
Bug: 241601211
Test: presubmit
Change-Id: Ibab8cfa9129eac824a3d5fb9c3124ba807ba4245
2022-08-15 14:36:02 -07:00
Yu Liu
6715377e58 Merge "Filter out headers generated by bazel in snapshot." 2022-08-15 21:32:01 +00:00
Yu Liu
aa40195d60 Merge "Move testing.go to srcs from testSrcs." am: 2cc767d72c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2183860

Change-Id: I9fa1b716f071eefa944b06a8045b6dac2ac2c1c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-15 21:30:52 +00:00
Yu Liu
6175e15807 Re-enable the base hidl modules in mixed build.
b/242220039 is resolved.

Bug: 232520859
Test: Run mixed_droid locally,
Change-Id: I63462bd1bb763eefec4c1665514b38c32bdd80a5
2022-08-15 21:29:57 +00:00
Yu Liu
2cc767d72c Merge "Move testing.go to srcs from testSrcs." 2022-08-15 21:12:42 +00:00