Commit graph

32856 commits

Author SHA1 Message Date
Jingwen Chen
5d8644990b bp2build: add configurable attribute (select) support.
This CL adds a basic framework to support configurable string_list
attributes, selecting on the Arch variant (x86, x86_64, arm, arm64).

It offers fine-grained controls to map individual configurable
properties (arch_variant) to configurable Bazel attributes, starting
with the string_list type for the copts property for cc_object.

This design is primarily motivated to have minimal boilerplate in
bp2build mutators, allowing anyone to opt-in configurable attributes,
and modify intermediate states before passing them on into the
CreateBazelTargetModule instantiator.

Fixes: 178130668

Test: go tests
Test: build/bazel/scripts/milestone-2/demo.sh

Change-Id: Id6f04d7c560312a93e193d7ca4e1b7ceb6062260
2021-02-26 05:17:54 -05:00
Treehugger Robot
8e79268947 Merge "rust: Disable Byte Grouping Linter" 2021-02-25 22:46:02 +00:00
Ivan Lozano
b6d0d9cec4 rust: Disable Byte Grouping Linter
Disable the byte grouping clippy lint by default. In some cases it makes
sense to group bytes in a protocol-specific fashion, so let's not error
on this lint.

Bug: 181171365
Test: Clippy allows this lint.
Change-Id: I2705dc7fa901b997bcb01f1256d48e85ce35065c
2021-02-25 11:24:35 -05:00
Jaewoong Jung
fc3bfe54c3 Merge "Fix the releax_check flag format verb." 2021-02-25 16:00:12 +00:00
Jaewoong Jung
daffef2400 Merge "Remove ModuleBase.prefer32." 2021-02-25 15:39:52 +00:00
Jingwen Chen
1251bb5775 Merge "bp2build: add support for cc_object's objs and exclude_srcs properties." 2021-02-25 14:09:08 +00:00
Stephen Hines
f3e0d22234 Merge "reverses common and external Clang flags" 2021-02-25 06:31:22 +00:00
Jaewoong Jung
8431282af4 Fix the releax_check flag format verb.
%b prints base 2 numbers. %t is the right one to use for booleans.

Test: TreeHugger
Change-Id: Ifbae0170ba03583182ae848bcfc6bb104f1be7e0
2021-02-24 21:09:10 -08:00
Jingwen Chen
805c74ca09 Merge "queryview: add "size" to ignored prop." 2021-02-25 05:08:56 +00:00
Jaewoong Jung
003d808a41 Remove ModuleBase.prefer32.
It became obsolte by If96cccbd82ba1311165d61c947c928c6e7cd5593 and
Iaaac16ae171c06d90d04d7cac11789d3f39b8d99

Test: TreeHugger
Change-Id: Ifc8f28663b480ef5aff93a54040339ef080072c9
2021-02-24 20:29:25 -08:00
Christopher Di Bella
c28f5d97a6 reverses common and external Clang flags
Flags for external projects are specialisations of the common flags, and
need to follow the common flags, not precede them.

Bug: 181177782
Test: None

Change-Id: I19c8c2a3539573e9b2f2d9e3e1c898fa09570663
2021-02-25 01:34:08 +00:00
Jingwen Chen
88ae408a0f queryview: add "size" to ignored prop.
Test: m queryview && bazel query //... --config=queryview
Change-Id: Ia84be6e2fc5b302b4a147f94bfa219a729b67be1
2021-02-24 19:55:50 -05:00
Paul Duffin
ebbf33c42b Merge "Allow pre-singleton types to be registered in RegistrationContext" 2021-02-24 18:38:27 +00:00
Lorenzo Colitti
9023138b5e Merge "Add the new NetworkStack shim libraries to APEX allowed deps." 2021-02-24 16:01:08 +00:00
Paul Duffin
eafc16bf14 Allow pre-singleton types to be registered in RegistrationContext
Bug: 181070625
Test: m droid
Change-Id: I708b78ed0b42ec55b0442307f40531cfe1233c2b
2021-02-24 10:17:19 +00:00
Paul Duffin
b2773e116f Merge "Generated headers may not be arch specific" 2021-02-24 10:10:23 +00:00
Paul Duffin
efa0f00706 Merge "Fix the snapshot handling of generated headers" 2021-02-24 10:08:34 +00:00
Jiyong Park
c1e48ac7d8 Merge "Add logical_partition module type" 2021-02-24 09:17:28 +00:00
Christoffer Quist Adamsen
a72571f0d1 Merge "Allow missing classes in R8 builds" 2021-02-24 07:25:18 +00:00
Jingwen Chen
db12024524 bp2build: add support for cc_object's objs and exclude_srcs properties.
objs contains module references to other cc_objects that will be used
for linking later. This maps to cc_library deps.

