Commit Graph

4302 Commits

Author SHA1 Message Date
Romain Jobredeaux
6ba0a6a4a9 Merge "Initial bp2build converter for android_app." am: 4526269c2e am: f7a7a95c07 am: 019d78829d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907394

Change-Id: If3d0529d27a617440cee0b95112dd896801b0ae6
2021-12-07 21:17:05 +00:00
Chih-Hung Hsieh
80783774b9 Add (obj|tidy)-*_os, and (obj|tidy)-*_subset targets
* The obj-* targets only call clang or clang++ to compile
  C/C++ files, like the tidy-* targets only call clang-tidy.
* Add (obj|tidy)-dir_os and module_os-(obj|tidy) phony targets
  to include only targets of the specified OS.
* Add (obj|tidy)-dir_os_subset and module_os_subset-(obj|tidy) phony targets
  to include only a subset of that OS target group.
  * Most clang-tidy runs produce the same warnings for all variants
    of an OS. The *_subset targets reduce runs over multiple variants.
  * The obj-*subset targets are useful for a quick test to compile
    at least one variant of every C/C++ file for each OS.
* The (obj|tidy)-soong phony target is changed to include only
  (obj|tidy)-top_level_directory targets instead of ALL
  module-(obj|tidy) targets in all subdirectories.
* For aosp_arm64-eng make tidy-* targets; count NINJA commands:
    tidy-soong                     381K
    tidy-soong_subset              106K
    tidy-soong_android             294K
    tidy-soong_android_subset       73K
    tidy-soong_linux_glibc          84K
    tidy-soong_windows              12K
    tidy-bionic                     12K
    tidy-bionic_subset               2.4K
    tidy-bionic_android             11.5K
    tidy-bionic_android_subset       2.1K
    tidy-bionic_linux_glibc          1K
    tidy-device_android              7K
    tidy-device_android_subset       5K
    tidy-hardware_android            3K
    tidy-hardware_android_subset     9K
    libfec_rs-tidy                   33
    libfec_rs_subset-tidy             9
    libfec_rs_android-tidy           18
    libfec_rs_android_subset-tidy     3
* For aosp_arm64-eng make obj-* targets; count NINJA commands:
    obj-soong                      399K
    obj-soong_subset               112K
    obj-soong_android              305K
    obj-soong_android_subset        75K
    obj-soong_linux_glibc           90K
    obj-soong_linux_glibc_subset    38K
    obj-soong_windows               12K
    obj-bionic                      15K
    obj-bionic_subset                3K
    obj-bionic_android              14K
    obj-bionic_android_subset        2.3K
    obj-bionic_linux_glibc           1.3K
    obj-system-core                  6K
    obj-system-core_subset           3K
    obj-frameworks-base             16K
    obj-frameworks-base_subset       6K
    libfec_rs-obj                    33
    libfec_rs_subset-obj              9
    libfec_rs_android-obj            18
    libfec_rs_android_subset-obj      3

Test: NINJA_ARGS="-n" WITH_TIDY=1 make some_obj_tidy_target;
      compare output commands from various phony targets
Bug: 199169329
Bug: 202769240
Change-Id: I186c45dc07c5884888c1063dfc09cf212ffb0ebf
2021-12-07 12:58:11 -08:00
Romain Jobredeaux
4526269c2e Merge "Initial bp2build converter for android_app." 2021-12-07 20:14:29 +00:00
Liz Kammer
eb2d6d1ffd Propagate headers from bazel to mixed builds
Bug: 208503274
Test: mixed_libc.sh
Change-Id: I0be57f2a22f48be3a919208db4034d2bd03c18c0
2021-12-07 10:25:11 -05:00
Romain Jobredeaux
1282c42484 Initial bp2build converter for android_app.
The only supported attributes at this point are:
- srcs
- manifest
- package_name
- resource_dirs
as they most easily map to bazel's android_binary's srcs, manifest, custom_package, and resource_files respectively.
Allow-listing all apps that use these fields, along with sdk_version and dex_preopt. The latter 2 are ignored by the converter,
- sdk_version because we're currently relying on a single pre-built SDK,
- dex_preopt because,
   1. though it is not supported in Bazel builds yet, it doesn't prevent the apps from building, and
   2. the apps being converted only use the dex_preopt attribute to disable dex_preopt, which is what is happening anyway.

