Commit graph

5631 commits

Author SHA1 Message Date
Paul Duffin
7af6b7062b Merge "Extract handling of image variations from target loop" 2021-09-25 09:11:44 +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
46f8dbe06a Merge "Refactor code for partitions c srcs" 2021-09-24 17:35:16 +00: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
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
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
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
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
Christopher Parsons
ce0944fc96 Merge "bp2build: reference static variants directly" 2021-09-21 15:13:43 +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
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
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
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
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
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
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
f6c37cc87d Merge "Add module based host-tools snapshot" 2021-09-14 14:47:03 +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
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
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
07e7294a75 Merge "Don't use bugprone-easily-swappable-parameters for global tidy builds either" 2021-09-11 10:20:40 +00:00
Stephen Hines
4b721450c8 Don't use bugprone-easily-swappable-parameters for global tidy builds either
We turned this off in local tidy flags, but didn't disable it on global
tidy builds. Let's remove this for now, since the upkeep cost is large
on it, and it also is currently crashing in some cases.

Bug: http://b/199534745
Bug: http://b/194865868
Test: WITH_TIDY=1 m
Change-Id: Ife39ab4949c5baf825efff66326b276c6a2a59f4
2021-09-11 01:14:36 -07:00
Chih-hung Hsieh
aaa4c07f21 Merge "Pass TIDY_TIMEOUT to clang-tidy" 2021-09-10 19:36:29 +00:00
Yi Kong
6afa749d1d Merge "Switch to clang r433403" 2021-09-10 04:21:54 +00:00
Yi Kong
e82732916a Switch to clang r433403
Bug: 197230471
Test: presubmit
Change-Id: I374a66deb785bae99953ea23c67f873f33c2081b
2021-09-10 04:20:49 +00:00
Chih-Hung Hsieh
95dfbce28b Pass TIDY_TIMEOUT to clang-tidy
* Tested with a clang-tidy wrapper that dumps TIDY_TIMEOUT.

Test: make WITH_TIDY=1 TIDY_TIMEOUT=42
Bug: 199451930
Change-Id: I86580225bad7487da786db2ba62c09bd99d70c67
2021-09-09 19:58:41 -07:00
Liz Kammer
5fad501aeb bp2build: Split export_{includes,system_includes}
The specification of exporting includes vs system includes has an impact
on inclusion sort order. Conflating the two caused some symbols to not
be resolved correctly.

Bug: 198403271
Test: build/bazel/ci/bp2build.sh
Test: USE_BAZEL_ANALYSIS=1 m libbacktrace_no_dex succeeds with libc++_*
      modules removed from mixed build denylist (would fail otherwise)
Change-Id: I08aff253d8962dc678ed10214b1c171330e0fe19
2021-09-09 15:59:05 -04:00
Treehugger Robot
4011ebb12d Merge "Cleanup unused code for bp2build conversion." 2021-09-09 13:12:04 +00:00
Sarah Chin
d2432e668d Merge "Add Radio AIDL to VNDK variant list" 2021-09-09 05:21:43 +00:00
Treehugger Robot
f49df213f8 Merge "Add tidy-soong, tidy-dir-path, module-tidy targets" 2021-09-09 03:22:59 +00:00
Chih-hung Hsieh
095aac0614 Merge "Use tidyExternalVendor for external/googletest" 2021-09-08 18:29:05 +00:00