Commit graph

4858 commits

Author SHA1 Message Date
Lukács T. Berki
4bb30b59a9 Merge changes from topic "separate-symlink-forest-invocation"
* changes:
  Build the symlink tree on multiple threads.
  Create Bazel symlink forest in a separate process.
2022-10-28 07:05:00 +00:00
Treehugger Robot
2b1a1bff0f Merge "The NDK _does_ assume neon now." 2022-10-28 01:50:58 +00:00
Elliott Hughes
c55b58692d The NDK _does_ assume neon now.
This lets us simplify more of our build configuration for stuff like
libm and libz.

Test: treehugger
Change-Id: I823c7df8117f068aeeb7067e8e197863b0fb517f
2022-10-27 23:46:22 +00:00
Victor Liu
2ea00270a3 Merge "Revert "Revert ^2 "Prevent unspecified values in soong_config_st..."" 2022-10-27 19:11:31 +00:00
Brad Hinegardner
b7b2e12475 Revert "Revert ^2 "Prevent unspecified values in soong_config_st..."
Revert submission 2262062-colefaust_soong_config_string_variable_2nd_try

Reason for revert: breaks builds, b/255996492 among others
Reverted Changes:
I3e2f59e5f:Fix typo
Id3bcd9a46:Revert ^2 "Prevent unspecified values in soong_con...

