Commit Graph

5393 Commits

Author SHA1 Message Date
Paul Duffin
381bd33c04 Merge "Fix build break caused by registering genrules twice" am: 6d3e726887 am: bbb10d2452 am: 6ce4598e3c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1621418

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8970e441a817db83cbf64623954e51c814cf4ada
2021-03-06 11:53:35 +00:00
Paul Duffin
cdcd2be1ff Fix build break caused by registering genrules twice
Two separate changes that passed presubmits separately and did not
conflict when merged together unfortunately clashed at runtime. The
changes are:
* Ic00c7e480dc738d7a88d038aca6ab95a1502a24a
* Ic98fdc29a63155174a3227e7e918b26f0a8763bb

Test: m nothing
Change-Id: I7b5704c22cc2ea2095f5fb92c59f0526bb445f13
2021-03-06 10:03:22 +00:00
Paul Duffin
8d74783b41 Merge "Clean up cc.RegisterRequiredBuildComponentsForTest()" am: 0805d4ebdd am: b6ae322278 am: 1f50ff0df6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1621414

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I22877e0de75fbb1f4899fad3081418acf3b6df74
2021-03-06 09:56:58 +00:00
Paul Duffin
1c58ce4a52 Merge "Fix mutator ordering issue in apex tests" am: 97c8128eea am: d8033e1d26 am: e672daac6b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1621415

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifa3b28737bcf55fb5ccda37e3e4dec4973cf8e34
2021-03-06 09:56:43 +00:00
Paul Duffin
0805d4ebdd Merge "Clean up cc.RegisterRequiredBuildComponentsForTest()" 2021-03-06 08:43:56 +00:00
Paul Duffin
6d119b804c Fix mutator ordering issue in apex tests
Previously, the override mutators were being run before the prebuilt
mutators that did not match the runtime behavior. This change fixes
that ordering.

In the process it broke TestApexWithAppImportsPrefer. That test tries
to verify that an apex that depends on an android_app will use an
android_app_import if that is preferred. Unfortunately, it only worked
because of the incorrect order of the mutators.

The test worked before this change because the prebuilt mutators were
being run after the overridableModuleDepsMutator. That meant that any
dependencies added by that mutator onto source modules could be
replaced by the PrebuiltPostDepsMutator with the preferred prebuilt
module.

Switching the order to match the runtime meant that the prebuilt
mutators were run before the overrides so never had a chance to replace
the dependencies added by the overrides.

Bug: 181953909
Bug: 181974714
Test: m nothing
Change-Id: Ic98fdc29a63155174a3227e7e918b26f0a8763bb
2021-03-05 18:38:58 +00:00
Paul Duffin
d6ceb8600c Clean up cc.RegisterRequiredBuildComponentsForTest()
Changes this function so it only registers components from the cc
package by pushing the call to genrule.RegisterGenruleBuildComponents()
down into those packages whose tests need it.

This will make it easier to migrate cc package tests to test fixtures
as the RegisterRequiredBuildComponentsForTest() no longer overlaps with
preparers from the genrule packages.

Bug: 181070625
Test: m nothing
Change-Id: Ic00c7e480dc738d7a88d038aca6ab95a1502a24a
2021-03-05 18:20:33 +00:00
Treehugger Robot
5921172be1 Merge "Remove Abseil checks from clang-tidy defaults." am: 636d152e08 am: 93a58aaf37 am: d39700c648
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1612584

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idedbaae3e0b5b4777503107de5950b17784239a2
2021-03-03 00:23:58 +00:00
Christopher Parsons
3bc0783320 Merge "Support cc_object modules in mixed builds" am: bc39e17a1d am: 218cf3dec6 am: cd4dcdda18
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1599675

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2609ec4b223d49d5312bb44ae05b01eefe38a023
2021-03-03 00:23:46 +00:00
Paul Duffin
0b0921a808 Merge "Remove deapexer and prebuilt apex select mutators" am: 4b786d2da1 am: 0630dacc0c am: 9d697b3d94
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610795

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4670d011f304c943cc6156312b0154e9236ca08f
2021-03-03 00:23:03 +00:00
Treehugger Robot
636d152e08 Merge "Remove Abseil checks from clang-tidy defaults." 2021-03-02 20:22:14 +00:00
Christopher Parsons
bc39e17a1d Merge "Support cc_object modules in mixed builds" 2021-03-02 16:44:56 +00:00
Paul Duffin
4b786d2da1 Merge "Remove deapexer and prebuilt apex select mutators" 2021-03-02 10:48:29 +00:00
Treehugger Robot
b8b4d74d37 Merge "APEX uses the latest version of the stub" am: ce80f18749 am: 3310e2d9ea am: 803eece603
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609533

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic9355035dd83782c478a12fb16a5896c50968a58
2021-03-02 03:10:43 +00:00
Treehugger Robot
ce80f18749 Merge "APEX uses the latest version of the stub" 2021-03-02 01:02:18 +00:00
Chris Parsons
8d6e433c1e Support cc_object modules in mixed builds
Test: With a handwritten conversion of crtbegin_so1, USE_BAZEL_ANALYSIS=1 m crtbegin_so1
Change-Id: I7c777d7f46b37aa1827cc04205e2014f9293bf35
2021-03-01 18:22:34 -05:00
Krzysztof Kosiński
a3014f1c13 Remove Abseil checks from clang-tidy defaults.
Abseil is not available in Android, so these checks are not
actionable.