Change-Id: I4a4f771eeb8f60a1cd4844b2ac1ce3df7c070e73
Test: ./build/bazel/scripts/run_presubmits.sh
Bug: 198224074
Bug: 203688791
2021-12-07 09:41:49 -05:00
Yi Kong
f0071759e5 Merge "addSamplingProfileGatherFlags is no longer needed" am: b0d167cb43 am: 84afb3787b am: 8a98aff182
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908874

Change-Id: Id8e6c9021cbe08983932e0a4a0e0eae2cbed74aa
2021-12-07 05:17:51 +00:00
Yi Kong
b0d167cb43 Merge "addSamplingProfileGatherFlags is no longer needed" 2021-12-07 04:27:14 +00:00
Artur Satayev
44d0ef55da Merge "Add ModuleWithMinSdkVersionCheck type." am: a4fc08d204 am: 25f5783263 am: fe55ffd190
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907860

Change-Id: I3bfb508247c9eb6d47ae006e705766b689977454
2021-12-06 17:38:10 +00:00
Artur Satayev
a4fc08d204 Merge "Add ModuleWithMinSdkVersionCheck type." 2021-12-06 16:53:28 +00:00
Liz Kammer
b8c8e8c6bf Merge "bp2build: support full/lite protos in cc libs" am: 85c0097d69 am: 03b6cf4e30 am: 42866b6eb7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838061

Change-Id: I2281072f66d57da2b02d54a6376e939f266aa2b7
2021-12-06 15:34:32 +00:00
Liz Kammer
85c0097d69 Merge "bp2build: support full/lite protos in cc libs" 2021-12-06 14:46:34 +00:00
Jingwen Chen
cf33d8e025 Merge "Allowlist //build/soong/cc/{ndkstubgen,symbolfile}." am: a86cbd4a49 am: 8d6f36b4b1 am: b7601ceb3a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1906372

Change-Id: I1f4dfd8ee550dc57672f4c39eab4c72a68d169c6
2021-12-06 12:54:13 +00:00
satayev
b3fd411465 Add ModuleWithMinSdkVersionCheck type.
This is to help following refactor for individual modules to have their
own version of checking where needed.

For example, apk in apex may want to enforce it's own version of
CheckMinSdkVersion.

Bug: 205923322
Test: presubmit
Change-Id: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
2021-12-06 12:05:48 +00:00
Jingwen Chen
a86cbd4a49 Merge "Allowlist //build/soong/cc/{ndkstubgen,symbolfile}." 2021-12-06 11:36:52 +00:00
Yi Kong
5ded619f3e addSamplingProfileGatherFlags is no longer needed
We already add the "-fdebug-info-for-profiling" flag globally by default.
Besides, Sampling PGO does not need additional target-specific build
flags, unlike instrumentation PGO.

This is preparation to separate out sampling pgo into a separate module.
NFCI.

Test: presubmit
Change-Id: Icb28a98c021a78db25d8cb5ca9694ed6b7367a8d
2021-12-06 08:14:00 +00:00
Usta Shrestha
dbdf899fc9 Merge "Removal of unused methods AppendProperties and PrependProperties from topDownMutatorContext" am: fdee90d925 am: 5bdf4a6443 am: 6eed40aff4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1909336

Change-Id: I5b8408033f8be07248aa978f84816ca072fd6164
2021-12-03 16:30:40 +00:00
Jingwen Chen
89e2188d49 Allowlist //build/soong/cc/{ndkstubgen,symbolfile}.
This contains the tool to generate stub libraries.

Bug: 208215661
Bug: 207812332

Test: b run //build/soong/cc/ndkstubgen
Change-Id: Id48d74381457e0a62aca0ed7f8a9367886863bfd
2021-12-03 01:13:40 +00:00
Usta
355a587e38 Removal of unused methods AppendProperties and PrependProperties from topDownMutatorContext
Test: m nothing
Bug: n/a

Change-Id: Ia37d1c9b96c39603964ba8db2ea6ba52d1138472
2021-12-02 15:21:45 -05:00
Liz Kammer
12615dbbca bp2build: support full/lite protos in cc libs
Test: bp2build.sh
Bug: 200601772
Change-Id: I3a7e00546726bc63b5eb8d5604557c5988a5320b
2021-12-02 11:00:46 -05:00
Artur Satayev
75c5711c9f Merge changes Ieb9aef29,I6985ebb6 am: fb0a7234d7 am: 76ab9442a1 am: f258945ced
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1906590

