Commit graph

2749 commits

Author SHA1 Message Date
Spandan Das
a5f39a12de Spellcheck
This should fix a spelling error that crept in during a documentation CL

Test: N/A
Change-Id: I085f7fd1399f06e3b8808ed54963abce0e06f7fe
2022-08-05 02:36:36 +00:00
Treehugger Robot
0ea404eb36 Merge "Remove obsolete notice property." 2022-08-02 17:22:42 +00:00
Jingwen Chen
7810e17e54 Export default apex version from updatable_modules.go to Bazel's
apex_toolchain through soong_injection.

This is necessary to keep both Bazel and Soong in sync.

Test: presubmit
Bug: 238723069
Fixes: 238153998

Change-Id: Ibf4a8ed91d358dc7800c10e4112485a52f0606bb
2022-08-02 10:11:36 +00:00
Alexei Nicoara
7579b67ef9 Moving default version outside of apex package
The default version needs to be used by both apex and apk updatable
modules. Moving it to android package so it can be accessed without
circular dependencies.

Test: presubmit
Bug: 231691162

Change-Id: Icafd50d0b065e89a115ae9c9b6ea55adf2730b49
Merged-In: Icafd50d0b065e89a115ae9c9b6ea55adf2730b49
2022-08-01 16:28:48 +01:00
Treehugger Robot
88e7512572 Merge "Implement mixed builds for apex modules, take 2." 2022-07-29 22:43:19 +00:00
Bob Badour
0cc5facf79 Remove obsolete notice property.
Bug: 192434786

Test: m droid dist

Change-Id: I0f384ae895cebab9732448b82db600c67eb8f711
2022-07-29 17:54:40 +00:00
Sasha Smundak
fe9a5b833d Implement mixed builds for apex modules, take 2.
* Add ApexCqueryInfo to obtain apex artifacts used by the makefile
  generator and downstream modules
* Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse
* Implement android.MixedBuildBuildable for modules
* Enable mixed build for apex modules with payload_type:"image"

The first take 6a2b7c40b was setting compressed APEX suffix incorrectly, and
was reverted in 8a3c91494.

Fixes: 239925080 239695521 232085015
Test: treehugger
Change-Id: I1720f8db3c7cc773183d25a815d9b7eeaf7c73ad
2022-07-28 14:43:50 -07:00
Ken Chen
d8cded58fe Merge "Disallow '_' in bpf source name" 2022-07-28 07:00:12 +00:00
Martin Stjernholm
0bb7f0494e Merge "Revert "Implement mixed builds for apex modules."" 2022-07-26 13:52:18 +00:00
Martin Stjernholm
8a3c914942 Revert "Implement mixed builds for apex modules."
Revert submission 2147387-mixed_builds

Reason for revert: Breaks zipapex build on git_master-art-host
Bug: 239925080
Reverted Changes:
I9f1e03e5e:Implement mixed builds for apex modules.
I13d9a0270:Add container and bundle encription key pairs to t...

Change-Id: I0eaad4dd81cac16d634f4c9cec18137a38e30d47
2022-07-26 09:35:39 +00:00
Paul Duffin
fcf79850d8 Export any platform_compat_config used by apex to sdk snapshot
Previously, the platform_compat_config modules needed to be explicitly
listed in the sdk snapshot and the apex. This change will automatically
export them to the sdk snapshot when the apex is listed in its apexes
property.

Bug: 232401814
Test: m tethering-module-sdk
      # Before this change the generated snapshot did not contain the
      # platform_compat_config, after this change it did.
      m art-module-sdk
      # As that explicitly specifies the platform_compat_config in its
      # compat_configs property this change has no effect.
Change-Id: Ia854b9a52db2b1619fca41a387ce98d7f9f9efe9
2022-07-20 14:18:24 +00:00
Alexander Smundak
9ec1ff98b7 Merge "Implement mixed builds for apex modules." 2022-07-19 13:38:55 +00:00
Jiyong Park
85cc35a143 Distinguish # apex and # systemapi symbols
Previously, the symbol tag `# apex` was treated the same as `#
systemapi`. With this CL, they have different meanings.

`# systemapi`: APIs that are defined in the platform (the non-updatable
part), and are exposed to unbundled system components like APEX

`# apex`: APIs that are defined in the APEX and are exposed to the
platform or other APEXes

