Commit Graph

34372 Commits

Author SHA1 Message Date
Jingwen Chen 37bd24a1db Merge "bp2build: add configurable attribute (select) support." 2021-03-01 13:43:55 +00:00
Paul Duffin f6932afeae Add test to verify the deapexer rule's input apex file
This will ensure that the following refactoring does not change the
behavior.

Bug: 181267622
Test: m nothing
Change-Id: I36ae9ec9a0a7977bd394f4100c72941052d763ac
2021-03-01 13:40:06 +00:00
Paul Duffin ec0fe1775b Avoid hiddenapi ignoring prebuilt with missing dex implementation jar
Previously, when a prebuilt was preferred but did not provide a
suitable boot dex jar both the source and the prebuilt were silently
ignored which meant that the "hiddenapi list" command was not given a
complete set of boot dex jars. That could either lead to incorrect
hiddenapi flags being set or the "hiddenapi list" command failing if it
could not find a class. Debugging the cause of either of those cases
can be very time consuming so this change fails early and makes the
cause very explicit.

Bug: 181267622
Test: m nothing
Change-Id: I6763ddb9ba90ed2e501d0cf7984f6655237e905d
2021-03-01 12:58:28 +00:00
Paul Duffin 3785673f9b Allow java_sdk_library_import to contribute to hiddenapi processing
Invokes hiddenAPIExtractInformation() on the java_sdk_library_import's
dex implementation jar provided by the deapexer (on behalf of
prebuilt_apex) so that hiddenAPI can extract the information it needs,
if anything, from the dex file.

The dex file provided by deapexer has already had the hiddenapi
information encoded into it so it does not need to do that again.

Usually, it would require a classes implementation jar as well in
order to extract information from UnsupportedAppUsage annotations but
that is not available for a java_sdk_library_import. Fortunately, the
modules that are currently affected by this do not contain any such
annotations. This just uses a public api stubs jar instead.

Bug: 181267622
Test: m nothing
Change-Id: I96275e46f8b7fecba88075319e9f2da5ae315c03
2021-03-01 12:58:28 +00:00
Paul Duffin 3985351df6 Retrieve dex implementation jars from apex for java_sdk_library_import
Bug: 181267622
Test: m nothing
Change-Id: Idd6af2482f48bd3a05db88b8a06dbbbdee01ef78
2021-03-01 12:58:28 +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
Treehugger Robot 184957859b Merge "Remove global state from sysprop libraries" am: 5e510d6271
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1611293

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1fca3c2ce55e93086372c6c69b0704fa253175a1
2021-03-01 08:45:05 +00:00
Treehugger Robot 5e510d6271 Merge "Remove global state from sysprop libraries" 2021-03-01 08:03:41 +00:00
Treehugger Robot f6316c4b1c Merge "Propagate java resources in apps with no code" am: 2ee47272f5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610973

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9a2dc3f9b861898eb7ed91d13c1443af2a0d2569
2021-02-28 01:20:09 +00:00
Treehugger Robot 2ee47272f5 Merge "Propagate java resources in apps with no code" 2021-02-28 00:31:28 +00:00
Paul Duffin dbad3660c2 Merge "Add test fixture support" am: e8d9a33769
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1605035

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8b6df4095c1683238c002838203e85605e1a692d
2021-02-27 11:00:05 +00:00
Paul Duffin e8d9a33769 Merge "Add test fixture support" 2021-02-27 10:33:24 +00:00
Chih-hung Hsieh 7b68407ec9 Merge "Forbit extra quotes in tidy flag lists" am: 7e52be849e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1600697

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I85f11d48b9c6a026d4c767923516d74493a241d0
2021-02-27 09:11:57 +00:00
Chih-hung Hsieh 7e52be849e Merge "Forbit extra quotes in tidy flag lists" 2021-02-27 08:45:47 +00:00
Colin Cross 75ce9eccf3 Remove global state from sysprop libraries
Sysprop libraries use a global list to rewrite dependencies from
implementation libraries to public stub libraries when appropriate.
Remove the global list, and instead add a dependency from the
implementation to the public stub that forwards the JavaInfo.

Bug: 181367697
Test: sysprop_test.go
Change-Id: Ia7995feb3c079ca9bb6a403daaae3e3329fd7f6a
2021-02-26 16:28:12 -08:00
Colin Cross b014f0787e Propagate java resources in apps with no code
Use the java resources jar as the dex jar when building apps that
have no code.

Also remove maybeStrippedDexJar, the dex jar is never stripped now.

Fixes: 176305357
Test: TestAppJavaResources
Change-Id: Ic8b1165bd35d71237d307e7f5f895764e203a10d
2021-02-26 16:28:12 -08:00
Paul Duffin 358161232c Add test fixture support
Adds the test fixture support and converts a few tests to exercise the
code and show how it works.

