Commit Graph

7111 Commits

Author SHA1 Message Date
Yi Kong
53fc7705ec Merge "Turn on -Wstring-concatenation" 2021-12-17 04:05:37 +00:00
Treehugger Robot
b511584da9 Merge "Make all defaults modules bazelable" am: 3eed7f9a8b am: 3434f3734f am: 1cff15e0b1 am: cec672ffa9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1924162

Change-Id: I679379193a8e969fe90045de82aa8fd2593f0b83
2021-12-16 21:02:35 +00:00
Treehugger Robot
572334fe5b Merge "Add noOverrideExternalGlobalCflags support to Soong" am: cde46d7d98 am: 1f337626d2 am: 4e4352352c am: 3e28e343cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1924200

Change-Id: I2dde5ba90dcf67897b87f5d68c7bd4780570fd8a
2021-12-16 21:01:56 +00:00
Liz Kammer
9dc6577d55 Add -std user flags to cc test to ensure order
Test: go test soong tests
Change-Id: Iff2b82f59e138089d1c1726d9b51e040b00340ba
2021-12-16 11:38:50 -05:00
Treehugger Robot
3eed7f9a8b Merge "Make all defaults modules bazelable" 2021-12-16 01:36:47 +00:00
Treehugger Robot
cde46d7d98 Merge "Add noOverrideExternalGlobalCflags support to Soong" 2021-12-16 00:26:57 +00:00
Colin Cross
c68db4b305 Remove InstallBypassMake and ToMakePath
InstallBypassMake and ToMakePath are obsolete, remove them.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
2021-12-15 15:22:53 -08:00
Liz Kammer
450acfdd42 Merge "bp2build: Expand check if filegroup contains proto" am: b849d4a6d5 am: ccdd5a8de4 am: 774e8930d5 am: 6fb30b62e0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1916846

Change-Id: I4e063cbb5e993d661bdcf40e464aa36a9d47fc44
2021-12-15 21:42:43 +00:00
Liz Kammer
416201d081 Make all defaults modules bazelable
Since these are not being converted directly, this has two primary
impacts:
* defaults modules will no longer appear as unconverted deps.
* defaults modules do not have to be marked individually, which should
  allow all defaults-based soong-config-modules to just convert as
  necessary.

Test: bp2build.sh
Change-Id: I44c99d5a51d1887a95c17dfdf956f91af671b2ea
2021-12-15 13:18:42 -05:00
Liz Kammer
aabfb5dc47 bp2build: Expand check if filegroup contains proto
Previously we looked for proto as suffix, however, some filegroups use
"<foo>-proto-srcs" or "<bar>-proto-sources", instead we look for proto
as a distinct word in a filegroup name.

Test: go test soong tests
Change-Id: Icf916a84304a02617efff9768e5b82d5ffe658bd
2021-12-15 13:07:58 -05:00
Liz Kammer
487610a623 Merge "bp2build: do not convert prebuilt cc binaries" am: b29852a3da am: cf754196a8 am: fe0a45aa7b am: 59a2ef5a68
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1922861

Change-Id: I8da0d3964cd80e301529fc5e0631b65e9b2e20f0
2021-12-15 16:11:51 +00:00
Liz Kammer
b29852a3da Merge "bp2build: do not convert prebuilt cc binaries" 2021-12-15 15:07:58 +00:00
Stephen Hines
e24303f71a Add noOverrideExternalGlobalCflags support to Soong
noOverrideExternalGlobalCflags is a new set of flags intended to be
added at the end of the command line for 3rd party projects like
external/, hardware/, vendor/, and more. Our previous flags for external
projects occur way too early on the command line, leading to issues with
use for suppressing diagnostics. Note that support for this variable in
build/make is currently unimplemented, as there are no projects that
would depend on it. It could be added in the future, if it turns out to
be useful.

This change initially applies `-Wno-unused-but-set-variable` and
`-Wno-unused-but-set-parameter` to external projects because these
upstream projects aren't easily fixed, and the risk of actual bugs is
low.