Bug: 239274367
Test: m
Change-Id: I0484ea349656dbbd337e5fe3a5970f0ad275b807
2022-07-19 13:47:19 +09:00
Sasha Smundak
6a2b7c40b3 Implement mixed builds for apex modules.
* Add ApexCqueryInfo to obtain apex artifacts used by the makefile
  generator and downstream modules
* Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse
* Implement android.MixedBuildBuildable for modules
* Enable mixed build for apex modules with payload_type:"image"

Bug: 232085015
Test: treehugger
Change-Id: I9f1e03e5e7a5b5dde35a5db10c253069543ac973
2022-07-18 13:34:36 -07:00
Alexei Nicoara
0a3892031e Cleaning up comment removal and version replacement
jsonmodify is now responsible for striping the comments and replacing the placeholder  version with the defaule one. Cleaning up the old code.

Test: presubmit
Bug: 231691643
Change-Id: I09af00199aefec09b2d5995b2923525a3a42c362
2022-07-12 14:50:48 +01:00
Alexei Nicoara
d887e24260 Cleaning up the version sed rule
Bug: 231691643
Test: presubmit, checked itermediary jsons
Change-Id: Ibcf908d9365ab41e5a19211f5a60305a0896dea5
2022-07-12 11:53:21 +01:00
Alexei Nicoara
e922d2139d Replace version 0 with the default version
Having 0 as the default version causes problems in flattened apexes and
is being parsed in protobuf as non-existing field. It will be hard to
revert 100 of commits for all the modules. Changing the version in soong
to mitigate time impact.

Test: presubmit, checked .intermediary jsons
Bug: 231691643
Change-Id: I451186d79fd9f8345fd4e28d9daadbfc59047445
2022-07-08 17:38:52 +01:00
Ken Chen
5372a24375 Disallow '_' in bpf source name
Current design:
1. The bpf compiled object name is derived from the source name
   (e.g. foo.c -> foo.o).
2. Full bpf program/map name are concatenated by object name + '_' +
   program/map name in run-time. (e.g. obj name: x.o; program name: y_z;
   full bpf program name will be x_y_z)

Issue:
x.o with map y_z and x_y.o with map z can cause naming collision in
run-time, since both result in x_y_z. This commit prevents it from
happening with a build-time check.

Bug: 236706995
Test: m
Change-Id: Ic03bfcf07a5748ed63246b71d5ae8de0405e658a
2022-07-07 20:02:28 +08:00
Paul Duffin
0d89b3dc27 Merge "Add apexes property to sdk" 2022-07-07 10:40:00 +00:00
Treehugger Robot
87d74dc54e Merge "Passing default version to zipApex as well" 2022-07-06 17:42:34 +00:00
Paul Duffin
4e7d1c43e2 Add apexes property to sdk
Specifying an apex in the apexes propety will cause all the
*classpath_fragments that are contents of the APEX to be automatically
added as members of the sdk and appear in the snapshot.

The purpose of this change is to dedup the APEX and sdk definitions and
try and avoid some of the issues that we have been finding while
attempting to build against the prebuilts.

Two tests, one each for bootclasspath_fragment and
systemserverclasspath_fragment, have been refactored to compare the
output when adding the *fragment to the sdk directly of via the APEX.
That ensures switching to use the APEX will not change the sdk snapshot
unless it was previously missing a *fragment.

There was also a slight difference in where the hidden API flags were
copied from. That should have no impact on the output as the flags are
identical.

The sdk snapshot generation needed some tweaks to avoid generating a
prebuilt for the APEX.

Bug: 232401814
Test: m nothing
Change-Id: I7aaf16a3a0ab4bebf97765d1484215cc008dc4b8
2022-07-06 15:58:43 +00:00
Alexei Nicoara
c939b0181d Passing default version to zipApex as well
Test: presubmit
Bug: 231691643
Change-Id: Ic751d7ea2d23180855897702a03bf1b589d7ef80
2022-07-06 13:56:50 +01:00
Alexei Nicoara
ee4b633627 Removing comment lines from apex_manifest.json
Allowing comments in apex_manifest.json by stripping all the lines which
start with //

Test: presubmit
Bug: 237532860
Change-Id: Iec8c9987edf19b763b2b87df7d125c006ffb217a
2022-06-30 16:34:28 +01:00
Sasha Smundak
6f9e91d5e9 Refactor apexBundle code.
Move dependency walker out of GenerateAndroidBuildActions, reduce IDE
warnings.

