Commit Graph

44111 Commits

Author SHA1 Message Date
Paul Duffin
d564c32818 Switch boot image generation to use GetGlobalSoongConfig(ctx)
Previously, boot image generation used GetCachedGlobalSoongConfig(ctx)
in order to get access to the GlobalSoongConfig. That required that
some other part of the code had called GetGlobalSoongConfig(ctx) to
initialize the cached value. That was left over from when the boot
image generation was done in a singleton which could not call
GetGlobalSoongConfig(ctx) directly. That is no longer true.

This change switches the uses of GetCachedGlobalSoongConfig(ctx) to
GetGlobalSoongConfig(ctx) and removes the now unnecessary call to
GetGlobalSoongConfig(ctx) from outside the functions.

Bug: 192575099
Test: m nothing
Merged-In: I34b7b1526d072d8b09fda7caa96e381695888e16
Change-Id: I34b7b1526d072d8b09fda7caa96e381695888e16
(cherry picked from commit 8fc51a8eb6)
2021-07-06 22:20:24 +01:00
Paul Duffin
29abe2c894 [automerger skipped] Generate boot zip file from prebuilt_bootclasspath_fragment am: bb2e205603 -s ours
am skip reason: Merged-In Ie7dd5e2ca4a865d06fd9ebf87320cf68c4d05bc3 with SHA-1 56afb27fb0 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15215491

Change-Id: I204a72511ff9df3c7df3383dfe0afc40b234b7e6
2021-07-06 19:04:29 +00:00
Paul Duffin
803234f156 [automerger skipped] Use both module name and stem name to filter updatable boot jars am: aba5275676 -s ours
am skip reason: Merged-In I6c459fc3597b1e4f062bc9a4e52843305b538c5f with SHA-1 56c93e899a is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15215490

Change-Id: Idc391ab80aa31d5bebe599c549d5f0f3541e87ef
2021-07-06 17:38:48 +00:00
Paul Duffin
b68c4c0b49 Generate boot images for host from prebuilts am: a56be7d781 am: 9dfd930cf7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1757170

Change-Id: I2d343d227edb0b5138537f1fc3d36c4806340d51
2021-07-06 15:28:37 +00:00
Paul Duffin
9dfd930cf7 Generate boot images for host from prebuilts am: a56be7d781
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1757170

Change-Id: I21e0bd7ef439def519797f6a9e09857d23c9d276
2021-07-06 15:17:14 +00:00
Paul Duffin
688efcdbde Switch boot image generation to use GetGlobalSoongConfig(ctx) am: 8fc51a8eb6 am: 371276f582
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1757169

Change-Id: Ia5c95bfaf3a77614e15c1c5221826ed4c3d8abd8
2021-07-06 15:09:01 +00:00
Paul Duffin
371276f582 Switch boot image generation to use GetGlobalSoongConfig(ctx) am: 8fc51a8eb6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1757169

Change-Id: I5cbc7fd0f5046031337afef2ec495088544f2438
2021-07-06 14:57:18 +00:00
Paul Duffin
a56be7d781 Generate boot images for host from prebuilts
Previously, when building from prebuilts boot no rules were created to
produce the boot image files for the host, i.e. the OS on which the
build was running. That caused problems with checkbuilds. No rules were
produced as there was no host variant of a prebuilt apex to provide
them.

This change restructures the code to allow the prebuilt bootclasspath
fragment to build the host variants of the files from the dex files
provided by the prebuilt APEX. The generated files will not be the same
as they would be if built from source as there is no boot image profile
to use but it should be sufficient to satisfy the checkbuild target and
allow for host side testing.

Bug: 192575099
Test: m SOONG_CONFIG_art_module_source_build=false droid dist checkbuild
Change-Id: I6af00f19bb71aa18dd462f5eac6aa38e3e721023
2021-07-06 13:45:46 +01:00
Paul Duffin
bb2e205603 Generate boot zip file from prebuilt_bootclasspath_fragment
Previously, the boot zip file, containing all the boot image files for
all the supported architectures, was only created from source. It was
not created when building from a prebuilt_bootclasspath_fragment. That
lead to build failures when building from ART prebuilts.

This change pulls the boot zip file creation out so that it can be done
for both source and prebuilt bootclasspath_fragment modules as well as
for the platform_bootclasspath module.

Bug: 192575099
Test: m out/target/product/generic_arm64/boot.zip
      m SOONG_CONFIG_art_module_source_build=false out/target/product/generic_arm64/boot.zip
      - Compare the output of the first command from before the change
        with the output from them both after and confirm that when the
        ART prebuilts are up to date with the source that there are no
        differences.
