Commit graph

45470 commits

Author SHA1 Message Date
Treehugger Robot
adf2b3e68f Merge "Add android_sdk_repo_host to build platform-tools&build-tools" 2021-10-15 02:04:45 +00:00
Stephen Hines
f7bc97ce7a Merge "Switch to clang-r433403b (13.0.3)" 2021-10-14 18:46:08 +00:00
Seth Moore
6ec96b8102 Merge "Flag an error on empty rust module srcs" 2021-10-14 15:25:17 +00:00
Seth Moore
3afac0b36f Flag an error on empty rust module srcs
It's an error if a rust module's srcs is empty. Prior to this change
the output was a panic that complains loudly about a slice error and
nothing else. This change doesn't stop the panic, but at least adds
a bit of context so devs who make a simple mistake can more easily
fix it.

Test: SOONG_GEN_RUST_PROJECT=1 m nothing
Change-Id: Id7d8465d533413c3000699661222a53a7c8678f3
2021-10-14 15:25:07 +00:00
Liz Kammer
47a6c59819 Merge "Add missing directories to bp2build." 2021-10-14 14:03:33 +00:00
Yi Kong
8ea56f9da9 Add Global ThinLTO option (2nd try)
Instead of making everything into ThinLTO variant by default (it works
but many Soong tests don't like this, and got bit rot due to lack of
active builder for this configuration), let the default option be
ThinLTO and no LTO be a special variant.

Test: m GLOBAL_THINLTO=true
Test: m
Bug: 195134194
Change-Id: I2fd98061ba55eba1fdfdd056fb2f8c2051fd2553
2021-10-14 17:34:13 +08:00
Stephen Hines
b7b0ae12be Switch to clang-r433403b (13.0.3)
Bug: http://b/202099787
Test: m
Change-Id: Id923948c56b0308842c94846edd6528fd26dbf72
2021-10-14 01:21:21 -07:00
Jiyong Park
ddf4ebae19 Merge "Remove use_apex_name_macro" 2021-10-14 02:32:43 +00:00
Jiyong Park
91f1b42226 Remove use_apex_name_macro
The property is no longer used.

Bug: 161926892
Test: m
Change-Id: I98948152d6d09bde2eeba4875c7ca01531a24930
2021-10-14 08:57:59 +09:00
Trevor Radcliffe
8c1ae8f2ff Merge "Ignore obsolete lines when converting makefiles" 2021-10-13 22:07:50 +00:00
Liz Kammer
2fc348986c Add missing directories to bp2build.
Added directories with deps of adbd that were not converted and added
them to be converted via bp2build.

Test: bp2build.sh
Test: mixed_droid.sh
Change-Id: Iacb634b23e1fdc2767a0923882b71f482ebca53d
2021-10-13 17:07:41 -04:00
Lev Rumyantsev
1eda2bd946 Merge "Support 64-bit arm_on_x86_64" 2021-10-13 19:42:49 +00:00
Treehugger Robot
3bc7a1ba47 Merge "bp2build: Add special arch-variant targets." 2021-10-13 17:29:36 +00:00
Trevor Radcliffe
93295f27e4 Ignore obsolete lines when converting makefiles
Specifically this skips cases where LOCAL_MODULE_PATH
is TARGET_OUT_OPTIONAL_EXECUTABLES or TARGET_OUT_DATA_APPS.

Test: Added tests
Test: Treehugger
Change-Id: Ib64f22fc3936703c665d07dbb25d8ebf3b9f56c5
2021-10-13 17:16:18 +00:00
Lev Rumyantsev
34581212a4 Support 64-bit arm_on_x86_64
hasArmAndroidArch only checked for 32-bit arm target and thus didn't
work properly on 64-bit only systems.

Test: CtsRsCppTestCases 64-bit only arm on x86
Bug: 194800662
Change-Id: I87332d793dcdd4859766c9067b9fd53f9e4c2516
2021-10-13 09:55:10 -07:00
Jingwen Chen
7b568c1cea Merge "Revert "Fix test to use --experimental_platform_in_output_dir."" 2021-10-13 15:34:12 +00:00
Paul Duffin
13dd220448 Merge "Stop prebuilt_apex/apex_set exporting invalid jars to Make" 2021-10-13 14:53:17 +00:00
Jingwen Chen
3c5083c058 Revert "Fix test to use --experimental_platform_in_output_dir."
Revert submission 1854375-update-bazel-daecf427ec0bf0e963c324783062c4f5b61ff679

Reason for revert: introduces 503d56eda2, which conflicts with our current cc_binary->cc_shared_library work
Reverted Changes:
I40a511195:Fix test to use --experimental_platform_in_output_...
I05c2c11f3:Update Bazel to https://github.com/bazelbuild/baze...
Ie772d1665:Set --experimental_platform_in_output_dir.
Id66674d72:Update Bazel to https://github.com/bazelbuild/baze...