Test: treehugger
Change-Id: I520c59772b1da7102d2a2364b2c56789455ea7fb
2022-06-28 22:47:43 -07:00
Lukacs T. Berki
01a648afa0 Restrict IsSanitizerEnabled() to android.Config().
Turns out, the whole context is not needed and then let's not
plumb it any further than necessary.

Test: Presubmits.
Change-Id: I1a25738e5a6ca20dea0d973c2ce435b5e152399b
2022-06-17 08:59:37 +02:00
Paul Duffin
5556c5f17a Treat <x> and <x>_compressed prebuilt APEXes as being equivalent
(cherry picked from commit 1aa50564c7)

When extracting dex files from prebuilt APEXes the build fails if it
finds two or more prebuilt APEXes that could provide the dex files.
This change treats <x> and <x>_compressed APEXes as being the same
and always selects the uncompressed APEX.

Bug: 235284603
Test: m nothing
      # Added TestDuplicateButEquivalentDeapexersFromPrebuiltApexes
      # Failed without this change, works with it.
Merged-In: I805cb9dfa9f590c91585d75c4f4586b212b73d41
Change-Id: I805cb9dfa9f590c91585d75c4f4586b212b73d41
2022-06-13 13:16:53 +00:00
Jingwen Chen
c90a3cd6f6 Merge "bp2build: convert apex.logging_parent." 2022-06-11 02:38:08 +00:00
Treehugger Robot
20b623da89 Merge "Fix strip_prefix flags to strip install paths." 2022-06-10 18:07:41 +00:00
Jingwen Chen
b732d7c765 bp2build: convert apex.logging_parent.
Test: CI
Fixes: 235559958

Change-Id: I7b578c67eedb0379603bcf2fc029d03facfbbb0f
2022-06-10 08:38:03 +00:00
Bob Badour
c6ec9fb849 Fix strip_prefix flags to strip install paths.
Bug: 235331488

Test: m droid dist

Change-Id: I3cd2af5d90e46a4c983728bc9b2d941d6ffda229
2022-06-09 14:24:41 -07:00
Alexei Nicoara
5b96d35851 Merge "Passing the default apex version to the apexer" 2022-06-09 08:58:27 +00:00
Alexei Nicoara
3f8cbcb82c Passing the default apex version to the apexer
Test: presubmit
Bug: 231691643
Change-Id: I900a6acde9f212bf785b0be35f422416c8b62792
2022-06-08 17:49:50 +01:00
Jingwen Chen
df165c9e85 Only override prebuilts property if the override_apex.prebuilts is
explicitly specified (not nil).

This allows the base apex's prebuilts to be surfaced to the override
apex target.

Discovered when com.google.android.adbd's prebuilts didn't contain its
init.rc module.

Bug: 222588072
Test: CI
Change-Id: I925e98d53f7d9208652c629799ab568521ba7dfe
2022-06-08 16:03:03 +00:00
Treehugger Robot
4a737a2d8b Merge "bootclasspath_fragment: Require at least one hidden_api package property" 2022-06-06 16:05:12 +00:00
Treehugger Robot
335071dad2 Merge "Convert override_apex.package_name with bp2build." 2022-06-06 14:59:07 +00:00
Jingwen Chen
9b7ebca187 Convert override_apex.package_name with bp2build.
Bug: 216414792
Test: CI and new bazel/bp2build tests
Change-Id: I3974970cdd555b3912798e79e61d61786a4ff677
2022-06-06 10:08:53 +00:00
Bob Badour
5180438478 Make sure dist files have license metadata.
Bug: 151177513
Bug: 210912771

Test: m droid dist reportmissinglicenses

Change-Id: I0c85f6c49a3e9d9bb3219ed6ddfb939d90f80656
2022-06-01 21:07:25 -07:00
Paul Duffin
9fd564711e bootclasspath_fragment: Require at least one hidden_api package property
Previously, the split_packages, single_packages and package_prefixes
properties were all optional and the split_packages defaulted to ["*"].
As that value conflicted with the other package properties that meant
that split_packages always had to be specified even if it was to just
set it to an empty array.

This change requires at least one of them to be specified and defaults
split_packages to an empty list which means it is not required,
although it can be helpful to make that explicit.