Bug: http://b/197240255
Test: Build and check warnings
Change-Id: I26f56c5c52725dddb70dd8130ad61270eac7a9aa
2021-12-15 03:14:26 -08:00
Yi Kong
9feb029fe1 Turn on -Wstring-concatenation
Test: presubmit
Bug: 175068488
Change-Id: If1d37f744412ac2064d8cece251b39066f0e86c0
2021-12-15 17:30:31 +08:00
Wei Li
718d2a16ca Merge "Add the initial implementation of bp2build converter for java_library, java_library_host, java_binary_host and cc_library_host_shared so signapk tool can be built with Bazel." am: 2115d35101 am: 9adc5f84bb am: 38387e7624 am: b980aa5f6e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918122

Change-Id: If5a5f060862e1d6bc8ff2419c06d1d8a2e31d4ef
2021-12-15 04:47:38 +00:00
Wei Li
bafb6d6612 Add the initial implementation of bp2build converter for java_library,
java_library_host, java_binary_host and cc_library_host_shared so
signapk tool can be built with Bazel.

Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Test: jarsigner -verify -verbose build.bazel.examples.apex.minimal.apex
Bug: 209876137
Bug: 196204358
Bug: 210158864
Bug: 210159074
Bug: 210158872
Change-Id: I855884159d25e69d8f9623792c376da820a1eb4c
2021-12-14 17:23:19 -08:00
Liz Kammer
6299b235bb Merge "Use one mutator for all bp2build conversion." am: 92344259c5 am: 782f37eaee am: 5f4df317ee am: 037105c0f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1878397

Change-Id: I56073dc653947ebf69d7a74e97c1092f06aab139
2021-12-14 20:25:04 +00:00
Liz Kammer
bdc922f3fe bp2build: do not convert prebuilt cc binaries
These do not have a conversion process yet, do not convert them. Add
more protection against using the wrong conversion for prebuilts in cc.

Test: allowlist project with prebuilt objs/binaries and verify BUILD
      files
Change-Id: Ib26689fa19d6fbb1f5c73ded3b5836165977e987
2021-12-14 14:27:57 -05:00
Liz Kammer
be46fccc40 Use one mutator for all bp2build conversion.
Each conversion required defining a separate mutator, which will each
operate on _all_ modules and requires each to repeat checks whether the
mutator should operator. Instead, we introduce a single mutator and
modules can define a ConvertWithBp2build to implement bp2build
conversion for that module.

Test: bp2build.sh
Bug: 183079158
Change-Id: I99d4b51f441c2903879092c5b56313d606d4338d
2021-12-14 09:37:45 -05:00
Rupert Shuttleworth
5bff277b21 Merge "Handle includes for generated headers" am: 6f32f95b25 am: d469eefcc3 am: f56d2d4bfe am: c8f4b2ad17
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918455

Change-Id: Ia5538bb1609134261c64f6e4357fccd89514969a
2021-12-14 01:22:29 +00:00
Pirama Arumuga Nainar
71d697c5cb Enable memory-mapped coverage instrumentation
Bug: http://b/194128476
Bug: http://b/210012154

- pass -runtime-counter-relocation flag, which is needed to enable
memory-mapped coverage on Linux/Android.

- Include '%c' specifier in -fprofile-instr-generate compiler flag to
default to memory-mapped coverage.