Change-Id: I0e5a7548feb13c2f3b4deae1921542b15d23a283
2021-10-13 14:25:41 +00:00
Liz Kammer
fdd72e6351 bp2build: Add special arch-variant targets.
Soong supports additional arch-variant targets based on arch/os aside
from strictly arch/os names. Handle the unconverted cases based solely
on arch/os.

Test: build/bazel/ci/bp2build.sh
Change-Id: I8dc987b1aa4a4ea646dd5b03a94b84297ba6113a
2021-10-13 09:01:56 -04:00
Liz Kammer
06f00c33a7 Merge "Do not sort after subtraction." 2021-10-13 12:27:48 +00:00
Dan Willemsen
9fe1410213 Add android_sdk_repo_host to build platform-tools&build-tools
The Android SDK has been built with Make up until now, monolithically,
then split up into several sdk-repo zip files for different purposes.
The Mac and Windows SDKs really only need to contain the platform-tools
and build-tools pieces, but due to this monolithic sdk zip, we had to
build the whole SDK first.

This adds an `android_sdk_repo_host` module that can build these
platform-tools and build-tools zips.

Bug: 187222815
Change-Id: I55809e1d7447dd65e22461f921b2b8abb6d5f822
2021-10-13 01:25:02 -07:00
Jingwen Chen
3e4d25552b Merge "Fix test to use --experimental_platform_in_output_dir." 2021-10-13 07:04:05 +00:00
Pirama Arumuga Nainar
1b6a962be3 Merge "[get_clang_version] Make the version regex permissive" 2021-10-13 05:47:35 +00:00
Yi Kong
a9e56f062d Merge "Re-enable unused-command-line-argument warning" 2021-10-13 04:12:12 +00:00
Yi Kong
62e75f507d Re-enable unused-command-line-argument warning
Turn on the warning by default, unless USE_CCACHE is set.

Test: presubmit
Bug: 197177755
Change-Id: I01e2b0f1be3f4bd3a8d78bb4ab053b4db227596d
2021-10-13 04:11:56 +00:00
Jiakai Zhang
40eb3b3e94 Merge "Add more tests for dexpreopting." 2021-10-13 03:17:11 +00:00
Jingwen Chen
c6ef451e0e Fix test to use --experimental_platform_in_output_dir.
Bug: 197925723
Test: CI
Change-Id: I40a511195ff7cc5fc336d3671bcdccd2364ca432
2021-10-13 02:25:19 +00:00
Jingwen Chen
e466cc7ea6 Merge "Convert cpp_std to be an attribute instead of a copt." 2021-10-12 23:13:53 +00:00
Liz Kammer
9bad9d645e Do not sort after subtraction.
This allows labels/strings to remain in their original order.

Test: go test bazel tests
Change-Id: I69f575df9e4a358fee4392ae48edf4550e463efb
2021-10-12 13:36:27 -04:00
Liz Kammer
7e1956643c Merge "bp2build: Improve handling of generated_sources" 2021-10-12 17:29:23 +00:00
Yu Liu
f6f010b2de Merge "Change the approach to decide whether to upload metrics." 2021-10-12 16:02:54 +00:00
Jiakai Zhang
470b7e22a7 Add more tests for dexpreopting.
This CL adds more tests to ensure that dexpreopted files are generated
and APEXes depends on them.

Bug: 201371822
Test: m nothing
Change-Id: I407ad54c55cbca9ef78bbd335e95d4b765e174a0
2021-10-12 03:25:52 +00:00
Treehugger Robot
4af0d002a5 Merge "Installation routine for rust is similar to that of cc" 2021-10-12 00:05:37 +00:00
Yu Liu
6e13b40628 Change the approach to decide whether to upload metrics.
1. Don't upload if the uploader binary is not present.

Bug: b/193703183
Test: Run the following tests locally:
1. run "go test ." in build/soong/ui/build
2. create vendor/google/misc/metrics_uploader_prebuilt/metrics_uploader.sh
and run m nothing to ensure metrics_uploader.sh was called
3. remove the file created in step 2 then run m nothing and ensure it
doesn't attempt uploading

Change-Id: I081a5510b3f30480720c3e7dd235623c805fa7a4
2021-10-11 21:05:00 +00:00
Liz Kammer
222bdcff5c bp2build: Improve handling of generated_sources
Test: build/bazel/ci/bp2build.sh
Change-Id: Id5f8b6ae9bbf1e90d72854daafb8b1f86f7241ea
2021-10-11 14:15:51 -04:00
Yu Liu
37c3dd3276 Rename desc to description in PerfInfo
Bug: 201326605
Test: Ran go unit tests and verified the generated soong_metrics file.
Change-Id: I3ff0aa11e39f0a9862638706ae50550c78030cca
2021-10-11 11:11:45 -07:00
Steven Moreland
371dc53d18 Merge "Allow defaults in java_genrule modules" 2021-10-11 17:47:22 +00:00
Jingwen Chen
5b11ab1a69 Convert cpp_std to be an attribute instead of a copt.
This attribute is then converted into a feature in cc_library_static.