Also support exclude_srcs, and added tests.

Test: bp2build generate, sync, bazel build //bionic/...

Change-Id: I21200ff73f24bcf5357d9df8dcb5519cde532a77
2021-02-24 01:08:57 -05:00
Treehugger Robot
bbfd5ab606 Merge "Move bazel.Properties to a BazelModuleBase" 2021-02-24 05:53:25 +00:00
Jiyong Park
b89e5e71b7 Add logical_partition module type
logical_partition builds a partition image (which is usually called
'super.img') out of one or more filesystem images.

Bug: 180921702
Test: m microdroid_super
Change-Id: I659607647e3a5bc82c82b576a049e6c6f91cbddb
2021-02-24 12:53:39 +09:00
Treehugger Robot
7ebe464748 Merge "Build statsd-module-sdk-for-art" 2021-02-24 01:08:28 +00:00
Treehugger Robot
4dc0702ce2 Merge "android:path attribute is respected for fields in a slice of struct" 2021-02-24 00:54:56 +00:00
David Srbecky
bb96b56b0d Merge "Set block-size for XZ mini-debug-info compression." 2021-02-24 00:43:12 +00:00
Eric Holk
ff0529d209 Build statsd-module-sdk-for-art
Bug: 178236337
Test: build-mainline-modules.sh
Change-Id: I51dab13416be8ea1cd65234d560d84ca89b53e13
2021-02-23 22:49:57 +00:00
Treehugger Robot
9a4279309f Merge "Update soong copy of java binaries when Make copy is installed" 2021-02-23 21:35:20 +00:00
Treehugger Robot
7eacdbf8a6 Merge "Add non-fatal mode for verify_uses_libraries check." 2021-02-23 20:45:42 +00:00
Treehugger Robot
30899caf1f Merge "Refactor BazelTargetModule" 2021-02-23 20:40:23 +00:00
Colin Cross
44b85d01c9 Update soong copy of java binaries when Make copy is installed
m <modulename> is handled by Make and installs the Make copy of a host
java binary in out/host/linux-x86/bin, and doesn't depend on the Soong
copy in out/soong/host/linux-x86/bin.  That can leave a stale binary
in the Soong directory, and since the Soong directory is first in the
path set up by envsetup.sh, can result in confusing behavior to end
users.

cc_binary already has the Make binary depend on the Soong binary
so that they are both updated.  Do the same for java_binary.

Fixes: 180405155
Test: m metalava
Change-Id: Ic84a131a2851cc4a18ce3725da3c4067137d6120
2021-02-23 11:19:57 -08:00
Jiyong Park
66dd5c09e2 android:path attribute is respected for fields in a slice of struct
This change fixes a bug that android:path attribute is ignored when
annotated field is in a slice of struct.

blueprint now traverses fields whose type is slice of struct and
provides the index list in the case. Soong is modified so that it checks
whether the field being referenced is a slice of struct or not. If that
is the case, it gathers field values from each of the elements. If not,
it follows the original path.

Bug: 181018147
Test: m nothing
Change-Id: I220efb6feaa525a00939654459b2998e98e7ad56
2021-02-24 01:22:57 +09:00
Liz Kammer
ea6666fba9 Move bazel.Properties to a BazelModuleBase
This allows more direct access to the bazel label and whether the module
is bp2build available.

Test: go test *
Change-Id: I23375835d20fa53d7d94127b2dc2d5bb20487bfb
2021-02-23 10:58:57 -05:00
Paul Duffin
d98f5b27e1 Merge "Differentiate usages of word "include" in cc_sdk_test.go" 2021-02-23 15:29:47 +00:00
Paul Duffin
8e46253840 Merge "Add sdk test for incorrect handling of generated headers" 2021-02-23 15:29:39 +00:00
Paul Duffin
d884c993dd Merge "Separate versioned/unversioned testing in sdk/cc_sdk_test.go" 2021-02-23 15:29:29 +00:00
Paul Duffin
036e84a767 Merge "Support testing versioned/unversioned sdk Android.bp files separately" 2021-02-23 15:29:20 +00:00
Paul Duffin
1dd5764a4e Merge "Only export sysprop headers in exported sysprop include directory" 2021-02-23 15:28:26 +00:00
Treehugger Robot
2b22365c8c Merge "Export aidl, proto and sysprop generated headers separately" 2021-02-23 14:11:24 +00:00
Liz Kammer
fc46bc1ee4 Refactor BazelTargetModule
This eliminates the need to remove quotes, delete attributes, and
re-checking that name has correct prefix. Additionally, this allows
assignment directly to the BazelTargetModuleProperties struct, which
allows defaulting unused fields and clarity of which field is being set.

