Commit graph

58100 commits

Author SHA1 Message Date
Zi Wang
0a8a129ee8 Handle product config specific header_libs prop in cc bp2build
Product variable header_libs is able to be converted.
Since static_libs and header_libs both use implementationDeps,
also added logic to make sure they both contribute to bazel
target.

Bug: 228314770
Test: m bp2build
Test: TestCcLibraryProductVariablesHeaderLibs in cc_library_conversion_test
Change-Id: I370fc75b666b3908b6ac5ed42bca5560f957fc42
2022-09-01 14:32:51 -07:00
Treehugger Robot
845c4c1646 Merge "Fix ProcessBazelQueryResponse of filegroup" 2022-08-19 17:16:58 +00:00
Paul Duffin
1149c2c185 Merge changes I66445302,I773279a4
* changes:
  Push Hidden_api inside HiddenAPIFlagFileProperties
  Refactor handling of hidden API property provided information
2022-08-19 15:08:13 +00:00
Treehugger Robot
e29d230b75 Merge "Allow libcore to have NewApi warnings" 2022-08-19 14:32:57 +00:00
Treehugger Robot
3651a5dccb Merge "Dedup apiFile and removedApiFile fields" 2022-08-19 14:12:57 +00:00
Paul Duffin
9b61abbd84 Push Hidden_api inside HiddenAPIFlagFileProperties
All usages of HiddenAPIFlagFileProperties use it as the type of a
Hidden_api field. This change pushes the field inside the struct and
just embeds the struct inside the structs that need it making it
simpler and more consistent with how the HiddenApiPackageProperties
struct is used.

This is extracted as a separate change as while the change is simple
it does affect a lot of lines. Keeping it separate makes it easier to
review the changes.

Bug: 240406019
Test: packages/modules/common/build/mainline_modules_sdks.sh
      # Ran the previous command with and without this change to make
      # sure that this change does not change the sdk snapshot
      # contents.
Change-Id: I664453029574ef68dc5712f7bf137a1a6e78e864
2022-08-19 13:29:47 +00:00
Paul Duffin
1e9e9388d8 Refactor handling of hidden API property provided information
In preparation for adding hidden API properties to individual
java_sdk_library modules this change refactors the handling of that
information.

1. Renames HiddenApiPackageProperties to HiddenAPIPackageProperties
   to be consistent with other similar structs.

2. Creates a new HiddenAPIPropertyInfo struct to be used to provide
   property derived information from one module to another. It includes
   both flag files as well as the information about which packages are
   used.

3. The HiddenAPIPropertyInfo is embedded within the existing
   HiddenAPIFlagInput in place of the existing flag files field.

4. The fields in the HiddenAPIPropertyInfo struct are populated from
   the HiddenAPI*Properties structs.

5. Access to package information is retrieved from the info struct
   instead of directly from the properties. That means that no changes
   will be needed to this code when info from other modules is merged
   into the struct in a follow up change.

Bug: 240406019
Test: packages/modules/common/build/mainline_modules_sdks.sh
      # Ran the previous command with and without this change to make
      # sure that this change does not change the sdk snapshot
      # contents.
Change-Id: I773279a4b621bcc3c40e3bfe193f2c7b0caeccd6
2022-08-19 13:28:47 +00:00
Paul Duffin
29d1667846 Merge "Reformat build/soong for go 1.19" 2022-08-19 10:57:42 +00:00
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
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
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
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