Merged-In: Ie7dd5e2ca4a865d06fd9ebf87320cf68c4d05bc3
Change-Id: Ie7dd5e2ca4a865d06fd9ebf87320cf68c4d05bc3
(cherry picked from commit 56afb27fb0)
2021-07-06 13:34:26 +01:00
Paul Duffin
aba5275676 Use both module name and stem name to filter updatable boot jars
Sometimes the stem property is set to change both the installed file
name and the name use to filter the configured module list, e.g. when
adding a test library to replace the standard library, e.g. test_foo
instead of foo.

Sometimes it is used just to change the installed file name.

This change uses both to filter the updatable boot jars and not just
the stem.

Bug: 180105615
Test: m nothing
Merged-In: I6c459fc3597b1e4f062bc9a4e52843305b538c5f
Change-Id: I6c459fc3597b1e4f062bc9a4e52843305b538c5f
(cherry picked from commit 56c93e899a)
2021-07-06 13:34:25 +01:00
Paul Duffin
8fc51a8eb6 Switch boot image generation to use GetGlobalSoongConfig(ctx)
Previously, boot image generation used GetCachedGlobalSoongConfig(ctx)
in order to get access to the GlobalSoongConfig. That required that
some other part of the code had called GetGlobalSoongConfig(ctx) to
initialize the cached value. That was left over from when the boot
image generation was done in a singleton which could not call
GetGlobalSoongConfig(ctx) directly. That is no longer true.

This change switches the uses of GetCachedGlobalSoongConfig(ctx) to
GetGlobalSoongConfig(ctx) and removes the now unnecessary call to
GetGlobalSoongConfig(ctx) from outside the functions.

Bug: 192575099
Test: m nothing
Change-Id: I34b7b1526d072d8b09fda7caa96e381695888e16
2021-07-06 12:51:04 +01:00
Pedro Loureiro
ffb643fc18 make system server modules use filtered lint database
Bug: 188851704
Test: m
Change-Id: Ie8f63286aeeb4cdbec5b9320c2ba41c8e37c7345
Merged-In: Ie8f63286aeeb4cdbec5b9320c2ba41c8e37c7345
2021-07-05 16:57:34 +00:00
Pedro Loureiro
2f58789d65 make system server modules use filtered lint database am: 7609182dda
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15208490

Change-Id: I4c93b1a85206124c7fd282e35904d5c55b7d0d59
2021-07-05 16:50:55 +00:00
Pedro Loureiro
7609182dda make system server modules use filtered lint database
Bug: 188851704
Test: m
Change-Id: Ie8f63286aeeb4cdbec5b9320c2ba41c8e37c7345
2021-07-05 14:01:49 +00:00
Paul Duffin
7ecb331fd3 Merge "Generate boot zip file from prebuilt_bootclasspath_fragment" am: 452decbd88 am: 019e278025
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1753271

Change-Id: I969dde3851899374bd466c9a0e5263f0fe6d12c8
2021-07-05 12:27:08 +00:00
Paul Duffin
019e278025 Merge "Generate boot zip file from prebuilt_bootclasspath_fragment" am: 452decbd88
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1753271

Change-Id: I0ea32f281f2ec9b87aaca12ce2f800705d8f94fc
2021-07-05 12:12:22 +00:00
Paul Duffin
452decbd88 Merge "Generate boot zip file from prebuilt_bootclasspath_fragment" 2021-07-05 12:01:46 +00:00
Yi-Yo Chiang
ec14a4ded8 cc/cc.go: Harden GetSnapshot() against nil pointer panic
* Retrieve SnapshotInfo only if the calling module is device-variant.
* Test for nil-ness before calling ctx.OtherModuleProvider().

Bug: 192647618
Test: Presubmit
Change-Id: Ida8582f756e1b15f8c14c816ed6e736b47995877
2021-07-03 19:20:02 +08:00
Paul Duffin
59480e327e Merge "Use both module name and stem name to filter updatable boot jars" am: 276fd424ad am: 31620af91d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748051

Change-Id: Ib0f336f1ee599d2cb8ed03af3caec2fb953a4878
2021-07-02 21:17:38 +00:00
Paul Duffin
31620af91d Merge "Use both module name and stem name to filter updatable boot jars" am: 276fd424ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748051

Change-Id: I7bbd3ae508a06fb544d9da8c4414fc5baaf64445
2021-07-02 21:04:44 +00:00
Paul Duffin
276fd424ad Merge "Use both module name and stem name to filter updatable boot jars" 2021-07-02 20:41:07 +00:00
Rupert Shuttleworth
268466707b Add partial bp2build support for APEX targets (second try). am: a9d76dd423 am: 37b29c925c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1755109

Change-Id: Id29697a17140dccf5ca9764a95f6f5db51a8783a
2021-07-02 13:38:14 +00:00
Yi-Yo Chiang
36d8e4e201 cc/cc.go: Add Device() method to LinkableInterface
The intention is to make the next change more cherry-pick-friendly.