Test: Compiled frameworks/av, no more spurious warnings.
Change-Id: Ic573a3234a99b0fa1f63449e8d020a17a43a134c
2021-03-01 13:25:03 -08:00
Paul Duffin
c04fb9e6a2 Remove deapexer and prebuilt apex select mutators
Originally, when the prebuilt_apex was first created, it selected the
source to use in its DepsMutator. It did that because that was a
convenient place for it to perform that work which had to be:
* After the arch mutator had run so MultiTargets() was available.
* Before the prebuilt_select mutator runs as that relied on the Source
  property to have been set.

Change 064b70c9 then duplicated the call from the DepsMutator of the
deapexer module type that was added as part of the work to make dex
files available for hiddenapi processing.

Change 356f7d45 moved it out of the the DepsMutator methods into its
their own mutators, presumably because it interfered with the
Soong -> Bazel conversion work.

This change improves the existing PrebuiltSrcsSupplier mechanism to
support reporting errors so that the logic for selecting the source can
be done on demand rather than in separate mutators.

The main complication was that PrebuiltSrcsSupplier is called with a
BaseModuleContext for both source and prebuilt modules so it cannot use
any methods on it that are related to the current module. That
necessitated adding MultiTargets() to android.Module.

Bug: 181267622
Test: m droid
Change-Id: I106c78fd21016f051a315b82b470d8f12b1f820b
2021-03-01 17:11:25 +00:00
Jingwen Chen
713cff84de Merge "bp2build: add configurable attribute (select) support." am: 37bd24a1db am: 1c65191027 am: f28de7434b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1603778

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iafe936decfc711746a17c4a6348c141654b60fc0
2021-03-01 16:05:08 +00:00
Jingwen Chen
37bd24a1db Merge "bp2build: add configurable attribute (select) support." 2021-03-01 13:43:55 +00:00
Jiyong Park
55549df051 APEX uses the latest version of the stub
Previously when an APEX whose min_sdk_version is set is linked to an
external library providing multiple versions of stubs, the
maximum version that is less than or equal to the min_sdk_version was
chosen. For example, if the versions of a library stubs are 28, 29, 30,
and 31, then APEX with min_sdk_version: 29 linked to the version 29 of
the stub.

This was to ensure that the APEX doesn't use any new APIs whose
existence can't be guaranteed.

This however imposes a severe restriction that the APEX can never use
new APIs even when the APIs are actually available: i.e. when the
APEX is running on a newer platform.

With the recent work about unguarded availability, using the future APIs
became much safer. When you use an API that is newer than your
min_sdk_version, the API is automatically declared as a weak symbol
(thus no link error at runtime), while the call to API is guaranteed to
be guarded with the `__builtin_available(...)` macro.

So, there really is no reason to use the old version of the stub. We can
always use the latest version of stub safely.

Bug: N/A
Test: m
Change-Id: Iaac0d8761d8929154527dc2e861a51ae31e23d49
2021-03-01 09:12:32 +00:00
Chih-hung Hsieh
1627347d0b Merge "Forbit extra quotes in tidy flag lists" am: 7e52be849e am: 7b68407ec9 am: e0e2b40599
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1600697

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3ca5feb72e08337db7824fb4333b15dc48723586
2021-03-01 08:57:02 +00:00
Chih-hung Hsieh
7e52be849e Merge "Forbit extra quotes in tidy flag lists" 2021-02-27 08:45:47 +00:00
Justin Yun
163722ae1d Define getSnapshotNameSuffix() am: 07b9f86f0c am: 1ddff5f76f am: 0a6226c014
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1607900

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I607959e437b8e3bb4b082a6cdb42a358d1c7701d
2021-02-26 11:13:51 +00:00
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
4f03289e44 Merge "Remove dependency from vendor_snapshot to each module" am: a777d960ab am: 4f8fa43b99 am: 9fe8c1f482
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1607913

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibd968597d2fee537c97f83d2b5996cf9a597e210
2021-02-26 06:07:34 +00:00
Justin Yun
07b9f86f0c Define getSnapshotNameSuffix()
By sharing a single function for generating snapshot name suffix,
make sure both the DepsMutator and the snapshot modules use the same
names.