Change-Id: I21d55aff27e99c1e51d387f25865f568cd770ff2
2021-12-02 15:56:52 +00:00
Artur Satayev
659c3144b5 Merge "Test SdkSpecForm." am: a71eabb705 am: 1fc2cf0ef6 am: 48fe6ad1cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907852

Change-Id: I90ebac8f747498b0e174adfe7f01316295d3c808
2021-12-02 15:56:22 +00:00
Artur Satayev
fb0a7234d7 Merge changes Ieb9aef29,I6985ebb6
* changes:
  Propagate min and max sdk versions to classpaths.proto configs.
  Introduce max_sdk_version device property.
2021-12-02 14:53:48 +00:00
Artur Satayev
a71eabb705 Merge "Test SdkSpecForm." 2021-12-02 14:49:21 +00:00
Jooyung Han
0cc1d4dc46 Merge "Set min_sdk_version (system/core)" am: 3d221b302a am: 3fb87f01f3 am: 2db4b4ccdf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899133

Change-Id: Idaf2edaf7d1e074c02492a677aea8dfe5b4529a9
2021-12-02 03:41:43 +00:00
Jooyung Han
3d221b302a Merge "Set min_sdk_version (system/core)" 2021-12-02 02:27:20 +00:00
satayev
cca4ab762e Propagate min and max sdk versions to classpaths.proto configs.
These attributed define a range for dessert releases where the jars
should be active, and included in corresponding CLASSPATH varibles by
derive_classpath.

Bug: 190818041
Test: presubmit
Change-Id: Ieb9aef29657ad0694d48a63019f93faca2678252
2021-12-01 17:58:41 +00:00
satayev
0ee2f913ef Test SdkSpecForm.
Bug: 190818041
Test: presubmit
Change-Id: Ib8cd891f03537712d709ed063dd76dee55221118
2021-12-01 17:43:00 +00:00
Jingwen Chen
24e6623e1f Merge "Move libprotobuf-cpp-full and libprotobuf-cpp-lite to mixed builds denylist." am: a358fdb6f3 am: 8e667b8c7f am: 96e231c96d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1903457

Change-Id: I055800648507f48c6e74e60a0468ee4dab52cc05
2021-12-01 14:23:59 +00:00
Jingwen Chen
a358fdb6f3 Merge "Move libprotobuf-cpp-full and libprotobuf-cpp-lite to mixed builds denylist." 2021-12-01 13:32:27 +00:00
Colin Cross
fddadb4982 Merge "Switch default for InstallBypassMake to true" am: 9579f4c05d am: d8c4562f7b am: 33efd2114f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1889721

Change-Id: I7addbed78fb4e9a87875a0b31a8d9781faf9dd15
2021-11-30 21:20:50 +00:00
Colin Cross
9579f4c05d Merge "Switch default for InstallBypassMake to true" 2021-11-30 20:31:26 +00:00
Christopher Parsons
c604da7467 Merge "bp2build implementation for c_std" am: 93c3cb69bc am: cd37948bf8 am: 640ecbcd91
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1905394

Change-Id: I19fa19b75b23bc03ff5a4fe664823406583a8891
2021-11-30 16:39:18 +00:00
Christopher Parsons
93c3cb69bc Merge "bp2build implementation for c_std" 2021-11-30 15:50:31 +00:00
Jingwen Chen
d480859cee Move libprotobuf-cpp-full and libprotobuf-cpp-lite to mixed builds denylist.
These libraries can be built by bazel, but not in the target and product
variant as required in mixed builds. See associated TODO for more info.

Bug: 206538317
Bug: 204810610
Bug: 204811222

Test: b build //external/protobuf:all
Change-Id: I45802c682dd40874de6393708d27323152463db6
2021-11-30 02:28:29 +00:00
Chris Parsons
2b1f99ace0 Unravel much of the bp2build denylist. am: 8a4981617f am: ba9ea3fd23 am: 78dc881f8d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1900630

Change-Id: I70e1649155dfe44b3886d22d78d176558b83204b
2021-11-29 23:46:26 +00:00
Chris Parsons
79bd2b7761 bp2build implementation for c_std
Test: mixed_droid in conjunction with topic changes
Change-Id: Ic673c1b269f5082b490b32057eb60f3b73eb0940
2021-11-29 18:38:31 -05:00
Chris Parsons
8a4981617f Unravel much of the bp2build denylist.
This change involves adding a number of packages to the bp2build allowlist,
and subsequently adding several specific modules to the denylist (with reasoning).