Fixes: 202518741
Test: CI
Change-Id: I070b56a1e96680ffad0466d085caaab2e9308ebc
2021-10-11 17:44:33 +00:00
Paul Duffin
2579631bd1 Stop prebuilt_apex/apex_set exporting invalid jars to Make
A prebuilt_apex/apex_set module can make a dex implementation jar
available for use by Make targets but it does not have access to a real
classes implementation jar; the jar in the corresponding sdk is just an
empty file. Exporting that invalid file to Make means that the phony
target created for the module depends on an invalid classes jar which
causes the build to fail.

This change removes the logic that make classes and header jars
available to Make so that building the phony target no longer fails.

Bug: 202521005
Test: m TARGET_PRODUCT=armv8 TARGET_PRODUCT_VARIANT=eng TARGET_BUILD_UNBUNDLED=true SOONG_ALLOW_MISSING_DEPENDENCIES=true core-icu4j
      - above was performed in master-art.
Change-Id: If667b36b988e2d331acd85f60f3369778838d034
2021-10-11 17:53:54 +01:00
Anton Hansson
6fcddda43c Merge "Update reference to merged services txt" 2021-10-11 15:57:02 +00:00
Colin Cross
99c3ed94b8 Allow defaults in java_genrule modules
Call InitDefaultableModule in java_genrule factories to allow
the defaults property to be used.

Bug: 202547639
Test: m checkbuild
Change-Id: I3a5960304af3e9babb30d036d63016087000d773
2021-10-08 17:52:32 -07:00
Liz Kammer
2649c7913a Merge "bp2build; Update handling of linker flags" 2021-10-08 20:09:32 +00:00
Trevor Radcliffe
c170e39a6b Merge "Add support for USES_LIBRARIES to androidmk" 2021-10-08 19:12:21 +00:00
Liz Kammer
8cdd6f007d Merge "Restrict mixed build cquery to deps of depth 2." 2021-10-08 17:04:02 +00:00
Anton Hansson
f2dffd9c04 Update reference to merged services txt
The module is changing name. Update the reference.

Bug: 169103987
Test: m
Change-Id: I1e3f05b6d9c0262adcde6881ea79df9338bb363a
2021-10-08 16:15:10 +01:00
Jingwen Chen
97b8531492 Add bp2build support for cpp_std.
This converts cpp_std and gnu_extensions into a -std copt, if cpp_std is
specified or gnu_extensions is false if cpp_std is not specified.

I chose to go with this copts approach because the tradeoff is a much
simpler setting than adding a new attr(s) everywhere that uses features
to set the flag.

This approach limits the number of user-configurable knobs (since users
would then be able to set std in _both_ copts and the new attr). But it
does rely on the user copt overriding the toolchain's default gnu++17
version, which can mean a `-std` flag showing up twice in the action.

Fixes: b/202462232
Test: b build //system/libziparchive:libziparchive
Change-Id: I81dad029059461739b91f318d662e089edb46b84
2021-10-08 11:16:20 +00:00
Xin Li
800112b97f Merge "Merge Android 12" 2021-10-07 23:50:21 +00:00
Liz Kammer
0eae52e0de bp2build; Update handling of linker flags
Test: build/bazel/ci/bp2build.sh
Bug: 197920036
Change-Id: I6e3100574fa0e40bcd8cf0e6af0efd3310aa41bf
2021-10-07 16:07:40 -04:00
Jingwen Chen
6ada589f6e Add support for nocrt by translating it to link_crt in bp2build.
If nocrt is true, then the compilation for cc_shared_library,
cc_binary (shared or static binaries) will _not_ link against their
respective crtbegin and crtend libraries.

nocrt is true only for the Bionic libraries themselves. For everything
else that links against the Bionic runtime, crtbegin and crtend
libraries are used. This makes the "nocrt: false" case the majority.
Hence, if nocrt is explicitly false, we omit the generating attribute in
bp2build.

If nocrt is explicitly true (link_crt is false), the Starlark macro will
disable the link_crt cc_toolchain feature.

Test: new tests
Test: CI
Fixes: 187928070
Fixes: 197946668
Change-Id: I8947789930e599dc802d8eae440859257d044475
2021-10-07 14:04:39 +00:00
Jingwen Chen
8f22274297 Stop relying on target.kind in mixed builds.
target.kind was a field that existed for only a few months, and have
been removed from Bazel. This is needed to update to a newer Bazel version.

Also, this reverts filegroups to be queried for a specific arch again,
but leaving file targets in the common arch (which is correct, anyway).

Fixes: b/199363072
Test: mixed_libc
Test: presubmits
Change-Id: I3b8e5c43a39516d977d327a44a75750b2f251be3
2021-10-07 14:04:38 +00:00