Bug: 181070625
Test: m nothing
Change-Id: I0a2b40fff93b6041f9aa8c4ef0aba91da1bc8bf3
2021-02-26 23:01:50 +00:00
Treehugger Robot 200338e19c Merge "Make runtime_resource_overlay product specific." am: 5aa1debe6d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1608116

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I069f0301b507e82316401ff32c79db2477d81c5f
2021-02-26 18:51:59 +00:00
Treehugger Robot 5aa1debe6d Merge "Make runtime_resource_overlay product specific." 2021-02-26 17:31:27 +00:00
Ulya Trafimovich 861a896c96 Add `provides_uses_library` example to TestUsesLibrary check.
Current test behaviour is incorrect, because libraries added via
`uses_libs`/`optional_uses_libs` ignore `provides_uses_lib` property.
The added TODO entries point at the incorrect behaviour, to be fixed in
the follow-up CLs.

Bug: 132357300
Test: m nothing

Change-Id: I35bfe227797aa37aa539e872052335677c798ee5
2021-02-26 15:19:39 +00:00
Ulya Trafimovich 2eaf5c5256 Stricten TestUsesLibrary check.
- Verify argument order for manifest_fixer args verify_uses_libraries.
- Rewrite manifest_fixer test so that it reveals arguments that should
  not be there, add a TODO to remove them.

Bug: 132357300
Test: m nothing
Change-Id: I910e13b84f0464fc06b5b98395ddb45bf4120223
2021-02-26 14:53:06 +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
Thiébaud Weksteen 1ca121b029 Merge "Enable bloaty artifact for checkbuild" am: 30e3e9d21d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1605533

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4bf2c94ca5c210c90a1c4e701df855213f5d2817
2021-02-26 09:30:19 +00:00
Justin Yun 1ddff5f76f Define getSnapshotNameSuffix() am: 07b9f86f0c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1607900

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I22c746f17079e5e8659cdcb2b447116fb354ca37
2021-02-26 09:27:45 +00:00
Thiébaud Weksteen 30e3e9d21d Merge "Enable bloaty artifact for checkbuild" 2021-02-26 07:44:59 +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 4f8fa43b99 Merge "Remove dependency from vendor_snapshot to each module" am: a777d960ab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1607913

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I15a5244d60d1397fcaf471cabc1176eb122c7e47
2021-02-26 04:33:11 +00:00
Treehugger Robot a777d960ab Merge "Remove dependency from vendor_snapshot to each module" 2021-02-26 03:57:42 +00:00
Jaewoong Jung 3ef77e89f0 Make runtime_resource_overlay product specific.
When mk2bp'ing a runtime_resource_overlay module, make it product
specific by default so that it reflects how the current make
configuration works.

Bug: 155783598
Test: bpfix_test.go
Change-Id: Icafa8228fe65ecc5b33ad80ad721e7997fbff383
2021-02-25 18:58:16 -08:00
Treehugger Robot b6507b6ee7 Merge "rust: Disable Byte Grouping Linter" am: 8e79268947
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1608353

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4b09eb7c7a3db7b3f15cb7a8f6f07f8c785c19e1
2021-02-25 23:30:54 +00:00
Treehugger Robot 8e79268947 Merge "rust: Disable Byte Grouping Linter" 2021-02-25 22:46:02 +00:00
Julien Desprez 069b75077a Attempt to run all java_test_host that look unit tests
Currently includes some heuristic for the first round of
onboarding.

Test: presubmit
Bug: 180736967
Change-Id: I220551549ed3c1468390655cb911f3b8c0f8880d
2021-02-25 10:12:49 -08:00
Jaewoong Jung cfeffdc6ec Merge "Fix the releax_check flag format verb." am: fc3bfe54c3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1607177

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If62452c3652dcd84713b2e34258067852b4a063a
2021-02-25 16:33:55 +00:00
Jaewoong Jung c520303826 Merge "Remove ModuleBase.prefer32." am: daffef2400
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1606486

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibbc275d061ac6385322dae7062d0847a57f3bb38
2021-02-25 16:32:03 +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 c1858d0f50 Merge "bp2build: add support for cc_object's objs and exclude_srcs properties." am: 1251bb5775
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1600655

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia52b0cbf118d1e51c5496b7d816df13c53602129
2021-02-25 14:46:51 +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
Thiébaud Weksteen 5db3d98c3e Enable bloaty artifact for checkbuild
Test: m checkbuild dist; verify DIST_DIR/binary_sizes.pb
Bug: 172339742
Change-Id: If6f3b33a5d6efade98a15ddf5827ef010d1535dd
2021-02-25 10:02:49 +01:00
Stephen Hines 4ad07ba7a3 Merge "reverses common and external Clang flags" am: f3e0d22234
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1606997

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ice6aaad9c334a5ddff365e3a2181748347ab364b
2021-02-25 07:23:18 +00:00
Stephen Hines f3e0d22234 Merge "reverses common and external Clang flags" 2021-02-25 06:31:22 +00:00
Jingwen Chen 115ba56709 Merge "queryview: add "size" to ignored prop." am: 805c74ca09
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1607273

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id0354d9fe93725e35dd91ed45ff89642e2a20fe5
2021-02-25 05:31:57 +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