Commit Graph

3771 Commits

Author SHA1 Message Date
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
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
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
Romain Jobredeaux
9e09bba237 Exclude directories with manual BUILD files from bp2build.
Test: b build packages/apps/QuickSearchBox
Change-Id: I2534a328e28a6fff1385bfccdc3b461198bc1f88
2021-09-08 18:09:02 +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
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
Liz Kammer
7cbf7738f2 Cleanup unused code for bp2build conversion.
This code to support bp2build-specific modules is no longer necessary as
we do not create bp2build modules after https://r.android.com/1792714

Test: build/bazel/ci/bp2build.sh
Change-Id: I20d3c42f7e3516554cfb537fef05ba40d222dbeb
2021-09-07 13:19:21 -04:00
Lukacs T. Berki
ffc9e8d812 Pass StopBefore as an argument to RunBlueprint.
Its value is a function of the call site, so it doesn't make a lot of
sense to plumb it through the configuration.

Test: Presubmits.
Change-Id: If928b34de075969fd42932212ce9187808cbdf86
2021-09-07 18:14:07 +02:00
Lukacs T. Berki
ab4aada2b1 Invoke queryview from the bootstrap Ninja file. am: 3a82169a55
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1818236

Change-Id: I1780da93fb21a8e6c0c9c309c250716fc1f0a6a4
2021-09-07 06:17:27 +00:00
Lukacs T. Berki
3a82169a55 Invoke queryview from the bootstrap Ninja file.
It used to be invoked from out/soong/build.ninja, which required two
soong_build invocations one after the other (ne to generate
out/soong/build.ninja, one to generate the queryview workspace). This
was slower and required some shell-quoted-in-ninja-quoted-in-Go .

Test: Presubmits.
Change-Id: Idda79c067606663b66e9f94626fa24f3b5af4114
2021-09-06 17:10:49 +02:00
Treehugger Robot
09b9eadefb Merge "Fix typo in exempt from licenses property list." am: bdd7b3de94
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1818660

Change-Id: Ib644086c2ba8114d818a5b74fcbfa79093671e0d
2021-09-03 23:45:27 +00:00
Treehugger Robot
bdd7b3de94 Merge "Fix typo in exempt from licenses property list." 2021-09-03 23:29:13 +00:00
Lukács T. Berki
69b9caf11a Merge "Do not modules in files called "Blueprints"." am: 399dbe0699
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1817961

Change-Id: I754c8b72284ac8a22851f58ad1d03c8e2a90ec3d
2021-09-03 18:38:54 +00:00
Lukács T. Berki
399dbe0699 Merge "Do not modules in files called "Blueprints"." 2021-09-03 18:20:39 +00:00
Bob Badour
bae8421fea Fix typo in exempt from licenses property list.
Bug: 151177513

Test: m all
Change-Id: If794ccc814379e383db87f0deb587114b743d952
2021-09-03 17:25:35 +00:00
Treehugger Robot
b8d4e69927 Merge "Allows prebuilts in override_apex." am: e267bc8f74
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1811097

Change-Id: I732915686e54509c30f6855ea29d562bc83cf680
2021-09-03 16:13:56 +00:00
Treehugger Robot
e267bc8f74 Merge "Allows prebuilts in override_apex." 2021-09-03 16:01:31 +00:00
Daniel Norman
5a3ce13c6a Allows prebuilts in override_apex.
Bug: 197787336
Test: Create an override_apex that uses a different `prebuilts` than its
      base. Observe built contents.
Test: apex_test.go
Change-Id: I7666ed6cfe3f2fa5dd81e5f8c1961477dabbbd3c
2021-09-02 09:28:52 -07:00
Lukács T. Berki
e908fea7d2 Merge "Make OutDir() and SoongOutDir() be consistent." am: 5eeb6fc3f2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815792

Change-Id: Ib28188151307381391cce50c6ee2ae998bf0c9be
2021-09-02 15:48:56 +00:00
Lukács T. Berki
5eeb6fc3f2 Merge "Make OutDir() and SoongOutDir() be consistent." 2021-09-02 15:46:57 +00:00
Treehugger Robot
02dde7fe4a Merge "bp2build: allowlist more packages." am: dadcc8af6f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815876

Change-Id: If3f7a18de76b480aa42c366d4d650f5062c60ece
2021-09-02 15:02:36 +00:00
Treehugger Robot
dadcc8af6f Merge "bp2build: allowlist more packages." 2021-09-02 14:48:49 +00:00
Lukacs T. Berki
d6cee7e374 Make OutDir() and SoongOutDir() be consistent.
They both used to return out/soong. Unfortunately, the tests seem to
assume the old behavior, so I had to keep tests inconsistent and I was
scared of dexpreopt, too.

Test: Presubmits.
Change-Id: Ib00c7956fd2cdb28cc11d481c17e5a3ff5ad563a
2021-09-02 13:35:49 +02:00
Lukacs T. Berki
d51ffbfc98 Remove the bootstrap.Config class. am: ea1a31c07f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1817957