Change-Id: Ifa8ebb3993bf2c716c3ec3c9fdbe72ba019e77ad
2022-10-27 19:01:10 +00:00
Cole Faust
3bd8f0a6e6 Merge "Revert ^2 "Prevent unspecified values in soong_config_string_variable""" 2022-10-27 16:41:29 +00:00
Lukacs T. Berki
c541cd27fa Create Bazel symlink forest in a separate process.
This helps with incrementality a lot: the symlink forest must depend on
almost every directory in the source tree so that if a new file is added
or removed from *anywhere*, it is regenerated.

Previously, we couldn't do this without invoking bp2build, which is
quite wasteful because bp2build takes way more time than the symlink
forest creation, even though we do the latter in a very suboptimal way
at the moment.

This means that if a source file is added or removed (which does not
affect globs), we don't pay the cost of bp2build anymore.

Also refactored symlink_forest.go on the side. Too much state was being
passed around in arguments.

This change reimplements aosp/2263423 ; the semantics of not touching an
output file is the exact same as order-only inputs and the latter is a
bit fewer lines of code.

Test: Presubmits.
Change-Id: I565c580df8a01bacf175d56747c3f50743d4a4d4
2022-10-27 08:08:45 +00:00
Jason Wu
ab17626ba6 Merge "Revert "Use proto output instead of jsonproto output for aquery"" 2022-10-27 05:24:40 +00:00
Jason Wu
d27e28c2a7 Revert "Use proto output instead of jsonproto output for aquery"
This reverts commit 6fe8721e12.

Reason for revert: Broke aosp_kernel-build-tools/linux

Change-Id: I502ec4c275cbc56e1024a42fadf68b308750939d
2022-10-27 05:18:40 +00:00
Jason Wu
b1bd4bf716 Merge "Use proto output instead of jsonproto output for aquery" 2022-10-27 03:06:12 +00:00
Treehugger Robot
b5703b83a3 Merge "Tweak Soong install rules logging" 2022-10-26 22:37:59 +00:00
Jason Wu
6fe8721e12 Use proto output instead of jsonproto output for aquery
Test: use m --bazel-mode-dev and mixed_droid.sh
Bug: 233798334
Change-Id: Ib945359d3d05e6f51afe70432ec380e4e584175b
2022-10-26 17:07:48 -04:00
Yu Liu
2ff53da9f8 Merge "Support apex_test." 2022-10-26 16:37:59 +00:00
Joe Onorato
934977cbbe Merge "Move bazel from being a shell function to being a script at build/bazel/bin/bazel" 2022-10-25 17:56:58 +00:00
Alessandro Astone
2b17a23da8 Tweak Soong install rules logging
The make counterparts print a colon, so match that

Change-Id: I9482a0e66b03ad41a66df09d29e76b465ece35c5
2022-10-25 11:46:01 +02:00
Treehugger Robot
1227abee34 Merge changes from topic "api_library_missing_deps"
* changes:
  Do not register missing deps
  Skip existence check for stub library files
2022-10-25 03:12:07 +00:00
Yu Liu
4c212ce058 Support apex_test.
Bug: 249744489
Test: Manual and unit test.
Change-Id: I866debf7ffee54a0f4649b5e5425a8e3cc3042a1
2022-10-24 10:35:12 -07:00
Liz Kammer
748209cb6b Disable all filegroups in mixed builds
Rather than individually denylisting filegroups until we prioritize a
solution for mixed builds that will correctly integrate into uses such
as proto, aidl, gensrcs, etc.

Test: mixed_droid
Change-Id: Iddbd391af7dd7cabc892b2b26dbc68e3aa506471
2022-10-24 11:11:58 -04:00
Joe Onorato
ba29f380d3 Move bazel from being a shell function to being a script at build/bazel/bin/bazel
Bug: 254713799
Test: b build //packages/modules/adb/apex:com.android.adbd
Change-Id: I6a0a89438a46d8252c3e0c24319038b0cf2dbd59
2022-10-24 06:38:11 -07:00
Spandan Das
c6c10fa34f Do not register missing deps
This is a fix to aosp/2260763 and skips the existence check corectly.
Previously, it would not throw an exception during Soong analysis, but
would add the path to a `MissingDeps` object. The ninja graph generated
using this would throw an exception during ninja execution.

We should not do this check for `cc_api_library`. The prebuilt
library.so is missing in the build graph of the inner tree (expected),
but it will be present when the orchestrator creates the combined
multi-tree ninja graph.

Test: rm -rf out && multitree_build vendor/vendorimage
(I did not clean out/ in aosp/2260763, and therefore did not catch this
earlier)
Test: go test ./cc

Change-Id: I68d245acae3bfb777bfc8a72fb7cd4909cb0a289
2022-10-22 02:26:30 +00:00
Vinh Tran
a38504fd11 Merge "Disable converted filegroups in mixed build" 2022-10-21 23:00:34 +00:00
Rex Hoffman
8165dd6941 Merge "Enable new_robolectric" 2022-10-21 22:17:27 +00:00
Vinh Tran
ce77a337ee Disable converted filegroups in mixed build
Bug: 254796426
Test: m libplatformprotos --bazel-mode-dev
Change-Id: I03f4f4847f8dafc3291c1cceed2dd62be4c91746
2022-10-21 16:48:37 -04:00
Rex Hoffman
54641d2aec Enable new_robolectric
Allow new robolectric to break soong's exepected machine type restrictions

Test: mma in /external/robolectric
Bug: 244627502

Change-Id: If58a36b2d84804d586d9c8a773e2e739867fa987
2022-10-21 17:53:40 +00:00
Mark Dacek
99db041a14 Merge "Add bazel staging mode to soong build." 2022-10-21 17:38:43 +00:00
Cole Faust
c52527364f Merge "Fix bazel builds with unspecified arch" 2022-10-21 17:34:31 +00:00
Cole Faust
f5eae990bc Fix bazel builds with unspecified arch
//build/bazel/platforms:android_target is an alias to
android_{arch}, so on bulids like "ndk" that don't
specify an arch, it fails.

It's also questionable if we should be setting the
platform to android in a mixed build in the first
place. What if we were mixed-building a host tool?

This reproduces when running
`OUT_DIR=out ./build/soong/scripts/build-ndk-prebuilts.sh`
with aosp/2263623. That script specifies --soong-only,
which is important because even without bazel, `m nothing`
on ndk-userdebug will fail with errors in makefile code.

Bug: 254701254
Test: Described above
Change-Id: I34cae0287830a19c4865fbd398f3c4e1ee1d2d66
2022-10-20 16:49:30 -07:00
Vinh Tran
3cb9ade56b Allowlist framework-javastream-protos and framework-cppstream-protos
Mixed build between gensrcs and filegroup is currently broken (b/242847534 b/247782695). This CL allowlist the gensrcs modules to remove the mixed build instead.

Test: m framework-javastream-protos --bazel-mode-dev
Test: m framework-cppstream-protos --bazel-mode-dev
Bug: 254634154
Change-Id: Icbca336612fbee3a91604770c8903f011bee6edd
2022-10-20 17:17:32 -04:00
Jingwen Chen
6817bbb3c8 Introduce BazelStringOrLabelFromProp.
Soong supports string properties, but they are overloaded, and can mean
one of three things:

* path reference
* module reference
* string literal

Bazel has different types: label and string attributes. Thus there needs
to be a way to categorize them correctly in bp2build.

This CL introduces a new function to be used on properties like
apex_key.private_key / apex_key.public_key, as well as
android_app.certificate / apex.certificate.

It is important to disambiguate the prop betenn a string literal
attribute or file/rule target label attribute, so this functions does
just that.  The new attributes are then further handled by their
respective macros (apex_key, android_binary, apex).

Bug: 253557437
Fixes: 253557437
Test: presubmits, new tests

Change-Id: Id8111cdd60d3aabcae7d17fe9da84d0ee3966023
2022-10-20 14:57:37 +00:00
Cole Faust
135d987d7c Revert ^2 "Prevent unspecified values in soong_config_string_variable""
This reverts commit 38944c70c4.

Reason for revert: I believe we're ready for this now, but run build_test 1-4 on internal master for at least master and tm-dev-plus-aosp on go/abtd before submitting

Change-Id: Id3bcd9a46f3087cf2d34dece5294828ea9436788
2022-10-20 00:34:00 +00:00
Yu Liu
6c999eff9a Denylist libapexinfo and libapexinfo_tests.
Bug: 254476335
Test: None
Change-Id: I7cb62bf5aaba0632d9c7e652cb3b23a5a5e35013
2022-10-19 16:41:10 +00:00
MarkDacek
b78465de1d Add bazel staging mode to soong build.
This is to use bazel to build targets that are being prepared for an
incipient release to the prod mode allowlist.

Bug: 254265047
Test: m nothing
Test: m nothing --bazel-mode-dev
Test: m nothing --bazel-mode-staging
Change-Id: Ic78a59cf51dba83ef1ac26483586560ea9b24aaf
2022-10-19 15:57:18 +00:00
Treehugger Robot
2fe9d75bef Merge "Added module_name to license metadata" 2022-10-14 15:32:25 +00:00
Mark Dacek
4f5a1fe123 Merge "Add recursive deny to allowlists." 2022-10-13 22:55:54 +00:00
Alexander Smundak
c34d91436a Merge "Add CcUnstrippedInfo provider and use it in mixed builds" 2022-10-13 21:04:40 +00:00
Ibrahim Kanouche
49920784db Added module_name to license metadata
Test: m droid dist

Change-Id: Idfe01da3c41adc1354112cc4b44e035feca61a7b
2022-10-13 13:52:56 -07:00
MarkDacek
756b2966b8 Add recursive deny to allowlists.
Also change behavior of the recursive check - the more specific
directory will be chosen now, for competing recursives.

This is part of an effort to enable mixed_libc and mixed_droid on
internal master - many denies are required and this would simplify the
effort.
Test: m nothing

Change-Id: I7de05337644d8e1804078c66669dd0b2d65f3e71
2022-10-13 20:40:27 +00:00
Wei Li
f18404f331 Merge "Fix some issues in bp2build converter for python_binary_host." 2022-10-13 03:35:38 +00:00
Wei Li
7d8f6182f9 Fix some issues in bp2build converter for python_binary_host.
1) Bp2build convert python_binary_host main attribute as LabelAttribute. Currently "main" attribute in python_binary_host is handled as string but for some modules (e.g certify_bootimg) the "main" attribute points to a file in its subpackage like "subpackage/file.py" and should be converted to "//.../subpackage:file.py".

2) Filter out duplicated labels in the merged list of "required" attributes of python_binary_host and its defaults.

Test: b build //system/tools/mkbootimg:certify_bootimg
Test: b build //build/make/tools/releasetools:check_target_files_signatures
Bug: 253081249
Bug: 253101186

Change-Id: Ic2cb4cadec2c1348da70af9f0730da9914d3a8ca
2022-10-12 17:43:20 -07:00
Sasha Smundak
edd16668c6 Add CcUnstrippedInfo provider and use it in mixed builds
The build uses unstripped binary/shared library to extract function
signatures, so for each each target of this kind Bazel should return
its unstripped version, too.

Fixes: 220164721
Test: treehugger

Change-Id: Id5f6143340519bf2ae98791a9e981d1306bb08d1
2022-10-12 17:36:47 -07:00
MarkDacek
0d5bca51b6 Add bazel paths to ninja deps.
Test: m nothing
Test: m nothing --bazel-mode-dev
Change-Id: I120e62ac3f2aa066aedaecf2a5d16c79f7097c76
2022-10-12 16:30:20 +00:00
Jingwen Chen
a71b4ca7a1 Merge "Blanket disallow bp2build_available: true." 2022-10-11 00:36:44 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
49b59385da Merge "Support cc_prebuilt_binary building with Bazel" 2022-10-10 21:37:35 +00:00
Spandan Das
40fb2e202a Merge "Converters for contributions to systemapi and vendorapi" 2022-10-10 21:33:21 +00:00
Jingwen Chen
1735b2e096 Blanket disallow bp2build_available: true.
This can be updated to use an allowlist again if the need arises.

Bug: 251197532
Test: presubmits
Change-Id: If56c45d8587a41b57358f249d20eb9a6ed9191ac
2022-10-10 14:31:53 +00:00
Jingwen Chen
17e0b7607a Merge "bp2build: disallow bp2build_available definition with neverallow." 2022-10-10 13:38:03 +00:00
Spandan Das
4238c65a17 Converters for contributions to systemapi and vendorapi
The module types in scope of this conversion are
1. cc_library and cc_library_shared (non-null llndk or stubs prop)
2. cc_library_headers (all)

For (2), we need some postprocessing on the results of the parser
bp2BuildParseBaseProps. This is necessary because arch and os specific
API exports need to be flattened and added to the generateed API headers
target along NoConfigAxis
e.g.
```
The api equivalent of
cc_library_headers (
  name = "lifoo",
  deps = select({
  	"//build/bazel/platforms/arch:arm": ["arm_deps"],
  	"//build/bazel/platforms/arch:arm64": ["arm64_deps"],
	}),
)
should be
cc_api_library_headers (
  name = "lifoo",
  deps = ["arm_deps", "arm64_deps"],
)
```

For (1), we also need to generate 1:many header api targets so that
arch-specific deps can propagate arch metadata to the top-level
api_domain rule

Test: go test ./bp2build
Test: go test ./cc

Change-Id: Ie40cba1ac8e89f290b3d926c190d5e93abd52859
2022-10-07 23:48:00 +00:00
Yu Liu
f1e6126cb0 Merge "Add libprofile-clang-extras when coverage is enabled." 2022-10-07 17:46:10 +00:00
Jingwen Chen
a4b7eed0bd bp2build: disallow bp2build_available definition with neverallow.
..other than the specified directories.

Test: CI

Bug: 251197532
Fixes: 251197532
Change-Id: Iec6407c915d2554bbfb62aea4591783208c4f633
2022-10-07 09:54:16 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
b12ff59f0b Support cc_prebuilt_binary building with Bazel
Bp2build-enable cc_prebuilt_binary -> cc_prebuilt_binary

Bug: 241415823
Test: cc_prebuilt_binary_conversion_test.go
Change-Id: I007deef8d44f68993012f2114314d1cb52cfbb0e
2022-10-06 19:39:09 +00:00