Commit graph

58223 commits

Author SHA1 Message Date
Cole Faust
bcc3d05aba Fix module-file name collisions
Bazel doesn't allow a module and file with the same name.

Bug: 198619163
Test: Presubmits
Change-Id: Ie9731b627945d2ff221d3a5d08a32a5a172f9dcd
2022-09-01 15:20:00 -07:00
Treehugger Robot
6faa161557 Merge "bp2build: allowlist //system/logging/... and deps." 2022-09-01 18:29:21 +00:00
Treehugger Robot
2701ecd502 Merge "Remove USE_BAZEL and its dead code" 2022-09-01 17:32:00 +00:00
Spandan Das
1d243da558 Merge "bp2build for ndk_headers" 2022-09-01 17:22:50 +00:00
Treehugger Robot
1f03a9f953 Merge "Convert cc_test targets with bp2build." 2022-09-01 17:00:45 +00:00
Alix Espino
ad7eb00814 Merge "Exporting MakeBazelTarget() in testing.go" 2022-09-01 16:48:15 +00:00
Alix
e06d75be5d Exporting MakeBazelTarget() in testing.go
Since we are putting conversion tests in the same
package as the module being converted from now on

Test: m bp2build
Change-Id: Ied53589d497fef70bfa11d8f6067459c9a50cd72
2022-09-01 16:47:58 +00:00
Treehugger Robot
75c724cc8b Merge "Revert "DoNotConvert tzdata nor tz_version"" 2022-09-01 16:41:20 +00:00
Chris Parsons
19ab9a455f Remove USE_BAZEL and its dead code
This environment variable has been out of use for some time. It used to
control Bazel-as-executor, which has been removed from Bazel for several
releases.

Bug: 243077098
Test: Treehugger
Change-Id: I4edfb5f3574c369a16547ea06ba780293c37ecb3
2022-09-01 11:33:02 -04:00
Jingwen Chen
f061600d64 bp2build: allowlist //system/logging/... and deps.
```
$ b test --config=linux_x86_64 //system/logging/... --test_output=errors
//system/logging/logd:logd-unit-tests                           (cached) PASSED in 1.3s
```

Also builds:

- logcat
- liblogd
- auditctl
- logd
- liblogwrap
- logwrapper
- and various device tests

Test: b build //system/...
Test: b test //system/... --config=linux_x86_64
Test: bp2build.sh
Bug: 243025934
Change-Id: Id94460c1148b76af05e4ff1f4de9aa32f2626085
2022-09-01 15:00:15 +00:00
Jingwen Chen
537242c6f1 Convert cc_test targets with bp2build.
Starting with libutils_test, adb_test, libcutils_test, (and ~47 other host_supported tests).

Test: $ b build --config=android_x86_64 //system/core/libutils:libutils_test && adb push bazel-bin/system/core/libutils/. /data/tmp/libutils_test_files/ && adb shell /data/tmp/libutils_test_files/libutils_test
Test: presubmits with newly converted cc_test targets
Test: $ b test //system/... --config=linux_x86_64 --verbose_failures --test_output=errors --keep_going --build_tests_only

Fixes: 242038415

Change-Id: I10051aadb880c3aabeba6d7fb079523e6fb4ac43
2022-09-01 14:59:15 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
1867ae73d1 Revert "DoNotConvert tzdata nor tz_version"
This reverts commit bff2e88a85.

Reason for revert:
The reason for excluding them has been resolved; the files no longer conflict with the target names.

Test: mixed_libc.sh shows conversion of tzdata & tz_version

Change-Id: Ibcecfb2a65bb51a89dbc358ebd248209f3eb45b8
2022-09-01 14:42:10 +00:00
Treehugger Robot
bf9c26c364 Merge changes I1270e8d0,I61731a5e
* changes:
  Move function PathForVndkRefAbiDump to Prevent unnecessary exports in paths.go
  Change the type of parameter prevVersion to int in sourceAbiDump
2022-09-01 06:37:20 +00:00
Treehugger Robot
7b181b332e Merge "Define cc_api_headers module" 2022-09-01 05:28:40 +00:00
Cole Faust
c05e28c306 Merge "Remove old BUILD file merging code" 2022-09-01 03:21:35 +00:00
Kiyoung Kim
51279d3a7b Define cc_api_headers module
Define cc_api_headers module to import from API surfaces and replace
existing header definition if needed.

Tested with :
cc_api_headers {
  name: "libc_headers",
  export_system_include_dirs: [
    "include",
  ],
  min_sdk_version: "1",
  sdk_version: "1",
  vendor_available: true,
  native_bridge_supported: true,
  ...
}

Bug: 236087698
Test: ALLOW_MISSING_DEPENDENCIES=true m -j vendorimage succeeded
Change-Id: I2c3294fe19a272453a168d8c7beeee9859bd4583
2022-09-01 11:24:35 +09:00
Steven Moreland
e66fe04484 Merge "Avoid dereferencing ANDROID_BUILD_TOP" 2022-09-01 02:09:53 +00:00
Treehugger Robot
2da00a8471 Merge "Add a property in ndk_library for header contributions" 2022-09-01 01:08:39 +00:00
Cole Faust
ea602c5a41 Remove old BUILD file merging code
It's not needed anymore since aosp/2197837,
it should've been removed in that cl but I forgot.