- Disable continuous coverage if instrumentation is on for bionic/libc
(http://b/210012154).

Test: Run few coverage tests on Forrest.
Change-Id: Ie3a912f66470fcd3ffc2ffd73371a4e1d2b15df3
2021-12-13 14:44:32 -08:00
Liz Kammer
1263d9bdb1 Handle includes for generated headers
For generated headers, Soong introduces the package to the includes (and
re-exports as necessary).

Test: bp2build.sh
Change-Id: Iea9cda859ddaa3e5393f0f4533c15fc60222c408
2021-12-13 12:06:39 -05:00
Rupert Shuttleworth
d358c26a10 Add initial support for use_version_lib. am: 484aa25875 am: afbbd4316d am: 2b6dca1b8c am: efd0e0c7ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918278

Change-Id: Ief055b99fae6a3abc01ac82c43c9090718c6ca8b
2021-12-13 14:47:39 +00:00
Rupert Shuttleworth
484aa25875 Add initial support for use_version_lib.
Test: Resolves build error for BP2BUILD_VERBOSE=1 b build //packages/modules/adb:libadbd_core
Test: Added unit test

Bug: 208481704

Change-Id: I4022c686c7baf050de3f97295fe4654515622a66
2021-12-13 06:21:16 -05:00
Treehugger Robot
bba83741d4 Merge changes from topic "revert-1918946-revert-1899703-AMWIVCREEV-CCTEXIRRRV" am: f4c2bf6559 am: 45b20269f6 am: 4eb4bc649d am: 1fcba64203
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918949

Change-Id: Ib6e320631a5b35974560bf33aaca205006bc051e
2021-12-11 04:52:01 +00:00
Treehugger Robot
f4c2bf6559 Merge changes from topic "revert-1918946-revert-1899703-AMWIVCREEV-CCTEXIRRRV"
* changes:
  Revert^2 "Add dependency license annotations"
  Revert^2 "Build license metadata files in Soong"
2021-12-11 03:32:18 +00:00
Colin Cross
9ac1faf0af Revert "Add dependency license annotations" am: abe2a4b7bf am: a7fcadce74 am: 265eec85a8 am: 8110688fe1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918943

Change-Id: I8b1908cccf980e93769c5e72490a95846f45a851
2021-12-11 00:28:39 +00:00
Colin Cross
a7fcadce74 Revert "Add dependency license annotations" am: abe2a4b7bf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918943

Change-Id: I9438dc5f70a9e30071a051c11dd25f36789822d0
2021-12-10 23:20:49 +00:00
Colin Cross
65cb314c92 Revert^2 "Add dependency license annotations"
abe2a4b7bf

Change-Id: Ibcd16b5b779a4e6d4372dab9d21de76abae9ca9c
2021-12-10 23:05:02 +00:00
Colin Cross
67938c2925 Merge changes from topic "revert-1899703-AMWIVCREEV"
* changes:
  Revert "Build license metadata files in Soong"
  Revert "Add dependency license annotations"
2021-12-10 23:04:45 +00:00
Colin Cross
abe2a4b7bf Revert "Add dependency license annotations"
Revert submission 1899703

Reason for revert: b/210158272
Reverted Changes:
I142c19284:Reuse license metadata files from Soong
Ife89b8f23:Add dependency license annotations
I8e7410837:Build license metadata files in Soong

Change-Id: I51f33ae67311a3cff00d3e581d24c9a3411b7131
2021-12-10 23:02:41 +00:00
Colin Cross
d1ea62d5c9 Merge changes from topic "soong-license-metadata" am: b435744fdc am: 9a6e17e5c1 am: 1aa0005a1f am: 7d162acb13
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899703

Change-Id: Ie97f43055aa820cb5b1bd4faffe67f2c292a2ecb
2021-12-10 23:02:01 +00:00
Colin Cross
b435744fdc Merge changes from topic "soong-license-metadata"
* changes:
  Add dependency license annotations
  Build license metadata files in Soong
  Escape Host*Variable contents
2021-12-10 21:43:49 +00:00
Treehugger Robot
0621e6d216 Merge "Remove test_min_api_level property" am: ea8b7771f1 am: 39e3984e0d am: 3a32bdcf25 am: fd62f28d36
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1905090

Change-Id: I8b036f244cc2822c8431fad05274d72484a94765
2021-12-09 07:10:33 +00:00
Treehugger Robot
ea8b7771f1 Merge "Remove test_min_api_level property" 2021-12-09 05:51:25 +00:00
Dan Willemsen
7001bf44e1 Support macOS 12 SDK am: e3d50bfba9 am: d4105fcf60 am: 3452b082de am: aa967536d7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1914488

Change-Id: Id56dc643580403b5fa26adea30851a1c174d4b7f
2021-12-09 02:07:36 +00:00
Justin Yun
d396515482 Remove test_min_api_level property
Replace the test_min_api_level property with
test_options.min_shipping_api_level.

Bug: 187258404
Test: build
Change-Id: Ifbac62f389226ed690f0ec03b9cc0845132ae885
2021-12-09 00:16:41 +00:00
Dan Willemsen
d98c144f21 Merge "Add Darwin x86_64+arm64 universal binary support" am: ce69757379 am: 1bd7543d6e am: b2a6b903fb am: 4d913d8528
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1884611

Change-Id: I0b2e79c1ea2c2889c859fbbcd4ffb964531cf046
2021-12-09 00:04:21 +00:00
Colin Cross
b674b43656 Add dependency license annotations
Add annotations to dependency tags that are dynamic or classpath
linkage.

Bug: 207445310
Test: m checkbuild
Change-Id: Ife89b8f234aa40c380c721eda7dd18cab697fbb3
2021-12-08 15:08:59 -08:00
Dan Willemsen
e3d50bfba9 Support macOS 12 SDK
Test: build w/Xcode 13.1
Change-Id: I9062b8045c4b02551aeeff06f4d7416c766e53a6
2021-12-08 22:12:49 +00:00
Dan Willemsen
ce69757379 Merge "Add Darwin x86_64+arm64 universal binary support" 2021-12-08 21:08:43 +00:00
Liz Kammer
ac47b4d398 Merge "Propagate headers from bazel to mixed builds" am: 92d4188c2b am: 8534a37261 am: 5da0c42a09 am: cf392311e6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1912212

Change-Id: I3f53ec91a47c2eace89bff50458a8f861329f0fb
2021-12-08 14:35:48 +00:00
Liz Kammer
92d4188c2b Merge "Propagate headers from bazel to mixed builds" 2021-12-08 13:24:08 +00:00
Treehugger Robot
589ee0c600 Merge "Add (obj|tidy)-*_os, and (obj|tidy)-*_subset targets" am: 939cb7b028 am: bf92b6d44e am: c028e47a3a am: 3b23e8bcb1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1852749

Change-Id: Ie44defb9513e2aa1957300c9bb9778ab835e5602
2021-12-08 07:25:26 +00:00
Treehugger Robot
939cb7b028 Merge "Add (obj|tidy)-*_os, and (obj|tidy)-*_subset targets" 2021-12-08 06:03:14 +00:00
Dan Willemsen
4745007bb1 Add Darwin x86_64+arm64 universal binary support
This is configured from Make by setting up Darwin+Arm64 as a HOST_CROSS
target (which is largely true, as binaries can't be executed on X86_64
machines). On the Soong side, it's a bit blurier, as we don't current
have any other users that are the same OS but not natively executable
(Linux/musl is executable, Windows/x86 is a different OS).

Instead of requiring cc_binary/etc to become multi-architecture-aware
and using something like common_first/MultiTarget, this defaults all
non-multi-architecture-aware modules to be built with both
architectures. It then adds a dependency with the
DarwinUniversalVariantTag so that supporting modules can get the outputs
of the other variant.

Cc uses that dependency tag to run lipo on shared libraries and binaries
so that the output of the x86_64 variant is actually a fat binary
including both architectures.

Bug: 203607969
Test: build sdk-repo targets on a Mac
Change-Id: Icbddb0a177c0ba19d3e0d11f8cf568e0d1ea3245
2021-12-07 22:01:25 -08:00
Treehugger Robot
10d55d3e63 Merge "Add vendor_available: true to libbuildverison" am: d2d8e322f1 am: f0f598bc17 am: 5d06a6576a am: f5af593465
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1912416

Change-Id: I6f768fd2acab73fdb15a676adc97e4b5754cd52f
2021-12-07 22:50:58 +00:00
Treehugger Robot
d2d8e322f1 Merge "Add vendor_available: true to libbuildverison" 2021-12-07 21:20:27 +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
Yi Kong
32c2ff41fd Merge "Move "-fdebug-info-for-profiling" flag to device binaries only" am: 8a8cebb01f am: 985e8bcbfc am: d22b2e11c2 am: 482031602a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1912716

Change-Id: I2434f8b74a32a036f1774467256e705dad9b0ebd
2021-12-07 18:28:39 +00:00