Bug: 179666286
Test: m nothing
Change-Id: I9efa94f2981a6bd1b4128bf0e84ca44873ebf3b7
2021-02-26 14:00:03 +09:00
Chih-Hung Hsieh
217e09a784 Forbit extra quotes in tidy flag lists
* Start with clang-tidy flags;
  maybe other flags should be checked too.

Bug: 180862582
Test: make
Change-Id: I82f86a911733693a14fe56a35e28590b065e3ae7
2021-02-25 20:46:15 -08:00
Treehugger Robot
a777d960ab Merge "Remove dependency from vendor_snapshot to each module" 2021-02-26 03:57:42 +00:00
Jingwen Chen
b4adee5361 Merge "bp2build: add support for cc_object's objs and exclude_srcs properties." am: 1251bb5775 am: c1858d0f50 am: eb4d958cf6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1600655

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iba2011c8231a68086ff9faabc76794362300083f
2021-02-25 16:36:12 +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
Justin Yun
4813867ec3 Remove dependency from vendor_snapshot to each module
The 'vendor_snapshot' module is required to every cc_library to check
if the dependencies need to be rewritten to the snapshot modules or
not. However, as the 'vendor_snapshot' module has dependencies to the
snapshot modules, the dependency to the 'vendor_snapshot' module
creates circular dependencies.
The dependency from the 'vendor_snapshot' to the snapshot modules is
required only to read the module names of the snapshot modules. We
may remove the dependency by setting the name of the snapshot modules
directly.

Bug: 179666286
Test: m nothing
Change-Id: I14abcb06c5c81ef7f8535103578747385c89ae0f
2021-02-25 09:31:12 +00:00
Stephen Hines
6e55d59b00 Merge "reverses common and external Clang flags" am: f3e0d22234 am: 4ad07ba7a3 am: 2a934fba72
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1606997

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifc4e0c7cd537b135bf52af2d86161e65baf8cc32
2021-02-25 08:49:47 +00: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
Paul Duffin
5951b78bbc Merge "Generated headers may not be arch specific" am: b2773e116f am: 94dad2bdb4 am: 8da901ceae
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1599159

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1a5b6b034b8e5920e51f4eb5c4971c4db01ecf31
2021-02-24 12:02:57 +00:00
Paul Duffin
baf573a087 Merge "Fix the snapshot handling of generated headers" am: efa0f00706 am: 7c7d2fc156 am: 3b2020b8a3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1599158

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icdd6da97232c36e26f0a1baefd0831cdb2aaae6e
2021-02-24 12:02:47 +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
Treehugger Robot
17d3ac9aa1 Merge "Move bazel.Properties to a BazelModuleBase" am: bbfd5ab606 am: 035b6e6882 am: 75f8de41e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1591532

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I137929cc5eb3e20f563f7b184bf088bca913e410
2021-02-24 07:38:44 +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
Treehugger Robot
3b148cbc0e Merge "Refactor BazelTargetModule" am: 30899caf1f am: be2383b27d am: 501085ce55
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1596752

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0fdb016f6fa9ef9c54496feaebe0934f885c405d
2021-02-24 02:20:17 +00:00
Paul Duffin
73a7d9be76 Merge "Only export sysprop headers in exported sysprop include directory" am: 1dd5764a4e am: e2db082638 am: 28a690d283
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1596831

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I06da8ac9ac32f5a16eedc0245ec94bb45dad5d96
2021-02-24 02:17:19 +00:00
Treehugger Robot
c0c4c82580 Merge "Export aidl, proto and sysprop generated headers separately" am: 2b22365c8c am: d9a7dc9b57 am: bda7188220
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1595276

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2bcc6f82743fdcdba78835c3d893dadc01ec3db7
2021-02-24 02:16:42 +00:00
Treehugger Robot
30899caf1f Merge "Refactor BazelTargetModule" 2021-02-23 20:40:23 +00: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
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
c9ed7c652a Merge "Add tests for exported generated headers" am: bc179bc44f am: d24432aaf0 am: 16a1b25774
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1595275

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I13b1df790dde3540473b339110e448b69507b8e6
2021-02-23 01:09:27 +00:00