Bug: 234167862
Test: ./build/bazel/ci/bp2build.sh
Change-Id: I3d67a6e1894ad401525070ad37d3158708898306
2022-08-31 15:12:47 -07:00
Treehugger Robot
52d9b95f54 Merge "Support suffix property in bp2build" 2022-08-31 20:15:28 +00:00
Spandan Das
0773a60302 bp2build for ndk_headers
Create bp2build converters for the following module types
- ndk_headers
- versioned_ndk_headers

Details
- Partial bp2build conversion. Only `cc_api_headers` targets will be
  generted within the scope of this CL
- Glob expansion. Aligned with other bp2build converters, this impl will
  expand globs in Android.bp so that all .h files are explicitly listed
  in the generated BUILD files. As an extreme example, the size of
  out/soong/workspace/bionic/libc/BUILD will increase from ~170KB to
  ~230KB (33% increase). This makes the BUILD files less readable, and
  `cc_api_headers` section of the BUILD file should probably not be
  checked into the tree in this format

Test: b cquery //bionic/libc:libc_uapi --output=starlark
--starlark:expr="providers(target).get('//build/bazel/rules/apis:cc_api_contribution.bzl%CcApiHeaderInfo')"
Test: go test ./bp2build
Test: go test ./cc

Change-Id: I810d5380f72dc90f4cdf4aa508570f3a80d8d932
2022-08-31 19:40:22 +00:00
Steven Moreland
855094c759 Avoid dereferencing ANDROID_BUILD_TOP
We want to print to the user to use this variable, but it might
not be set in all environments where we run the build. Namely,
in sdk finalization CI.

Bug: 244456768
Test: N/A
Change-Id: I233e7d0ee6a7ed43760ad723fccd70ea97f7b806
2022-08-31 18:58:55 +00:00
Florian Mayer
77c1d77b48 Merge "Revert "[soong] Add memtag-stack sanitizer, switch to linker-gen..."" 2022-08-31 18:37:30 +00:00
Florian Mayer
00ab5cfd5e Revert "[soong] Add memtag-stack sanitizer, switch to linker-gen..."
Revert submission 2096883-memtag-stack

Reason for revert: b/244454542
Reverted Changes:
I7fee03d90:memtag_stack tests.
I52d2318c8:[soong] Add memtag-stack sanitizer, switch to link...

Change-Id: I3967151d98514fa07f66804aa8ff403df3962fa3
2022-08-31 18:30:18 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
a56e97042c Support suffix property in bp2build
Support this in cc_{binary,library{,_shared}}

Bug: 204811222
Test: Suffix additions to cc_{binary,library{,_shared}}_conversion_test.go
Test: mixed_{libc,droid}.sh also builds newly allowlisted
Change-Id: I596694794b01b04c542cbcd7d54baeb7d914ba50
2022-08-31 18:06:21 +00:00
Florian Mayer
1520d7fb2d Merge "[soong] Add memtag-stack sanitizer, switch to linker-generated notes." 2022-08-31 17:53:43 +00:00
Trevor Radcliffe
ad7b2220be Merge "Write Soong tests to confirm Sysprop directories" 2022-08-31 15:13:31 +00:00
Mu-Le Lee
f5ed30b2aa Move function PathForVndkRefAbiDump to Prevent unnecessary exports in paths.go
This CL moves function PathForVndkRefAbiDump from android/paths.go to
cc/library.go to prevent unnecessary exports.

Test: make libz
Bug: 239915696
Change-Id: I1270e8d07edb09d93621c049acab9196757d356b
2022-08-31 06:04:27 +00:00
Mu-Le Lee
1304393b36 Change the type of parameter prevVersion to int in sourceAbiDump
Since the caller is doing Itoa and pass it into sourceAbiDump(), and
sourceAbiDump() is calling Atoi to convert it back, it makes sense to
not do the Itoa in the first place.

Test: make libz
Bug: 244009549
Change-Id: I61731a5eb442b5a1a8f50c820a673d9b2204c3a0
2022-08-31 05:51:35 +00:00
Treehugger Robot
d221359e6d Merge "Allowlist aidl interfaces with ndk backend enabled" 2022-08-31 01:28:45 +00:00
Cole Faust
3e8c964fb7 Merge "Always merge build files" 2022-08-31 01:07:14 +00:00
Cole Faust
324a92e404 Always merge build files
Previous behavior:

- Packge not listed in bp2buildKeepExistingBuildFile:
    - Use bp2build generated build file
- Package listed in bp2buildKeepExistingBuildFile:
    - Use handcrafted build file even if there were allowlisted bp2build
      modules in the same package.
