Commit graph

6388 commits

Author SHA1 Message Date
Yi Kong
62e75f507d Re-enable unused-command-line-argument warning
Turn on the warning by default, unless USE_CCACHE is set.

Test: presubmit
Bug: 197177755
Change-Id: I01e2b0f1be3f4bd3a8d78bb4ab053b4db227596d
2021-10-13 04:11:56 +00:00
Jingwen Chen
e466cc7ea6 Merge "Convert cpp_std to be an attribute instead of a copt." 2021-10-12 23:13:53 +00:00
Liz Kammer
7e1956643c Merge "bp2build: Improve handling of generated_sources" 2021-10-12 17:29:23 +00:00
Liz Kammer
222bdcff5c bp2build: Improve handling of generated_sources
Test: build/bazel/ci/bp2build.sh
Change-Id: Id5f8b6ae9bbf1e90d72854daafb8b1f86f7241ea
2021-10-11 14:15:51 -04:00
Jingwen Chen
5b11ab1a69 Convert cpp_std to be an attribute instead of a copt.
This attribute is then converted into a feature in cc_library_static.

Fixes: 202518741
Test: CI
Change-Id: I070b56a1e96680ffad0466d085caaab2e9308ebc
2021-10-11 17:44:33 +00:00
Liz Kammer
2649c7913a Merge "bp2build; Update handling of linker flags" 2021-10-08 20:09:32 +00:00
Jingwen Chen
97b8531492 Add bp2build support for cpp_std.
This converts cpp_std and gnu_extensions into a -std copt, if cpp_std is
specified or gnu_extensions is false if cpp_std is not specified.

I chose to go with this copts approach because the tradeoff is a much
simpler setting than adding a new attr(s) everywhere that uses features
to set the flag.

This approach limits the number of user-configurable knobs (since users
would then be able to set std in _both_ copts and the new attr). But it
does rely on the user copt overriding the toolchain's default gnu++17
version, which can mean a `-std` flag showing up twice in the action.

Fixes: b/202462232
Test: b build //system/libziparchive:libziparchive
Change-Id: I81dad029059461739b91f318d662e089edb46b84
2021-10-08 11:16:20 +00:00
Xin Li
800112b97f Merge "Merge Android 12" 2021-10-07 23:50:21 +00:00
Liz Kammer
0eae52e0de bp2build; Update handling of linker flags
Test: build/bazel/ci/bp2build.sh
Bug: 197920036
Change-Id: I6e3100574fa0e40bcd8cf0e6af0efd3310aa41bf
2021-10-07 16:07:40 -04:00
Jingwen Chen
6ada589f6e Add support for nocrt by translating it to link_crt in bp2build.
If nocrt is true, then the compilation for cc_shared_library,
cc_binary (shared or static binaries) will _not_ link against their
respective crtbegin and crtend libraries.

nocrt is true only for the Bionic libraries themselves. For everything
else that links against the Bionic runtime, crtbegin and crtend
libraries are used. This makes the "nocrt: false" case the majority.
Hence, if nocrt is explicitly false, we omit the generating attribute in
bp2build.

If nocrt is explicitly true (link_crt is false), the Starlark macro will
disable the link_crt cc_toolchain feature.

Test: new tests
Test: CI
Fixes: 187928070
Fixes: 197946668
Change-Id: I8947789930e599dc802d8eae440859257d044475
2021-10-07 14:04:39 +00:00
Treehugger Robot
3e745e63f3 Merge "Bp2Build common properties auto-handling" am: d905146590
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815376

Change-Id: I38f1063302ea90583a51e625076e6232b4364ab7
2021-10-04 19:20:28 +00:00
Treehugger Robot
d905146590 Merge "Bp2Build common properties auto-handling" 2021-10-04 19:02:07 +00:00
Colin Cross
fec737d6fe Merge "Export SOONG_CC_API_XML to Make outside androidmk" am: f79f4c3199
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842574

