Commit Graph

44984 Commits

Author SHA1 Message Date
Treehugger Robot
03f327c83e Merge "Avoid duplicate module names in the error from ModuleForTests." am: eee562f950
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1823277

Change-Id: I0c4865071f4aba40f63ab34e0f9676be1063e634
2021-09-10 09:29:42 +00:00
Treehugger Robot
eee562f950 Merge "Avoid duplicate module names in the error from ModuleForTests." 2021-09-10 09:15:06 +00:00
Yi Kong
7d927b62bf Merge "Switch to clang r433403" am: 6afa749d1d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1814448

Change-Id: I19285347bc70349ce02de3d8b2b6793a4d56fa75
2021-09-10 04:39:04 +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
Martin Stjernholm
98e0d88aac Avoid duplicate module names in the error from ModuleForTests.
#codehealth

Test: m nothing
Change-Id: Ia7c3191440452ce04782701bc6ef99251e55af4d
2021-09-09 21:34:02 +01:00
Peter Collingbourne
4ceae5b280 Merge "Read LLVM version from $LLVM_PREBUILTS_VERSION if set." am: e168f15ab9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1822335

Change-Id: I4e9049d5717b1a9ed87f9232ced1e4e7f995ba55
2021-09-09 18:36:07 +00:00
Peter Collingbourne
e168f15ab9 Merge "Read LLVM version from $LLVM_PREBUILTS_VERSION if set." 2021-09-09 18:17:11 +00:00
Treehugger Robot
16010fe5cd Merge "Cleanup unused code for bp2build conversion." am: 4011ebb12d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1819237

Change-Id: I41d4bdf23a5d17c74e1897a6d42a0b3a22fd865e
2021-09-09 13:17:31 +00:00
Rupert Shuttleworth
545ed91fc0 Move genrule tests to genrule_conversion_test.go. am: c5fa306162
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821932

Change-Id: Ibf8cdb61a60ca2a37de0c4fb3bfb2ea382efc7ac
2021-09-09 13:17:18 +00:00
Treehugger Robot
4011ebb12d Merge "Cleanup unused code for bp2build conversion." 2021-09-09 13:12:04 +00:00
Rupert Shuttleworth
c5fa306162 Move genrule tests to genrule_conversion_test.go.
Test: go test

Change-Id: Ice1ed23d008d26cce0a4feca5bfcab51febcea1b
2021-09-09 06:19:02 -04:00
Treehugger Robot
1309335a4c Merge changes I6df9a14d,I830c53ef am: 62b843b90f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1818018

Change-Id: I30c26d7caca2f2cffe1779b686ea160c1683fb84
2021-09-09 10:07:19 +00:00
Treehugger Robot
62b843b90f Merge changes I6df9a14d,I830c53ef
* changes:
  bp2build: allowlist //external/libcap/...
  bp2build: don't generate filegroups (or error) if it contains a file with the same name.
2021-09-09 09:51:33 +00:00
Mohammad Islam
17544fe23a Merge "Relax restriction on suffix of apex_set filename to include .capex" am: 385cde82d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821656

Change-Id: I91189bd060d0c365892234daab5a59b70a8018c7
2021-09-09 09:08:51 +00:00
Mohammad Islam
385cde82d4 Merge "Relax restriction on suffix of apex_set filename to include .capex" 2021-09-09 08:21:27 +00:00
Jingwen Chen
1e347860d5 bp2build: allowlist //external/libcap/...
This builds cap_names.list.h, which uses an eponymous filegroup
"generate_cap_names_list.awk" in Soong, but uses the file target
directly in Bazel.

This also improve filegroup support for mixed builds, by issuing a
cquery call _without_ arch. Filegroups in Soong don't have configurable
properties, so don't generate Bazel filegroups into buildroot's
config_nodes (which was x86_64 by default).

The mixed_build_root now looks like this:

```
config_node(...)
config_node(...)
config_node(...)
config_node(...)

...

filegroup(name = "common",
    srcs = ["@//bionic/linker:linker_sources_x86",
            "@//bionic/libc:kernel_input_headers",
            "@//system/timezone/apex:com.android.tzdata-androidManifest",
            "@//external/libcap:generate_cap_names_list.awk",
            "@//bionic/linker:linker_sources_arm64",
            "@//bionic/linker:linker_sources",
            "@//bionic/libc:libc_sources_shared_arm",
            "@//bionic/linker:linker_sources_x86_64",
            "@//bionic/libc:all_kernel_uapi_headers",
            "@//build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal-file_contexts",
            "@//system/core/libcutils:android_filesystem_config_header",
            "@//bionic/libc:libc_sources_static",
            "@//bionic/linker:linker_sources_arm",
            "@//bionic/libc/tools:bionic-gensyscalls",
            "@//bionic/tools:bionic-generate-version-script",
            "@//bionic/libc:libc_sources_shared"],
)

mixed_build_root(name = "buildroot",
    deps = [":x86",
            ":arm64",
            ":arm",
            ":common",
            ":x86_64"],
)
```

Test: CI
Fixes: 198595323
Fixes: 198235838
Change-Id: I6df9a14da556cf358d96e6a99b514f66a2638295
2021-09-09 07:54:16 +00:00
Jingwen Chen
5146ac02a1 bp2build: don't generate filegroups (or error) if it contains a file
with the same name.

Also add capability to test for errors raised in bp2build mutators /
contexts.

This CL does two things to filegroups:

1) If the filegroup has only 1 source file with the same name as itself,
don't generate a filegroup target. Instead, dependents will depend
directly on the Bazel file target instead.

2) If the filegroup has more than 1 source file and 1 of them has the
same name as itself, the bp2build mutator will error out. If bp2build
on CI passes, it means that the source tree / product we're testing
against does not have such a case (which seems to be true for most
source trees).

Either way, this will allow us to be unblocked for most of the errant
filegroups (case 1) in the tree.

Test: CI
Test: New test cases in filegroup_conversion_test.go

Fixes: 194762573
Change-Id: I830c53efc8808569afe3c5f9f08436855bcdafed
2021-09-09 07:12:13 +00:00
Lukács T. Berki
c08fff0423 Merge "Implement cleanups requested in aosp/1818245:" am: 4b221b3cf9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821792

Change-Id: Icb9161bb48a4f8fed83cdb115ba7c8412625c3b6
2021-09-09 06:24:32 +00:00
Lukács T. Berki
4b221b3cf9 Merge "Implement cleanups requested in aosp/1818245:" 2021-09-09 06:09:38 +00:00
Sarah Chin
e6ceefc011 [automerger skipped] Merge "Add Radio AIDL to VNDK variant list" am: d2432e668d -s ours
am skip reason: Merged-In I922961b8311d024ebbf3f3339dfdb41c72ee9dd9 with SHA-1 2b9ad1c484 is already in history

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1816596

Change-Id: Id7ffa7be0216ef2afda631add3f72b47eaf90c17
2021-09-09 05:34:09 +00:00
Sarah Chin
d2432e668d Merge "Add Radio AIDL to VNDK variant list" 2021-09-09 05:21:43 +00:00
Sarah Chin
40eb29e39b Merge "Add Radio AIDL to VNDK variant list" into stage-aosp-master 2021-09-09 04:25:24 +00:00
Treehugger Robot
550ec33096 Merge "Add tidy-soong, tidy-dir-path, module-tidy targets" am: f49df213f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1820636

Change-Id: I03c50ff5676e52fd296c58aeebc9866601040e08
2021-09-09 03:38:56 +00:00
Treehugger Robot
f49df213f8 Merge "Add tidy-soong, tidy-dir-path, module-tidy targets" 2021-09-09 03:22:59 +00:00
Treehugger Robot
78ce37ade5 Merge "Convert LOCAL_PRODUCT_SERVICES_MODULE to product_specific" am: 7c8174863d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821012