- Package listed in bp2buildKeepExistingBuildFile and a soong module has
  a bp2build: { label } attribute:
    - Merge the handcrafted and bp2build generated build files

New behavior:

- Packge not listed in bp2buildKeepExistingBuildFile:
    - Use bp2build generated build file
- Package listed in bp2buildKeepExistingBuildFile:
    - Merge with bp2build generated build file.

Bug: 234167862
Test: ./build/bazel/ci/bp2build.sh
Change-Id: Ifbaf4f8f0f5158b5b2bd6d534eb2311e2e5f399b
2022-08-30 16:07:23 -07:00
Evgenii Stepanov
807573d135 [soong] Add memtag-stack sanitizer, switch to linker-generated notes.
This change depends on the following toolchain commit:
https://reviews.llvm.org/D118948

Bug: b/174878242
Test: sanitize_test.go
Test: fvp_mini with SANITIZE_TARGET=memtag_heap,memtag_stack

Change-Id: I52d2318c8e4e06d6da5b74c45226144b880f1577
2022-08-30 21:37:03 +00:00
Vinh Tran
c3873e84ec Allowlist aidl interfaces with ndk backend enabled
The dependency chain for these aidl interfaces with ndk binding is explicit as followed

```
android.hardware.common
android.hardware.graphics.common -> [android.hardware.common]
android.hardware.neuralnetworks -> [android.hardware.common, android.hardware.graphics.common]
```

Test: b build //hardware/interfaces/neuralnetworks/aidl:android.hardware.neuralnetworks-V1-ndk
Test: b build //hardware/interfaces/graphics/common/aidl:android.hardware.graphics.common-V2-ndk
Test: b build //hardware/interfaces/common/aidl:android.hardware.common-V2-ndk
Bug: 235113507
Change-Id: I05a3b6b7e9f592c422ac257f5769ada350953516
2022-08-30 17:11:38 -04:00
Usta (Tsering) Shrestha
0178442b5a Merge "cosmetic: remove unused arg" 2022-08-30 20:13:50 +00:00
Usta (Tsering) Shrestha
f768231db1 Merge "cosmetic changes" 2022-08-30 20:13:15 +00:00
Treehugger Robot
de05975081 Merge "non-adjacent AIDL filegroup bp2build test java" 2022-08-30 18:51:58 +00:00
Spandan Das
73bcafcbb0 Add a property in ndk_library for header contributions
The new property will be used to determine the header file contributions of
ndk_library(s) to the Public API surface. This should be a no-op for
regular Soong builds.

This will be used by a future bp2build converter to populate
the BUILD files for Multi-tree `cc_api_contribution` targets

(Also noticed that sdk_test.go was never added to testSrcs, which this
CL should fix)

Test: go test ./cc
Test: TH

Change-Id: Ieea093e4aac68e341c6414b6cafe02c441643cdf
2022-08-30 18:24:40 +00:00
Alix Espino
f9f9ed7cf1 Merge "Deprecating clang Property" 2022-08-30 17:42:10 +00:00
usta
cd245f7004 cosmetic: remove unused arg
Test: m nothing
Bug: N/A
Change-Id: I93db309d7b086b65046c53ea3c8b2296209fb2a9
2022-08-30 17:40:24 +00:00
Treehugger Robot
ff29846073 Merge "Revert "add bazel AIDL examples to bp2build"" 2022-08-30 17:19:13 +00:00
Treehugger Robot
f837a93337 Merge "Revert "add bp2build unit tests for aidl_interface"" 2022-08-30 17:19:13 +00:00
Treehugger Robot
bf24d20f1e Merge "Allowlist unblocked modules" 2022-08-30 15:55:43 +00:00
Christopher Parsons
3d31a12867 Merge "Add --bazel-mode and --bazel-mode-dev" 2022-08-30 14:29:30 +00:00
Guang Zhu
8f3f1597e4 Revert "add bazel AIDL examples to bp2build"
This reverts commit 02626f9365.

Reason for revert: revert together with aosp/2133802

Change-Id: I795c15d8cd69764dca8e69b285eb8c3e00935b44
2022-08-30 08:37:37 +00:00
Treehugger Robot
b28effac58 Merge "improve error message when soong test fails early" 2022-08-30 08:04:48 +00:00
Mu-Le Lee
06d343580d Merge "Add target-version flags in header-abi-diff command" 2022-08-30 05:07:40 +00:00
Sam Delmerico
105a70418f Revert "add bp2build unit tests for aidl_interface"
This reverts commit 1fa2672be9.

Reason for revert: breaks tradefed branch

Change-Id: I69bba531774031890baece1796df24d5534b93a9
2022-08-29 22:24:10 +00:00
usta
fb67fd121f cosmetic changes
Test: m nothing
Bug: N/A
Change-Id: Ic3d70339c7b98bf0733dc0e946f3683fe94f5c5b
2022-08-29 19:53:45 +00:00
Treehugger Robot
fb9ca5c7e2 Merge "Allowlist speex and audio_utils" 2022-08-29 19:20:31 +00:00