Bug: 192647618
Test: Presubmit
Change-Id: Ic84d3991a855e09aa9f46e12b759ad8142701e1f
2021-07-02 21:24:58 +08:00
Rupert Shuttleworth
37b29c925c Add partial bp2build support for APEX targets (second try). am: a9d76dd423
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1755109

Change-Id: Iad07897a10e7ea8067b5c892188596b44efc2cba
2021-07-02 13:24:55 +00:00
Rupert Shuttleworth
a9d76dd423 Add partial bp2build support for APEX targets (second try).
Test: Added unit test
Change-Id: Icbf0475251aac5d1f13bd35a18f90b6c70f3ae29
2021-07-02 07:36:07 -04:00
Paul Duffin
791604ff6c Retry: Make bootclasspath_fragments always perform hidden API processing am: dad8880399
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15175112

Change-Id: I73d61880403062eaec056e003a9b4f3b2495b73f
2021-07-02 08:59:15 +00:00
Paul Duffin
57b521ddca [automerger skipped] Defer error reporting of missing prebuilt dex jar files am: 886060a688 -s ours
am skip reason: Merged-In Ibde3bf840a7413785cd32bd6cea1c322f90c59af with SHA-1 ef083c9556 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15175111

Change-Id: I7b4d95a3cb3cbeab80eb590ca5e1120ec0a10c71
2021-07-02 08:59:10 +00:00
Treehugger Robot
7038af4d66 Merge "Include static lib information for the snapshot modules" am: 503e3a10b2 am: 5caf0040d1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1751245

Change-Id: If5dffdebf163416ebcf3654222513e2becd745eb
2021-07-02 00:34:02 +00:00
Treehugger Robot
5caf0040d1 Merge "Include static lib information for the snapshot modules" am: 503e3a10b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1751245

Change-Id: I96414fa69aa86706d20433540f5b13033a559a58
2021-07-02 00:19:24 +00:00
Treehugger Robot
787f1d9086 Merge "Delete unused functions" am: 31b9a0c9da am: d6f6a86e34
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1749403

Change-Id: Iac4dd19b2984f28d89e0c4e75117f197407674a4
2021-07-02 00:12:54 +00:00
Treehugger Robot
d6f6a86e34 Merge "Delete unused functions" am: 31b9a0c9da
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1749403

Change-Id: I7fafe84b9226f1bf6a0cccf7fc8c3f5af8845b30
2021-07-01 23:59:05 +00:00
Colin Cross
c7142d70d5 Merge "Export NewPrebuiltObject" am: 34d52eed1e am: 07e6d28f61
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1747998

Change-Id: I9dcc43d4e895647bd34ab736eaa9054d0dc24f02
2021-07-01 23:52:18 +00:00
Colin Cross
07e6d28f61 Merge "Export NewPrebuiltObject" am: 34d52eed1e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1747998

Change-Id: Ifb3561a19ff692c125b7b265b11e72502aacd8af
2021-07-01 23:38:40 +00:00
Martin Stjernholm
95994067b1 Do not allow duplicate deapexer dependencies.
Without these errors, the last encountered deapexer would silently be
used, and we wouldn't know if it was taken from the prebuilt APEX that
actually get installed in the system image.

With this error check there may be only one enabled prebuilt_apex or
apex_set for each apex_name (which defaults to the module name). E.g.
if there are both prebuilt com.android.foo and com.google.android.foo,
it is necessary to disable one of them in the .bp file.

Merged-In is set from https://r.android.com/1745454, a change that has
gone into AOSP and internal master, as well as sc-dev-plus-aosp, but
specifically not sc-dev. This change cannot merge into sc-dev-plus-aosp
and others, because they may or may not have the com.google.android.art
prebuilt APEX present depending on manifest, and with this check
exactly one of com.android.art and com.google.android.art prebuilts has
to be present and enabled. It'll be cherry-picked to AOSP along with a
full fix for b/192006406, when it can be safely enabled everywhere.

Test: m nothing SOONG_CONFIG_art_module_source_build=false
Test: m nothing SOONG_CONFIG_art_module_source_build=true
Test: m nothing
  with enabled:true for the com.android.art prebuilt APEX - check that
  it fails with an "ambiguous duplicate deapexer" error
Bug: 192006406
Bug: 192542393
Change-Id: I44566fd26b12f82a8a67fe4a69e56303460756d0
Merged-In: Id2410b4e38a78ec2146a42298840954381a7c472
2021-07-02 00:31:01 +01:00
Treehugger Robot
503e3a10b2 Merge "Include static lib information for the snapshot modules" 2021-07-01 22:24:33 +00:00
Treehugger Robot
31b9a0c9da Merge "Delete unused functions" 2021-07-01 22:20:04 +00:00
Paul Duffin
56afb27fb0 Generate boot zip file from prebuilt_bootclasspath_fragment
Previously, the boot zip file, containing all the boot image files for
all the supported architectures, was only created from source. It was
not created when building from a prebuilt_bootclasspath_fragment. That
lead to build failures when building from ART prebuilts.

