Commit graph

3181 commits

Author SHA1 Message Date
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
bdd7b3de94 Merge "Fix typo in exempt from licenses property list." 2021-09-03 23:29:13 +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
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
5eeb6fc3f2 Merge "Make OutDir() and SoongOutDir() be consistent." 2021-09-02 15:46:57 +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
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
1d1772c147 Merge "Remove bootstrap_go_binary ." 2021-09-01 14:15:58 +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
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
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
Lukacs T. Berki
b078ade28d Remove some unused args from Blueprint.
These are: TopFile and GeneratingPrimaryBuilder.

Also re-shuffle the list of flags to make a bit more sense and finish
the rename of BuildDir and NinjaBuildDir to SoongOutDir and OutDir,
respectively.

Test: Presubmits.
Change-Id: I103ff5f09f1c0d16f695a7da5dea13b55028e33e
2021-08-31 11:42:48 +02:00
Jingwen Chen
a26246db72 bp2build allowlist //development/sdk/...
This builds //development/sdk:platform_tools_version.

Fixes: 198236279
Test: CI
Change-Id: Ibb3d89d07a2841d0d351b05c480caa9a87b870bf
2021-08-31 05:29:58 +00:00
Treehugger Robot
4b2435bc79 Merge "cmdline property in bootimg can be customized for debuggable builds" 2021-08-31 01:59:40 +00:00
Jiyong Park
16e77a9b30 cmdline property in bootimg can be customized for debuggable builds
This change adds product_variables.debuggable.cmdline so that the kernel
cmdline arguments can be augmented for the debuggable builds.

To support that the type of the property has changed to string array.

Bug: 181936135
Test: inspect build.ninja
Change-Id: I81b3ead5187ccb378efabb87d1d15fbdb59d8e2f
2021-08-31 08:32:44 +09:00
Romain Jobredeaux
e4447e4e97 Merge "Set --noautodetect_server_javabase in mixed build bazel." 2021-08-27 20:53:47 +00:00
Romain Jobredeaux
41fd5e402f Set --noautodetect_server_javabase in mixed build bazel.
If a valid JAVA_HOME is set in the environment when running
bazel with --experimental_repository_disable_download, bazel
will unsuccessfully attempt to download rules_java. The above
flag has the practical effect of preventing the download attempt
(some clues as to why in the doc at go/aosp-bazel-jdk).

Note that this also prevents building java targets in mixed mode.
Eventually, we will pull in the java_rules into AOSP so they don't
need to be downloaded.

Test: build/bazel/ci/mixed_libc.sh
Change-Id: Icdb186c18a3334f4caa17243a8620a1cc8c1db0e
2021-08-27 17:34:16 +00:00
Anton Hansson
35c86c07ed 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.
Merged-In: I82a90b83d23b0ba3779a943c2ad444bf5cf937da
Change-Id: I82a90b83d23b0ba3779a943c2ad444bf5cf937da
2021-08-27 17:35:40 +01:00
Romain Jobredeaux
5cc9c9d8e7 Exempt build/bazel/examples/java BUILD files from bp2build overwriting.
Test: b build build/bazel/examples/java/...
Change-Id: Iab4934d99f734979350742a3a14aca7899d4cada
2021-08-27 16:14:13 +00:00
Lukacs T. Berki
9f6c24a887 Rename BuildDir and NinjaBuildDir.
These are just out/ and out/soong/ and the old names were quite
confusing.

Test: Presubmits.
Merged-In: I999ca62162062f27e449f83ffb00fa580d4065b8
Merged-In: I2fcd80a9e376a6842a06aa104a9f6f5c5e16f8c7
Change-Id: Ib481d2aac40df8da1b74174dc8ec576c1cb48be0
2021-08-27 10:08:49 +02:00
Treehugger Robot
9da0a435ef Merge "Keep existing BUILD files for bazel_common_rules" 2021-08-26 16:41:30 +00:00
Colin Cross
b37a92ccc8 Merge "Support musl builds in Make" 2021-08-26 01:14:47 +00:00
Paul Duffin
826ac4d353 Remove unused key field from SdkMemberTypesRegistry
Bug: 195754365
Test: m nothing
Change-Id: I48ba50f009d53024ecb89d8d59309d49989c39fb
2021-08-25 15:08:10 +01:00
Sasha Smundak
18fd099982 Suggest using add_soong_config_ macros instead of direct variable assignments
Bug: 190051051
Test: treehugger
Change-Id: Ib77d8af8f926412f6337173927cee6bb1deda2bb
2021-08-24 14:06:20 -07:00
satayev
28e5eda261 Merge "Make sure that classpath fragment contents appear in make vars." 2021-08-24 13:29:58 +00:00
Jingwen Chen
5e49b82e59 Keep existing BUILD files for bazel_common_rules
Test: presubmits

Bug: 197589841
Change-Id: I6a528fc8e66ce6322e87db975f7656571407c7a1
2021-08-24 05:14:22 +00:00
Liz Kammer
8631cc7327 Update HostAndDevice* documentation
Clarify that HostAndDeviceSupported builds _only_ Device by default,
and add information on how to built host variations.
For HostAndDeviceDefault, clarify how to disable different variants.

Change-Id: I20e30175ddf79038117f1df166d9b994237b27f5
2021-08-23 21:12:08 +00:00
Colin Cross
c74ea4b77b Support musl builds in Make
Rewrite linux_musl to linux when exporting to Make.