Change-Id: I50e5fc8918a705b947c2692d5e5798f7f1922c46
2021-09-09 00:58:58 +00:00
Treehugger Robot
7c8174863d Merge "Convert LOCAL_PRODUCT_SERVICES_MODULE to product_specific" 2021-09-09 00:40:58 +00:00
Treehugger Robot
314a7e0294 Merge "Apply pylint to scripts/manifest_check*.py" am: da513b1ec1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1820496

Change-Id: I70926bfb28795ac508e7c712fc2e75274bd73d9e
2021-09-08 23:58:57 +00:00
Treehugger Robot
da513b1ec1 Merge "Apply pylint to scripts/manifest_check*.py" 2021-09-08 23:42:25 +00:00
Peter Collingbourne
cbfbd64823 Read LLVM version from $LLVM_PREBUILTS_VERSION if set.
This matches the behavior of the build system.

Change-Id: Idce0a48403acde100e20246896a1ec68df6b73c7
2021-09-08 13:46:01 -07:00
Sarah Chin
2b9ad1c484 Add Radio AIDL to VNDK variant list
Test: build
Bug: 198331182
Change-Id: I922961b8311d024ebbf3f3339dfdb41c72ee9dd9
Merged-In: I922961b8311d024ebbf3f3339dfdb41c72ee9dd9
2021-09-08 19:08:44 +00:00
Spandan Das
bc9357f3d2 Merge "Apply pylint to check_boot_jars.py" am: 96d5424440
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1811103

Change-Id: I14ffe6fb4ed0710f4e422a7cf0c2747da82cf820
2021-09-08 18:50:52 +00:00
Chih-hung Hsieh
5ee3f91dcd Merge "Use tidyExternalVendor for external/googletest" am: 095aac0614
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1819240

Change-Id: I8b6abe23e57168ff4e01c6f78009edafd8e075ad
2021-09-08 18:50:44 +00:00
Spandan Das
96d5424440 Merge "Apply pylint to check_boot_jars.py" 2021-09-08 18:32:02 +00:00
Chih-hung Hsieh
095aac0614 Merge "Use tidyExternalVendor for external/googletest" 2021-09-08 18:29:05 +00:00
Sarah Chin
b03e96874e Add Radio AIDL to VNDK variant list
Test: build
Bug: 198331182
Change-Id: I922961b8311d024ebbf3f3339dfdb41c72ee9dd9
Merged-In: I922961b8311d024ebbf3f3339dfdb41c72ee9dd9
2021-09-08 17:31:38 +00:00
Samiul Islam
7c02e26cba Relax restriction on suffix of apex_set filename to include .capex
Compressed APEX files generated by the build system have the .capex
extension. This CL allows us using those .capex files with their actual
suffix.

Bug: 197258691
Test: manual + unit test added
Change-Id: I79173ef942326b48b5e659f1873d80f12b212339
2021-09-08 18:29:47 +01:00
Treehugger Robot
e37a7541f3 Merge "Look for the AndroidProduct.mk files in the vendor/ hierarchy, too" am: ba839f8070
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1817105

Change-Id: I9fcd948f4aa531cf9a2ee047b94b92fe22fa0b1c
2021-09-08 17:16:43 +00:00
Treehugger Robot
ba839f8070 Merge "Look for the AndroidProduct.mk files in the vendor/ hierarchy, too" 2021-09-08 17:07:08 +00:00
Lukacs T. Berki
b42d232951 Refactor the creation of soong_build calls. am: 89fcdcb788
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1818245

Change-Id: I224e6b7417ba9f6c9a7f2f2e4804c98d5faa3a52
2021-09-08 13:39:23 +00:00
Lukacs T. Berki
e5d3519643 Invoke soong_docs from the bootstrap Ninja file. am: c6012f36e1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1818237

Change-Id: I9343de3836415c8b59b3a1ae8d61d9e09cda84ba
2021-09-08 13:39:20 +00:00
Lukacs T. Berki
e1df43fafe Implement cleanups requested in aosp/1818245:
- Remove useValidations: whenever it was used, it was turned on, so
there was no point in keeping that knob
- Use the new soong_build invocation name constants