Change-Id: Ie7312e0928bfe7692454f8d9a074c10f90fa3f2e
2021-10-04 18:44:31 +00:00
Colin Cross
f79f4c3199 Merge "Export SOONG_CC_API_XML to Make outside androidmk" 2021-10-04 18:32:15 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
447f6c99c9 Bp2Build common properties auto-handling
Introduce `commonAttributes` & `fillCommonBp2BuildModuleAttrs used in
CreateBazelTargetModule

Adapt `bp2BuildInfo` to use `commonAttrs` instead of `Name`.
And thus also all downstream users of `CreateBazelTargetModule`.

As initial user, the Soong `required` property will be
translated to Bazel's `data`.

Bug: 198146582, 196091467
Test: build_converstion_test.go:TestCommonBp2BuildModuleAttrs
Test: go test
Test: mixed_{libc,droid}.sh
Change-Id: Ib500e40f7e2cb48c459f1ebe3188962fc41ec124
2021-10-04 14:43:04 +00:00
Colin Cross
10ef62ea67 Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory" am: 2df9ebf9ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838375

Change-Id: I9fd93be8154f2f1372ccde1eb9a37690738692b7
2021-10-01 16:46:26 +00:00
Colin Cross
2df9ebf9ca Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory"
* changes:
  Add data_bins property
  Support per-testcase directories in all test suites
  Add environment variables to cc_genrule commands
2021-10-01 16:27:55 +00:00
Colin Cross
ceaa5328f0 Export SOONG_CC_API_XML to Make outside androidmk
This relands Ie0a945d879de4f99ce76d005aea8041719c244f7 with a fix
to prevent building XMl files for multiple variants of a library.

The SOONG_CC_API_XML values are needed for modules that are not
exported to Make, export them from a singleton that covers all
modules instead of an AndroidMkProvider that may not be called
for some modules.

Bug: 193819970
Test: forrest
Change-Id: I54710c00901976a736e88126f406e02b1f3c3586
2021-09-30 13:11:48 -07:00
Chris Parsons
486b80a0d5 Support building libcrypto via mixed builds am: a37e195182
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1839353

Change-Id: I34a5ec794874856a415e2c5415ef8b08ef3a7e21
2021-09-30 20:10:15 +00:00
Chris Parsons
a37e195182 Support building libcrypto via mixed builds
This required the following fixes to bp2build:
  - Correctly handle Bionic_* and Linux_* targets
  - Correctly handle cc_object's selects
  - Generate linker_script, stl, and system_dynamic_deps for cc_object in bp2build

Test: USE_BAZEL_ANALYSIS=1 m adbd
Change-Id: I753fd18df8ae551fb69df07e4174527c5388f289
2021-09-30 12:30:36 -04:00
Treehugger Robot
d758c9bccd Merge "Add unit tests for cpp/assembly flags." am: 4352a8e696
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1841793

Change-Id: Iea9755567590efb6fcd161a5e92182386b2fff47
2021-09-30 15:24:35 +00:00
Liz Kammer
08572c6d45 Add unit tests for cpp/assembly flags.
Test: go test soong tests
Change-Id: Idd4b8d558b9bccf92b63c80abff19792ea3ff766
2021-09-30 10:11:04 -04:00
Colin Cross
59f957abbf Merge "Revert "Export SOONG_CC_API_XML to Make outside androidmk"" am: 6f37dba455
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1841188

Change-Id: I84b0b1e723313f4749e6d37a989b1e3c88b140d8
2021-09-30 03:39:08 +00:00
Colin Cross
2cec05d37b Revert "Export SOONG_CC_API_XML to Make outside androidmk"
This reverts commit ebb32c486a.

Reason for revert: breaks coverage build (b/201600003)
Bug: 193819970
Bug: 201600003

Change-Id: I65969c4a62165c40dded2794b757469909bf8ca6
2021-09-30 03:14:40 +00:00
Colin Cross
7dddc5adb5 Merge "Export SOONG_CC_API_XML to Make outside androidmk" am: 1cd6d8e25e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838396

Change-Id: Id1d458966726c4fda22f0558bb54e9f07738aab1
2021-09-29 23:30:29 +00:00
Colin Cross
ebb32c486a Export SOONG_CC_API_XML to Make outside androidmk
The SOONG_CC_API_XML values are needed for modules that are not
exported to Make, export them from a singleton that covers all
modules instead of an AndroidMkProvider that may not be called
for some modules.

Bug: 193819970
Test: manual
Change-Id: Ie0a945d879de4f99ce76d005aea8041719c244f7
2021-09-28 16:39:13 -07:00
Colin Cross
c8caa06a36 Add data_bins property
data_bins is similar to data_libs but copies helper binaries alongside
the test.

Bug: 200872604
Test: atest CtsBionicTestCases
Change-Id: I4f9df5f82816cfd30a0a19808fda220cf77c50a7
2021-09-27 15:56:26 -07:00
Colin Cross
cfb0f5e102 Support per-testcase directories in all test suites
There are cases where two modules try to install the same test data
into CTS, which results in collisions when CTS puts the data for all
tests in the same directory.  Add a flag that allows enabling a
per-testcase directory for an individual test for all test suites.

Bug: 193168159
Test: cts-tradefed run commandAndExit CtsBionicTestCases
Change-Id: If034723e8fe937ca71d3e2d39b7d46702e41bc8c
2021-09-27 15:56:26 -07:00
Colin Cross
f3bfd02aa9 Add environment variables to cc_genrule commands
Pass the architecture, mulitlib type and native bridge state to
each variant of a cc_genrule rule as environment variables.

Bug: 200872604
Test: TestCmdPrefix
Change-Id: I39c4c2d5bbd4f4cc72a4777715db1df049345b37
2021-09-27 15:56:23 -07:00
Paul Duffin
4bf3db6c1f Add ramdisk image sdk trait to cc_library_headers am: 12a0a310a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834876

Change-Id: I722497159725cd4e8b913357aed161ea69357a28
2021-09-25 09:30:55 +00:00
Paul Duffin
e0778ba120 Merge "Add recovery image sdk trait to cc_library_headers" am: a02157a4b7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834875

Change-Id: I60e4ae35cd9807501abd2a0a009a5efc9de62211
2021-09-25 09:30:06 +00:00
Paul Duffin
fbca36d0c6 Merge "Extract handling of image variations from target loop" am: 7af6b7062b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834873

Change-Id: Ic16405a43a524784ff29e23c45567faaadc6cedd
2021-09-25 09:29:45 +00:00
Paul Duffin
12a0a310a7 Add ramdisk image sdk trait to cc_library_headers
Allows an sdk to require that a cc_library_headers module provides a
ramdisk image variant for the prebuilt.

Previously, "ramdisk_available: true" would be set in the generated
prebuilt snapshot for any sdk member that specified
"ramdisk_available: true" in the source module. This change will only
add that setting to the snapshot if the ramdisk image variant trait
was explicitly requested for a member.

Bug: 195754365
Test: m nothing
Change-Id: I21e0dd02d380beabf228a72c463fcc603c77d87f
2021-09-25 10:17:31 +01:00
Paul Duffin
a02157a4b7 Merge "Add recovery image sdk trait to cc_library_headers" 2021-09-25 09:14:21 +00:00
Paul Duffin
7af6b7062b Merge "Extract handling of image variations from target loop" 2021-09-25 09:11:44 +00:00
Christopher Parsons
a64586fb74 Merge "Add stl property support for bp2build" am: 0bb4ac55d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834858

Change-Id: I9c45eab96c5e62667bd78d0fa48601ab140357a0
2021-09-24 20:08:41 +00:00
Christopher Parsons
0bb4ac55d6 Merge "Add stl property support for bp2build" 2021-09-24 20:01:12 +00:00
Chris Parsons
a967f253e6 Add stl property support for bp2build
Test: mixed_libc
Test: USE_BAZEL_ANALYSIS=1 m libbase
Change-Id: If56d4a728de3ae4022cc9dadadc9bf8b952f9eaf
2021-09-24 13:51:56 -04:00
Liz Kammer
137044cac4 Merge "Refactor code for partitions c srcs" am: 46f8dbe06a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1831493

Change-Id: Ib366e45228edca439c6dd41021945e0c62a7c127
2021-09-24 17:51:11 +00:00
Liz Kammer
46f8dbe06a Merge "Refactor code for partitions c srcs" 2021-09-24 17:35:16 +00:00
Paul Duffin
6369622f8d Add recovery image sdk trait to cc_library_headers
Allows an sdk to require that a cc_library_headers module provides a
recovery image variant for the prebuilt.

Previously, "recovery_available: true" would be set in the generated
prebuilt snapshot for any sdk member that specified
"recovery_available: true" in the source module. This change will only
add that setting to the snapshot if the recovery image variant trait
was explicitly requested for a member.

Bug: 195754365
Test: m nothing
Change-Id: I7d79ccdec843127f7852d82b4b163021e30a79a7
2021-09-24 17:44:37 +01:00
Paul Duffin
b1f0f2aa80 Extract handling of image variations from target loop
This separates the selection of the image variations to depend upon
from the main target loop. Follow up changes will add additional
image variations.

Bug: 195754365
Test: m nothing
Change-Id: Ia1a61b1efbc96d92cb2faf1e2c4d1c5c752b8083
2021-09-24 17:15:40 +01:00
Liz Kammer
6fe2d9a3aa Merge "bp2build: Add support for export_.*headers props" am: 6244df2a24
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835374

Change-Id: I10252c15de0bbc6691a69fb214461f6d56d000ff
2021-09-24 13:29:34 +00:00
Liz Kammer
57e2e7a78f Refactor code for partitions c srcs
To support protos (and other srcs that generate sources), we need to
partition further. Separate out into a separate common function.

Bug: 200601772
Test: build/bazel/ci/bp2build.sh
Change-Id: I7bf4cd96fd9a9fca4ccb3c96f21a04303201f891
2021-09-23 18:28:24 -04:00
Liz Kammer
7a210ac233 bp2build: Add support for export_.*headers props
Soong supports export_.*_headers properties, the libraries contained in
this list must also be within a shared/static/whole_static/header libs
property. For bp2build, we eliminate this duplication. The libraries
not listed in an export_.*_headers property will migrate to an attribute
prepended with implementation_, those in export_.*_headers will not have
a prefix.

Test: build/bazel/ci/bp2build.sh
Test: build/bazel/ci/mixed_libc.sh
Bug: 198241472
Change-Id: I3eb84c983ec5d241c8a568e411dfd5619d3184a7
2021-09-23 16:07:45 -04:00
Christopher Parsons
f75a32998e Merge "Disable mixed builds for non-device OS" am: 4ea6052650
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834999

Change-Id: I7bdd47462db00faeaa85917d47f310c17b134aae
2021-09-23 20:02:36 +00:00
Wei Li
0e504d7dc9 Merge "Add bp2build converter for cc_genrule." am: a06db33ebd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1829492

Change-Id: I73b0abd1f86d7dfc17a683595585aff4b5ffb91e
2021-09-23 18:17:04 +00:00
Chris Parsons
1826621bdd Disable mixed builds for non-device OS
We don't currently support propagation of OS in mixed builds, and our
host toolchains are not properly configured.

This allows us to continue to make progress on device OS until host is
supported.

Test: mixed_libc CI
Test: USE_BAZEL_ANALYSI=1 m adbd
Change-Id: I2bf8b3f9ca7928dd33bf2fb3d4fa067da0f593f3
2021-09-23 14:11:42 -04:00
Wei Li
a06db33ebd Merge "Add bp2build converter for cc_genrule." 2021-09-23 18:04:03 +00:00
Sarah Chin
1c0557ea82 Merge "Add IRadio modules to VNDK" 2021-09-23 16:35:42 +00:00
Paul Duffin
8aae014264 Merge "Add support for native bridge trait" am: 15e92388bb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1827878

Change-Id: I286209ee993de44cc508ca9449e73a55846dac33
2021-09-23 13:03:35 +00:00
Paul Duffin
93b750e2a0 Add support for native bridge trait
Adds a native bridge trait that if required will cause a
cc_library_header module to generate a cc_prebuilt_library_headers with
native_bridge_supported: true. It will fail if the cc_library_header's
native bridge variant would produce native bridge specific properties,
distinct from the other architecture variants, in the generated
cc_prebuilt_library_headers.

Bug: 195754365
Test: m nothing
Change-Id: I282fbb9095de6c6af57cca4eb4260e2c6c2da8cc
2021-09-23 11:37:57 +01:00
Wei Li
bcd399479a Add bp2build converter for cc_genrule.
Test: cc_genrule_conversion_test.go

Change-Id: I19290b417d6336020a15ba7fa772ee0c76c58225
2021-09-23 05:41:20 +00:00
Sarah Chin
0322af503a Add IRadio modules to VNDK
Test: build
Bug: 198331451
Change-Id: Ia468b563c6485464db56b3c9cdbae80de6b3f165
Merged-In: Ia468b563c6485464db56b3c9cdbae80de6b3f165
2021-09-23 03:54:58 +00:00
Sarah Chin
ef3dd96890 Merge "Add IRadio modules to VNDK" into stage-aosp-master 2021-09-23 02:58:32 +00:00
Treehugger Robot
dfcb3ff691 Merge "Revert "update build rules to use /data/local/tests/unrestricted"" am: 512ec3f4fe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832958

Change-Id: I1f99bcbca475bd29e165f735706cd2b3d913c113
2021-09-22 06:45:42 +00:00
Sarah Chin
84fdadfe83 Add IRadio modules to VNDK
Test: build
Bug: 198331451
Change-Id: Ia468b563c6485464db56b3c9cdbae80de6b3f165
2021-09-21 23:34:20 -07:00
Treehugger Robot
512ec3f4fe Merge "Revert "update build rules to use /data/local/tests/unrestricted"" 2021-09-22 06:33:44 +00:00
Guang Zhu
5c97bc698f Revert "update build rules to use /data/local/tests/unrestricted"
Revert submission 1826231-native-test-path

Reason for revert: b/199996863

Bug: 199996863

Reverted Changes:
Ic106011a7:update build rules to use /data/local/tests/unrest...
Id727355ec:update build rules to use /data/local/tests/unrest...

Change-Id: Id53334a6169e58964ef86e78de738f29b32dd491
2021-09-22 04:20:22 +00:00
Treehugger Robot
0f7dddcc9c Merge "[IRadioConfig] Add to VNDK variant list" 2021-09-22 01:49:23 +00:00
TreeHugger Robot
a91b77734b Merge "[IRadioConfig] Add to VNDK variant list" into stage-aosp-master 2021-09-21 17:23:20 +00:00
Christopher Parsons
5a5ceb553e Merge "bp2build: reference static variants directly" am: ce0944fc96
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832014

Change-Id: I6314b59c55d7dcc65444d44f631d39ff566c49d9
2021-09-21 15:32:04 +00:00
Christopher Parsons
ce0944fc96 Merge "bp2build: reference static variants directly" 2021-09-21 15:13:43 +00:00
Serik Beketayev
af68148d19 [IRadioConfig] Add to VNDK variant list
Test: build
Bug: 198331805
Change-Id: Ibacc996f42c4bfa12b135247a2cebe1e28bbff09
Merged-In: Ibacc996f42c4bfa12b135247a2cebe1e28bbff09
2021-09-21 04:52:44 +00:00
Treehugger Robot
c41aa75dec Merge "Add tidy_disabled_srcs property." am: 1b15345ac9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1831865

Change-Id: I430b1fcd21e417e1ca0382228229188e1b47c718
2021-09-21 03:58:15 +00:00
Chih-Hung Hsieh
769a51cc6a Add tidy_disabled_srcs property.
Used as a supplement to C/C++ srcs to disable
clang-tidy for selected srcs, when a library
contains many files in srcs and only some of them
are too large to compile with clang-tidy.

Test: WITH_TIDY=1 TIDY_TIMEOUT=90 make tidy-soong
Bug: 198098397
Change-Id: Ib32eb0e46ddbc717999797717bfd8c57e182ee88
2021-09-20 18:17:59 -07:00
Serik Beketayev
319c773900 [IRadioConfig] Add to VNDK variant list
Test: build
Bug: 198331805
Change-Id: Ibacc996f42c4bfa12b135247a2cebe1e28bbff09
Merged-In: Ibacc996f42c4bfa12b135247a2cebe1e28bbff09
2021-09-20 17:32:30 -07:00
Chris Parsons
953b35623a bp2build: reference static variants directly
Previously, when referencing a cc_library as a static_lib from a
converted module, the corresponding target would depend on the "root
target" of that cc_library. This resulted in a superfluous dependency on
the shared target of the cc_library dependency. This superfluous
dependency could sometimes result in cycles.

This change ensures the static target name is directly specified in such
cases.

Test: mixed_libc.sh CI
Test: USE_BAZEL_ANALYSIS=1 m fmtlib
Change-Id: I36ee9f0a9017b1e9d73df9e3174669107f0afd4f
2021-09-20 15:15:29 -04:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
5cc296f072 Merge changes from topic "mixed-build-cc-library-shared" am: 4aeaf37bb7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826914

Change-Id: If277cd41ec3244e25aec1cedb3890f7fbc058eca
2021-09-17 14:39:12 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
5ce0135bd8 Incorporate cc_library_shared into mixed builds am: bc4e734e59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826912

Change-Id: If309ce2532d679e4af9d5cfe5b4c383afa2116e2
2021-09-17 14:39:06 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
4aeaf37bb7 Merge changes from topic "mixed-build-cc-library-shared"
* changes:
  Expose TocFile via CcInfo
  Clean up StarlarkFunctionBody for getCcInfoType
  Incorporate cc_library_shared into mixed builds
2021-09-17 14:29:17 +00:00
Chih-hung Hsieh
d19ed27801 Merge "Use ccCmd to generate clang-tidy dependent file" am: 935ae2c51d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824476

Change-Id: I303aab3d1318b9d94c76a362d07ec446fa65cdb0
2021-09-17 02:08:33 +00:00
Chih-hung Hsieh
935ae2c51d Merge "Use ccCmd to generate clang-tidy dependent file" 2021-09-17 01:59:23 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
62585e8436 Expose TocFile via CcInfo
To reflect what's provided in SharedLibraryInfoProvider

Move the logic for identifying the toc file into Starlark
instead of the Soong Go code.

Adapt TestGetCcInfoParseResults to expect the toc as well.

Test: build/bazel/cquery/request_type_test.go:TestGetCcInfoParseResults
Test: cc/library_test.go:TestCcLibrarySharedWithBazel
Test: build/bazel/ci/mixed_{libc,droid}.sh
Change-Id: I40ad47158cb98b14ca03c21e351988818cb01770
2021-09-16 20:55:10 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
d4e77a6137 Create bp2build converter for cc_shared_library am: ac5097fcf4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1816758

Change-Id: Iad57cc75670f0e747c162758c029179ae93af3e4
2021-09-16 18:20:48 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
fff8c0a6a8 Remove Linkstatic field for static cases am: a5474e36c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826512

Change-Id: I70f97cd652598dcd520c5224f71568876338aeb4
2021-09-16 18:20:45 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
bc4e734e59 Incorporate cc_library_shared into mixed builds
The infrastructure is already there via its need in
`cc_library`. Therefore, just enable it by setting
the `bazelHandler` in `LibrarySharedFactory`, and
add a test to verify the functionality.

Bug: 198817980
Test: cc/library_test.go:TestCcLibrarySharedWithBazel
Change-Id: Ibff80616632af59a0e409110f8645e028f99c7d6
2021-09-16 18:13:52 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
ac5097fcf4 Create bp2build converter for cc_shared_library
Factor out shareable code with cc_static_library

Remove `Linkstatic` field for shared cases,
because it's redundant with the rule

Bug: 198241907
Test: cc_library_shared_conversion_test.go
Test: mixed_{libc,droid}.sh
Change-Id: I5be3b66f812893bce41edb425fbd143ab22d9051
2021-09-16 15:00:56 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
a5474e36c5 Remove Linkstatic field for static cases
With the explicit implementation of cc_library_shared,
this is now redundant for both, so remove it.

Test: cc_library_static_conversion_test.go
Test: mixed_{libc,droid}.sh
Change-Id: I6e7733ca08c254562e95e70d93c9f519719d8a18
2021-09-16 15:00:47 +00:00
Treehugger Robot
6e5aabb91b Merge "Share cFlags, tidyFlags, etc. in a module" am: b1a12462a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824024

Change-Id: Iaf6050178f9d172a5a17103504e8f081277df9cf
2021-09-16 02:35:38 +00:00
Chih-Hung Hsieh
8e09f2627d Use ccCmd to generate clang-tidy dependent file
* After this change, make libtinyxml2-tidy should generate
  correct out/.../libtinyxml2.tidy.d file.
  Touching one of the dependent files, e.g., tinyxml2.h,
  should invoke clang-tidy but not to recompile tinyxml2.o.
* Note that linking libraries still depend on .tidy targets,
  so make libtinyxml2 will call clang-tidy, regnerate
  tinyxml2.tidy.d, tinyxml2.tidy, tinyxml2.o.d, tinyxml2.o.
* A clang-tidy rule uses the same $cFlags for both clang and clang-tidy.
  To share it and avoid over long command lines, we use modern shell
  array variables and cannot use old bourne shell.

Bug: 199169329
Test: WITH_TIDY=1 make
Test: WITH_TIDY=1 make libtinyxml2-tidy | grep tinyxml2
Test: touch external/tinyxml2/tinyxml2.h; make libtinyxml2-tidy | grep tinyxml2
Change-Id: I6175add58d7313ee50c9308b78c9290a60770052
2021-09-16 02:25:52 +00:00
Treehugger Robot
b1a12462a9 Merge "Share cFlags, tidyFlags, etc. in a module" 2021-09-16 02:20:25 +00:00
Paul Duffin
9f266a87a8 Rename nativeLibInfoProperties.archType to archSubDir am: 96f1832762
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826227

Change-Id: If868e6df94bbb3d25d2a6a30dc0bb34ef9773c88
2021-09-16 00:09:24 +00:00
Chih-Hung Hsieh
b8082295b6 Share cFlags, tidyFlags, etc. in a module
* In builder.go, share common flags in a module.
  * This replaces the sharing of cflags/cppflags/asflags in cc.go.
  * A unit test in apex_test.go now fails and is commented out.
    It is a failing test hidden by old optimization in cc.go.
* In module.go, expand the reference variable $someflags<n>,
  or ${someflags<n>} to keep many existing unit tests work as is.
* The build.ninja size was reduced from 8.1GB to 6.2GB,
  for aosp_arm64-eng WITH_TIDY=1 USE_RBE=true,
  and from 7.5GB to 5.6GB when USE_RBE is 0.
  Content of build.ninja is also more readable and searchable.
  Read/write build.ninja times are also reduced,
  depending on disk I/O speed.

Test: make WITH_TIDY=1
Change-Id: I17f96adf4844136d52e5d40f57a19d9e290162b7
2021-09-15 16:05:41 -07:00
Paul Duffin
96f1832762 Rename nativeLibInfoProperties.archType to archSubDir
Previously, the archType field was a string not an android.ArchType and
was used as the subdirectory into which arch specific files were
copied. This renames the field to archSubDir and clarifies the usage.

Bug: 195754365
Test: m nothing
Change-Id: Id4d6de12b40ee21e41bcd8b96a0ff04eaf615a80
2021-09-15 17:59:14 +01:00
Guang Zhu
da4d36227f Merge "update build rules to use /data/local/tests/unrestricted" am: 7b32612dc4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826231

Change-Id: I96945a717032ade148ac6b70ba5a8b02730d43a5
2021-09-15 00:23:32 +00:00
Guang Zhu
7b32612dc4 Merge "update build rules to use /data/local/tests/unrestricted" 2021-09-15 00:22:43 +00:00
Guang Zhu
83150667ae update build rules to use /data/local/tests/unrestricted
... for native tests. This new location has the appropriate
settings for debuggerd to generate valid backtraces in case
of test binary crash.

Bug: 167308193
Bug: 199904562
Test: compile
Change-Id: Ic106011a79f0aec86896b305616cf5590ab2eb2d
2021-09-14 10:56:47 -07:00
Rob Seymour
dc2cc0d8d7 Merge "Add module based host-tools snapshot" am: f6c37cc87d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1793067

Change-Id: I3a2bb2459677c14e3e99d654ed5ffb9b7dd09b21
2021-09-14 15:04:01 +00:00
Rob Seymour
f6c37cc87d Merge "Add module based host-tools snapshot" 2021-09-14 14:47:03 +00:00
Liz Kammer
953bf91c49 Merge "Split local/absolute include into attributes" am: 04e0a1551d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824019

Change-Id: I05e64f79fd95836e92630941f276e64fd6c5b98f
2021-09-13 21:37:32 +00:00
Rob Seymour
925aa09ea1 Add module based host-tools snapshot
Add new module:
host_snapshot {
    name: "host-snapshot"
    deps: [
      (list of host tools)
    ],
    ...
}

Package host tools using android.PackagingBase to capture host tools and transitive packaging data.
Add JSON meta data to snapshot that allows snapshot to be installed via development/vendor_snapshot/update.py

Add support to generate a fake host snapshot of all host modules that is used to detect required
modules via development/vendor_snapshot/update.py.

Bug: 192556798
Bug: 194799048
Bug: 192896149
Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist -- check snapshot exists in dist

Change-Id: I849c4db801cd858408f6fe6a3ce69262a23a5be9
2021-09-13 21:29:14 +00:00
Liz Kammer
04e0a1551d Merge "Split local/absolute include into attributes" 2021-09-13 21:21:09 +00:00
Yi Kong
910cf32f49 Merge "Remove unused-but-set-{variable,parameter} from ClangUnknownCflags" am: 861441fa36
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824620

Change-Id: Ieec9bdef68bb233e125e49d633803b39f200c81d
2021-09-13 19:07:01 +00:00
Yi Kong
861441fa36 Merge "Remove unused-but-set-{variable,parameter} from ClangUnknownCflags" 2021-09-13 18:54:15 +00:00
Liz Kammer
35687bc77a Split local/absolute include into attributes
Previously these were expanded into copts, requiring making all includes
absolute and duplicating includes to account for potentially generated
files. We now can handle both of these properly on the Bazel side, so
let's clean up build files a bit.

Test: bp2build.sh
Change-Id: I6c6160738cd6c269408c6c7a37010654d84f3c9d
2021-09-13 12:49:42 +00:00
Liz Kammer
dd34331163 Merge "bp2build: Split export_{includes,system_includes}" am: 15c90f5fe1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1822559

Change-Id: I35e5ac06bfaefeaf437af196249906dd517d7a5a
2021-09-13 12:43:23 +00:00
Liz Kammer
15c90f5fe1 Merge "bp2build: Split export_{includes,system_includes}" 2021-09-13 12:22:19 +00:00
Yi Kong
a1ebc2d072 Remove unused-but-set-{variable,parameter} from ClangUnknownCflags
These warnings are now implemented by Clang.

Change-Id: I78d04216da0ca3d1db616c7b658ca6075b20e7f6
Test: presubmit
Bug: 197230471
2021-09-13 06:25:41 +00:00
Treehugger Robot
0e7f8e9919 Merge "Don't use bugprone-easily-swappable-parameters for global tidy builds either" am: 07e7294a75
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824475

Change-Id: I6f7e0578f6e934dbc89a5d06f532b7111d1c8d55
2021-09-11 10:36:47 +00:00