Bug: 190084016
Test: m USE_HOST_MUSL=true adb
Change-Id: I48eed5bd7380a07c5106a9b2bd96899fb58f7a7f
2021-08-18 22:02:54 +00:00
Liz Kammer
380dbb9327 Merge "Don't create a new module for bp2build conversion." 2021-08-18 19:28:20 +00:00
Liz Kammer
2ada09a546 Don't create a new module for bp2build conversion.
A performance improvement for bp2build as Blueprint/Soong no longer have
the overhead of additional modules. The creation of these modules
results in:
* traversal of additional modules for each subsequent mutator
* synchronization over a go channel to collect newly created modules:
https://cs.android.com/android/platform/superproject/+/master:build/blueprint/context.go;l=2594,2600;drc=1602226f23181b8c3fbfcaf3358f0297e839d7d3

We avoid both of these by storing the information directly in the
underlying module.

Also as a fringe benefit, removes some necessary boilerplate for
conversion.

For benchmarks, reduces runtime ~1% for 1% converted, ~24% for 100%
converted. See more: go/benchmarks-for-https:-r.android.com-1792714

Test: ran benchmarks/tests in bp2build
Test: build/bazel/ci/bp2build.sh
Change-Id: Ie9273b8cbab5bc6edac1728067ce184382feb211
2021-08-17 15:57:09 -04:00
Liz Kammer
135bf55281 Handle arch-specific/not properties the same.
Refactor arch-handling code to return a "no-config" axis which allows
handling non-arch configed properties the same way as arch-configed
properties.

Test: build/bazel/ci/bp2build.sh
Change-Id: I485b35fd91c28501fe2055234dc9b278488bf4b5
2021-08-17 13:06:54 -04:00
Lukacs T. Berki
f7e36d80ff Remove Srcdir() from BootstrapConfig.
It was always ".".

Test: Presubmits.
Change-Id: I5381002b3f2986122f1b335a88119cead0a86d75
2021-08-16 17:05:09 +02:00
Lukacs T. Berki
f9008075d9 Define command line args in soong_build .
They used to be defined in Blueprint but since it doesn't have a
separate existence anymore, we can consolidate all command line
arguments here.

Note that Blueprint is called directly from soong_ui, but that happens
by a simple Go function call and not by invoking a separate binary, so
command line arguments are not needed there.

Test: Presubmits.
Change-Id: Ifa2c101ddbe424b76fc5a508d3d41c329e7353ca
2021-08-16 15:29:02 +02:00
satayev
d34eb0c4a6 Make sure that classpath fragment contents appear in make vars.
The source of truth for what jars are in BOOTCLASSPATH and
SYSTEMSERVERCLASSPATH is make; adding a classpath fragment in soong
with a new jar in the contents without having it declared in make
is wrong (excluding test apexes).

Bug: 191369843
Test: m nothing
Change-Id: Ifd313776ee7ad206031244534ed3870126e4f835
2021-08-16 12:00:25 +01:00
Jingwen Chen
76738b1c45 Merge "Revert "Exempt prebuilts/jdk and build/bazel/examples/java BUILD..."" 2021-08-13 05:18:56 +00:00
Treehugger Robot
6c00d24a1f Merge "Exempt subfolders of packages/apps/Music from bp2build BUILD file overriding." 2021-08-13 03:04:25 +00:00
Alex Humesky
e9b3738bad Revert "Exempt prebuilts/jdk and build/bazel/examples/java BUILD..."
Revert submission 1789607-java_android_ci

Reason for revert: doesn't work with lunch
Reverted Changes:
I6f82e4984:Exempt prebuilts/jdk and build/bazel/examples/java...
I75a61c24c:Define a java_runtime and toolchain bazel targets ...
I0f107d334:Add a java binary, a java library, and an android ...

Change-Id: I9869424dd44c03b33ac02ab38e4a3e0deee9eb07
2021-08-13 02:06:23 +00:00
Treehugger Robot
1e6760fc71 Merge "Update documentation for VisitDirectDeps" 2021-08-12 23:46:36 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
a05a255eac Add infrastructure to support PythonBinary
Add a new request type with its own StarLark function
Hook it up via GetPythonBinary
Add to MockBazelContext a LabelToPythonBinary
Add a test for the new request type

Test: request_type_test.go:TestGetPythonBinaryParseResults
Change-Id: I05f6506adfbbdac8b3f40475509ed02ab8e844e5
2021-08-12 18:48:15 +00:00
Yuntao Xu
fc30cfc7ae Merge "Add Platform_sdk_version_or_codename variable" 2021-08-12 16:09:32 +00:00
Romain Jobredeaux
f1b0ac8d3a Exempt subfolders of packages/apps/Music from bp2build BUILD file overriding.
Change-Id: I30a0d4635a4d25465c1791dcfb78c777ad45dede
Test: b build packages/apps/Music
2021-08-12 14:39:25 +00:00
Yuntao Xu
402e9b08e1 Add Platform_sdk_version_or_codename variable
1. Added a new product variable Platform_sdk_version_or_codename;
2. This variable is used to support the logic in the Android.bp file
when either the Platform_sdk_version or the Platform_sdk_codename is
used.

Bug: 195986342
Test: m CtsThemeHostTestCases (the module where the product variable is
used)
Test: TreeHugger

Change-Id: I6b952ce47fd4adc280aa3c7ef4185487558af9bc
2021-08-11 12:33:37 -07:00