This change pulls the boot zip file creation out so that it can be done
for both source and prebuilt bootclasspath_fragment modules as well as
for the platform_bootclasspath module.

Bug: 192575099
Test: m out/target/product/generic_arm64/boot.zip
      m SOONG_CONFIG_art_module_source_build=false out/target/product/generic_arm64/boot.zip
      - Compare the output of the first command from before the change
        with the output from them both after and confirm that when the
        ART prebuilts are up to date with the source that there are no
        differences.
Change-Id: Ie7dd5e2ca4a865d06fd9ebf87320cf68c4d05bc3
2021-07-01 22:17:49 +01:00
Colin Cross
34d52eed1e Merge "Export NewPrebuiltObject" 2021-07-01 20:53:24 +00:00
Colin Cross
6c38609831 Merge "Support shared_libs, static_libs and default_shared_libs in cc_object" am: 8c3339f74c am: 9338f2f263
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1743044

Change-Id: I571fccffafa6a91654a3de5bd384ed490770f717
2021-07-01 19:46:05 +00:00
Colin Cross
9338f2f263 Merge "Support shared_libs, static_libs and default_shared_libs in cc_object" am: 8c3339f74c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1743044

Change-Id: Ic62ed4cfbe3286b8f6f98ea3b736176d03686cfc
2021-07-01 19:29:20 +00:00
Colin Cross
8c3339f74c Merge "Support shared_libs, static_libs and default_shared_libs in cc_object" 2021-07-01 19:00:40 +00:00
satayev
4efc42d57f Merge "Use system stubs for framework-doc-system-stubs." am: 8e3356f610 am: 015ca2f4b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1745338

Change-Id: Ieca85003da032ab1fc0ebac10e2fd59bdb8cd0f9
2021-07-01 17:49:54 +00:00
satayev
015ca2f4b9 Merge "Use system stubs for framework-doc-system-stubs." am: 8e3356f610
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1745338

Change-Id: I41dc2d687c84a25211346a1a1f67af822e266505
2021-07-01 17:33:33 +00:00
satayev
8e3356f610 Merge "Use system stubs for framework-doc-system-stubs." 2021-07-01 17:21:36 +00:00
Paul Duffin
dad8880399 Retry: Make bootclasspath_fragments always perform hidden API processing
Previously, bootclasspath_fragment modules would only perform hidden
API processing if they provided some stub libraries and fragments. That
was needed because the bootclasspath_fragment modules were added before
Soong supported hidden API processing on all the different modules and
before they all provided the necessary information that hidden API
processing required.

This change stops hidden API being conditional as it is no longer
required as it has been enabled on all existing bootclasspath_fragment
modules.

Bug: 179354495
Test: m nothing
Change-Id: Ibf81a7de63b888a3ebf445528326fa6101fdb1ba
2021-07-01 17:22:50 +01:00
Paul Duffin
886060a688 Defer error reporting of missing prebuilt dex jar files
Unless the prebuilt dex jar files are explicitly required to build
system images or dex preopting defer reporting of any missing dex boot
jars from Soong to Ninja.

This will prevent builds that contain prebuilt sdks, containing prebuilt
bootclasspath_fragment modules but without a corresponding apex_set or
prebuilt_apex module from failing even when it is not building against
the prebuilt sdk.

Bug: 179354495
Test: m nothing
Merged-In: Ibde3bf840a7413785cd32bd6cea1c322f90c59af
Change-Id: Ibde3bf840a7413785cd32bd6cea1c322f90c59af
(cherry picked from commit ef083c9556)
2021-07-01 17:20:53 +01:00
Orion Hodson
0561bdc6b0 [automerger skipped] Merge "Support using java_sdk_library components in stub_libs" into sc-dev am: e6e499b3eb -s ours
am skip reason: Merged-In I9de96337f64f26e24cff040d4bbed9eecc67b1ed with SHA-1 3f0290ef79 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15162578

Change-Id: I9d7aba05fb91333f3fd3f3f4494e719c5d5cacdb
2021-07-01 16:03:42 +00:00
Paul Duffin
cc82eab6bb Merge "Revert "Make bootclasspath_fragments always perform hidden API processing"" into sc-dev am: fb5229b3bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15175110

Change-Id: I5ac37d22100a88c205d068daecaacc2829280119
2021-07-01 16:03:02 +00:00
Orion Hodson
e6e499b3eb Merge "Support using java_sdk_library components in stub_libs" into sc-dev 2021-07-01 15:54:10 +00:00
Paul Duffin
fb5229b3bc Merge "Revert "Make bootclasspath_fragments always perform hidden API processing"" into sc-dev 2021-07-01 15:47:24 +00:00