Test: Presubmits.
Change-Id: Ia3e8928d30d3de1e0adaa741111771304e56b139
2021-09-08 15:33:37 +02:00
Lukacs T. Berki
89fcdcb788 Refactor the creation of soong_build calls.
They were a bit repetitive.

In addition, make the environment checks more correct; they could
probably use an integration test or two to make sure that when the
environment changes, exactly those outputs are rebuilt that need to be,
but for now, this is an improvement already.

Test: Presubmits.
Change-Id: Idd79b81ca6975d57d00e5bf4699d266152505ff8
2021-09-08 09:36:22 +02:00
Lukacs T. Berki
c6012f36e1 Invoke soong_docs from the bootstrap Ninja file.
This makes soong_ui the only place where soong_build is invoked, thus
greatly simplifying the conceptual model of the build.

It comes with the slight limitation that now soong_docs (and queryview
and the JSON module graph) are not Make targets anymore, but I suppose
that's an acceptable loss.

The only place where someone depended on soong_docs from a Makefile is
removed in a separate change.

Test: Presubmits.
Change-Id: I3f9ac327725c15d84de725d05e3cdde1da3dcbe2
2021-09-08 09:31:52 +02:00
Lukács T. Berki
371b2ce724 Merge "Pass StopBefore as an argument to RunBlueprint." am: 144bf84677
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1818249

Change-Id: I59d85749a604a3b0db8a6c6b299276de842be6c2
2021-09-08 06:37:14 +00:00
Lukács T. Berki
144bf84677 Merge "Pass StopBefore as an argument to RunBlueprint." 2021-09-08 06:22:29 +00:00
Spandan Das
f880742582 Apply pylint to scripts/manifest_check*.py
1. Run pyformat scripts/<script>.py -s 4 --force_quote_type
none -i to fix formatting
2. Annotate #pylint: disable, where straightforward fix is not available

Test: m manifest_check_test
Test: pylint --rcfile tools/repohooks/tools/pylintrc
build/soong/scripts/manifest_check.py
build/soong/scripts/manifest_check_test.py
Bug: 195738175

Change-Id: I9af498c4abd6ac9f8b9df4f93cbdd4424eacff8e
2021-09-08 03:59:40 +00:00
Justin Yun
0f922ea335 Convert LOCAL_PRODUCT_SERVICES_MODULE to product_specific
LOCAL_PRODUCT_SERVICES_MODULE is interpreted as LOCAL_PRODUCT_MODULE.
When converting Android.mk to Android.bp, it must be converted to
product_specific.

Bug: 135957588
Test: na
Change-Id: I9298991aef10cc7cb82d40cd667c142e64ee50c6
2021-09-08 10:11:57 +09:00
Chih-Hung Hsieh
d0f82fee44 Add tidy-soong, tidy-dir-path, module-tidy targets
* When WITH_TIDY=1, these targets allow quick check of C/C++
  source code with clang-tidy, without building C/C++ binaries.
* For each module with tidy rules, add a module-tidy target, e.g.,
  libart-tidy, libartd-tidy, bionic-benchmarks-tidy, libnativehelper-tidy, etc.
* Add a tidy-soong phony target that depends on all module-tidy targets.
* For each directory X/Y add a tidy-X-Y phony target that depends
  on all *-tidy targets in X/Y and tidy-X-Y-Z for all X/Y/Z directories,
  e.g., tidy-bionic, tidy-bionic-benchmarks, tidy-libnativehelper, etc.
* Only soong modules are collected for now.
  Tidy rules in .mk files will be collected later.
* Some comment lines reformatted by gofmt.

Test: WITH_TIDY=1 make <some_module>-tidy tidy-<some_directory>
Test: WITH_TIDY=1 make tidy-soong
Bug: 199169329
Change-Id: I45aef3875f70288a8e070761e5f083dbbdfa6e94
2021-09-07 14:56:44 -07:00
Chih-hung Hsieh
1b0a86b751 Merge "Add config/tidy.go to per-file owners." am: 63d1a0ab94
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1819238

Change-Id: I1d05b0704a79e02df04a7706d77ccfde19609942
2021-09-07 20:38:42 +00:00