Change-Id: Iaba39ef38316634c024d13972a6295e883c5d1f8
2021-09-02 10:53:13 +00:00
Jingwen Chen
294e774e28 bp2build: allowlist more packages.
* //system/core/libprocessgroup:libprocessgroup_headers
* //external/brotli/... and build libbrotli.
* //external/libcxx/...

This also adds //system/core/libprocessgroup to the denylist, but
non-recursively, because there are other modules in its subpackages that
don't build yet, so CI's bp2build-incremental's `//system/...` build can keep
working.

Fixes: 186826841
Fixes: 198148733
Fixes: 197954422

Test: ran mixed_droid-clean locally
Test: presubmits
Change-Id: I5f21287f5374811c4bfcf7b7d64430fe4f9b2900
2021-09-02 10:49:58 +00:00
Lukacs T. Berki
b838b0a147 Do not modules in files called "Blueprints".
The only case for this was Blueprint itself at build/blueprint, but with
that being a part of Soong, this special case is not necessary anymore.

Test: Presubmits.
Change-Id: Icc51cd80bd43f936a97018061cfbf76fc385e4c3
2021-09-02 11:46:24 +02:00
Lukacs T. Berki
ea1a31c07f Remove the bootstrap.Config class.
It was confusing because bootstrapping uses two configurations: the
"global" config and the special-cased bootstrap one.

This change merges them.

Test: Presubmits.
Change-Id: I82b482cbe28a343ab6991374b2a28667e1a06b48
2021-09-02 09:59:35 +02:00
Lukács T. Berki
088d0e078c Merge "Remove bootstrap_go_binary ." am: 1d1772c147
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815120

Change-Id: Ied2d87c387bf021eb42d6ef3107054b3e1900100
2021-09-01 14:28:44 +00:00
Lukács T. Berki
1d1772c147 Merge "Remove bootstrap_go_binary ." 2021-09-01 14:15:58 +00:00
Paul Duffin
f9e90d95e8 Merge "Make sdk member type related types and vars type specific" am: eb784f1506
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1808898

Change-Id: I419e55852b2fd6a45c6393ab095ee7e8e1a4ebfc
2021-09-01 12:43:42 +00:00
Paul Duffin
eb784f1506 Merge "Make sdk member type related types and vars type specific" 2021-09-01 12:26:06 +00:00
Lukacs T. Berki
a806e4176b Remove bootstrap_go_binary .
blueprint_go_binary is enough.

Test: Presubmits.
Change-Id: Ic95ed8533603dff396740bc1d2a7c60ff2cebf20
2021-09-01 11:55:22 +02:00
Anton Hansson
d841c3533a Merge "Add support for extension version in variables" 2021-09-01 09:00:15 +00:00
Anton Hansson
a06d2d1093 Merge "Add support for extension version in variables" into stage-aosp-master 2021-09-01 08:21:32 +00:00
Treehugger Robot
05ac706e6f Merge "Refactor SdkMemberType.AddDependencies()" am: a36ffdead5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1808897

Change-Id: I0535c811329b9101059bf9a8953ee203335d2cb4
2021-08-31 19:08:38 +00:00
Anton Hansson
b021bf8c5a Add support for extension version in variables
This makes the sdk extension version usable in genrule cmds via %d.

Bug: 195281582
Test: current_sdkinfo module in packages/modules/common.
Change-Id: I82a90b83d23b0ba3779a943c2ad444bf5cf937da
Merged-In: I82a90b83d23b0ba3779a943c2ad444bf5cf937da
(cherry picked from commit e720c41f67a7e9309f1e6e48d5975383be7b2d28)
2021-08-31 17:41:41 +00:00
Paul Duffin
62782de15c Make sdk member type related types and vars type specific
Previously, some of the sdk member type related types and variables
included the words "member type" whereas others only used the word
"member" and did not include "type". This changes makes them all
include the word "type" to differentiate them from other types related
to sdk members.

Bug: 195754365
Test: m nothing
Change-Id: I913daaa1d436fd5dc857c2af0ffdee6471dcc6ed
2021-08-31 17:31:34 +01:00
Paul Duffin
0c9985dc6d Merge "Remove unused key field from SdkMemberTypesRegistry" am: 45de13f93d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1808896

Change-Id: Id0b3dcd603eaea18b714902b6d4878c8adfd8de1
2021-08-31 16:12:11 +00:00
Paul Duffin
296701e35b Refactor SdkMemberType.AddDependencies()
Replaces the BottomUpMutatorContext parameter with a new
SdkDependencyContext type that extends BottomUpMutatorContext. This is
to allow the sdk to pass additional information to the implementations
of that method to allow the behavior to be more finely tuned.

Bug: 195754365
Test: m nothing
Change-Id: I69c6d2c523934eb67d7a7e6c55c241e9b8a81773
2021-08-31 17:07:07 +01:00
Paul Duffin
45de13f93d Merge "Remove unused key field from SdkMemberTypesRegistry" 2021-08-31 15:57:04 +00:00
Lukács T. Berki
c846a8d6b0 Merge "Remove some unused args from Blueprint." am: c3dbead65b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1814597

Change-Id: I798a8f6bc7689660353b23134648bdcacc3ba899
2021-08-31 13:48:47 +00:00