Bug: 194063708
Test: m nothing
Change-Id: I5a4c2d68e72e39f5c4a2441326dfce8685fc8ff2
2022-05-27 16:27:50 +01:00
Wei Li
40f9873612 Convert the property "manifest" properly for override_apex.
1) When it is not set in base apex, default file name should be set explicitly in bp2build converter of apex
2) The manifest file path should be used as-is when base apex and override_apex is in the same Android.bp
3) The manifest file path should be prepended with package of base apex when base apex and override_apex is in different Android.bp

Bug: 216442475
Test: m nothing
Change-Id: Icd3523ebc31d885f67bea02aec05dbfc77671e87
2022-05-23 17:22:35 -07:00
Bob Badour
a5ea2479d3 Fix bug: allow multiple gen_notice modules.
Test: m cts dist reportmissinglicenses

Change-Id: I07963c83eaddfe363a04871e813b56fe7f1465ad
2022-05-20 16:54:00 -07:00
Bob Badour
335a4333fe Merge "Add gen_notice module." 2022-05-19 18:03:09 +00:00
Bob Badour
eef4c1c563 Add gen_notice module.
Refactor notices to support notices for multiple modules.

Enforce visibility and handle missing dependencies.

Bug: 213388645

Change-Id: Id6a81987f087419ad37d0cce57a71e8a7c4cd6e0
2022-05-18 16:38:19 -07:00
Paul Duffin
520917af9d Pass pointer to dependencyTag instead of copying struct
A follow up change will add some more fields to the tag which will make
passing the struct around by value will get more expensive. Switching
to pointers will make this slightly more efficient.

Changing the type of the tags from dependencyTag to *dependencyTag
broke a test. Rather than simply patch the test and then maybe have to
patch it again in the next change this adds a a String() method that
will insulate the test from being affected by changes in the
dependencyTag contents.

Bug: 232401814
Test: m nothing
Change-Id: I23da742ebffb74ef3b9b68f772519ceb38332f5f
2022-05-13 16:06:36 +00:00
Treehugger Robot
1c87db50ca Merge "Clean up hard-coded min_sdk_version/apex_available" 2022-05-13 04:56:59 +00:00
Wei Li
1c66fc74d2 Add bp2build converter for override_apex.
Bug: 216442475
Test: m nothing
Change-Id: I2f106d15c1d235583b8b1a8f0ac4b48162ff4fdd
2022-05-11 22:22:04 -07:00
Spandan Das
f923333a93 Merge changes Ie8881b85,I6c064f8a
* changes:
  Enforce updatable=true on apps of updatable apexes
  Update sdk_version check for jni_libs of updatable apps
2022-05-10 18:20:27 +00:00
Spandan Das
42e89508ee Enforce updatable=true on apps of updatable apexes
- Update apex_info (a topdown mutator) so that it sets updatable=true on
  apps of updatable apexes
- Write a unit test that tests different combinations of
  updatable/non-updatable apks-in-apexes
- Update an existing unit test that asserts a different error

Test: go test ./java
Test: m nothing (in internal)
Bug: 209409604

Change-Id: Ie8881b857afcec44addf27fc360c5b8abf726bd2
2022-05-10 00:01:34 +00:00
Jooyung Han
932d2c1932 Clean up hard-coded min_sdk_version/apex_available
Set min_sdk_version/apex_available for modules used by
com.android.permission APEX.

Bug: 147364041
Bug: 158059172
Test: m
Change-Id: I93ff72ed765354d44a2ccb5105b5f2820f0358f5
2022-05-06 12:21:04 +09:00
Treehugger Robot
beccdcdff2 Merge "Revert "Append APEX version instead of build ID for APK-in-APEX ..."" 2022-05-06 03:17:24 +00:00
Oriol Prieto Gasco
17e2290e9f Revert "Append APEX version instead of build ID for APK-in-APEX ..."
Revert submission 2067907-apk-in-apex

Bug: 230873680

Reason for revert: Change broke aab generation b/230873680
Reverted Changes:
I9cef1418c:Append APEX version instead of build ID for APK-in...
Ic37eeba8b:Make apexer replace instances of version placehold...

Change-Id: Ib113d56901e815435f71bf878049cdabd210503c
2022-05-05 14:32:37 +00:00