Test: go test soong tests
Test: ran ./build/bazel/scripts/milestone-2/demo.sh
Change-Id: Ia9bfcce76234c793a4ddd5f29a661150f83341c9
2021-02-23 08:29:40 -05:00
Paul Duffin
ece454400d Merge changes from topic "hiddenapi_additional_annotations"
* changes:
  Sort hiddenapi monolithic files by signature
  Remove duplicates in monolithic hidden API files
  Remove implicit dependency from <x> -> <x>-hiddenapi
2021-02-23 12:48:24 +00:00
Jeffrey Vander Stoep
22af74eafd Merge "Setup ANDROID_RUST_VERSION env variable" 2021-02-23 10:10:06 +00:00
Treehugger Robot
f0f152484b Merge "Fix infinite recursion when printing unrecognized linktype" 2021-02-23 04:24:14 +00:00
Jiyong Park
d4cbf34032 Fix infinite recursion when printing unrecognized linktype
Bug: N/A
Test: remove some cases from String() so that some linktypes go to the
default path. Then run m nothing. No infinite recursion. Error is
correctly shown.
PANIC=String method: unrecognized linktype: 5
Change-Id: I424755bc89871fc2144ff22d6391f57157cd434d

Change-Id: Ice791025dc50f44ffabd1050bafc5ea35023d32c
2021-02-23 04:02:23 +00:00
Jingwen Chen
0d2497088c Merge "bp2build: Unexport GenerateBazelTargetsForDir." 2021-02-23 03:07:00 +00:00
Treehugger Robot
05785f0023 Merge "bootimg supports building (non-vendor) boot.img" 2021-02-22 23:53:15 +00:00
Treehugger Robot
277303f042 Merge "Add ctx to AndroidMkExtraEntriesFunc" 2021-02-22 22:40:31 +00:00
Treehugger Robot
a61a042fa6 Merge "Limit the number of the Java source files in a single compilation unit" 2021-02-22 19:54:00 +00:00
Paul Duffin
7a7d067c74 Generated headers may not be arch specific
Previously, it was assumed that generated headers must be arch specific
and so prevented the fields referencing the paths to those headers from
being automatically optimized by the sdk generation code. That is not
always the case, e.g. with headers generated from protos so this change
allows those fields to be optimized.

Bug: 180427921
Test: m nothing
Change-Id: Id2af419d58ae3c30ea6d9e87f71e33a9ff6ba13b
2021-02-22 18:23:22 +00:00
Paul Duffin
42dd4e6cd6 Fix the snapshot handling of generated headers
Previously, the snapshot handling code did not preserve the directory
structure of generated include directories and instead just copied the
headers into the same module specific directory and added that single
directory to the export_include_dirs (or similar) property.

That had a couple of issues:
* The include directory was repeated in the ..._include_dirs property.
* It did not work when the include directories overlapped.

In the latter case it had a couple of issues:
* Code which compiled fine against the source would not compile against
  the prebuilt.
* Header files were duplicated in the output.

e.g. assume the following generated header file structure:
  foo/
      foo.h
  bar/
      bar.h
      baz/
          baz.h

When the sdk snapshot was passed include directories of "foo", "bar" and
headers of "foo/foo.h", "bar/bar.h", "bar/baz/baz.h" it would generate a
snapshot with the structure:
  include_gen/
      foo.h
      bar.h
      baz/
         baz.h

And:
  export_include_dirs: ["include_gen", "include_gen"]

However, when the include directories overlapped and include directories
of "foo", "bar" and "bar/baz" were passed in the directory structure
would be the same and the export_include_dirs would contain 3 usages of
"include_gen".

That meant that source code which used the following would build
against the source (because it would find "baz.h" in the "bar/baz"
include directory) but would fail when built against the prebuilts
because the "include_gen" directory did not contain "baz.h":
    #include "baz.h"

This change preserves the input directory structure for generated files
in a similar way to how it does it for source files. So, the snapshot
structure looks something like this:

  include_gen/
      foo/
          foo.h
      bar/
          bar.h
          baz/
              baz.h

And:
  export_include_dirs: [
    "include_gen/foo",
    "include_gen/bar",
    "include_gen/bar/baz",
  ],

Bug: 180427921
Test: m nothing
Change-Id: Id69eef8cf5eecd033841d3b7cd0c044a697ce404
2021-02-22 18:23:22 +00:00
Paul Duffin
86b02a7962 Differentiate usages of word "include" in cc_sdk_test.go
A number of tests in cc_sdk_test.go use "include" for the input include
directory which results in the output containing "include/include"
(because the snapshot code uses "include" as the directory into which
native headers will be output). This change switches the inputs from
"include.." to "myinclude.." to differentiate between the two sources.

Bug: 180427921
Test: m nothing

Change-Id: Iba1e6d94647c74b31307b18254c03580e64c91cf
2021-02-22 18:23:22 +00:00