The end result is that:
1. It's more clear why certain modules are denylisted, either via their unsupported
   dependencies or unsupported properties.
2. This increases the number of converted targets to 320, up from 284.

Test: mixed_droid.sh
Test: bp2build.sh

Change-Id: I9f50869401455033a191c6c41d3836509afe1071
2021-11-29 12:07:25 -05:00
Martin Stjernholm
0ba4875b63 Merge "Fix prebuilt selection logic for cc_prebuilt_library_headers." am: a3ee4aadce am: 7867136695 am: c18029760a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1900779

Change-Id: I614a8ec0a0b148a49cf0be9345763990484494d4
2021-11-26 11:55:08 +00:00
Martin Stjernholm
a3ee4aadce Merge "Fix prebuilt selection logic for cc_prebuilt_library_headers." 2021-11-26 11:19:42 +00:00
Treehugger Robot
35e2c090c5 Merge "Add //build/bazel/examples/soong_config_variables/... to bp2build allowlist." am: fe87ccef2a am: 8fea65b2dd am: 90b7f769e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1901436

Change-Id: I7a9d6a2701598981b781421a07e62da2bddaf2b3
2021-11-26 08:27:49 +00:00
Treehugger Robot
fe87ccef2a Merge "Add //build/bazel/examples/soong_config_variables/... to bp2build allowlist." 2021-11-26 07:51:43 +00:00
Pedro Loureiro
273921d0e6 Perform validation of shared library attributes am: c362142438 am: 4b495f1a5c am: 882970a63b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1901599

Change-Id: Ide035ab094587eef279c2f9d47bd08217d8c321a
2021-11-25 13:06:33 +00:00
Pedro Loureiro
4b495f1a5c Perform validation of shared library attributes am: c362142438
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1901599

Change-Id: I9af9c79cc0808854129c728ea21cd2bb117f5843
2021-11-25 12:38:35 +00:00
Treehugger Robot
8a0dd0265b Merge changes Iecf7edd6,Iaca5cf23,I01d57919
* changes:
  Fix attribute names in generated permissions.xml
  Perform validation of shared library attributes
  Add support for new permissions library tag attributes
2021-11-25 12:22:37 +00:00
Cole Faust
409ab59126 Merge "Change type of Unbundled_build_apps from bool to []string" am: b3a4ff4fa5 am: afb25de476 am: d33989cf01
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1901371

Change-Id: Iba38ceb97d0e43d251c22f5e86360507c7e8183c
2021-11-25 02:00:26 +00:00
Cole Faust
b3a4ff4fa5 Merge "Change type of Unbundled_build_apps from bool to []string" 2021-11-25 01:06:53 +00:00
Martin Stjernholm
e65c3aee02 Fix prebuilt selection logic for cc_prebuilt_library_headers.
Unlike other prebuilt modules it doesn't have a srcs property of any
kind, so android.Prebuilt cannot defer to the source module just
because its srcsSupplier would return nil.

Test: m nothing
Bug: 202192894
Change-Id: Iafcf165569bad6eae37820cf71aa0fcacb720e02
2021-11-24 20:48:04 +00:00
Pedro Loureiro
c362142438 Perform validation of shared library attributes
Perform consistency checks as per http://go/updatable-shared-libraries

These include:
  * no attribute can specified can be less than T
  * max-device-sdk can't be less than min-device-sdk
  * min and max-device-sdk need to be at least the module's
  min_sdk_version
  * using on-bootclasspath-before implies that the module's
  min_sdk_version is at least T or the library has min-device-sdk of at
  least T

Test: m nothing

Bug: 191978330

Change-Id: Iaca5cf23fb0bc7e65effb3529c8e829560894c2e
Merged-In: Iaca5cf23fb0bc7e65effb3529c8e829560894c2e
(cherry picked from commit f9e584dd20)
2021-11-24 17:09:19 +00:00
Usta Shrestha
cd82dfe9eb Merge "Minor refactoring of Append/PrependProperties() methods Test: m nothing and compare ninja file Bug: n/a" am: 8c64fa9a8e am: 4bcee485b9 am: d2e2742b45
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1900990

Change-Id: I91ea68293420b701a1724f12177feaf10c2951b9
2021-11-24 16:07:07 +00:00
Usta Shrestha
8c64fa9a8e Merge "Minor refactoring of Append/PrependProperties() methods Test: m nothing and compare ninja file Bug: n/a" 2021-11-24 15:18:37 +00:00