Commit Graph

42608 Commits

Author SHA1 Message Date
Kousik Kumar a9396f3727 Load env variables before c.config() am: 062b011502 am: f04dc7f1b1 am: de85899f78
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15723183

Change-Id: If08483b4d0702ea51f0580f92d1f176eb3b1e98e
2021-08-31 18:03:38 +00:00
Kousik Kumar 073f79b50c Load env variables before c.config() am: 062b011502 am: ef9d91b7ac am: 50c2a1b2a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15723183

Change-Id: I0bc6992644c580cbc091f9cda8864e0c2da4f470
2021-08-31 18:03:34 +00:00
Kousik Kumar de85899f78 Load env variables before c.config() am: 062b011502 am: f04dc7f1b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15723183

Change-Id: Ic0629266b7ea9b51d4a7ad2f697dd1e0cdb65051
2021-08-31 17:59:15 +00:00
Kousik Kumar 50c2a1b2a4 Load env variables before c.config() am: 062b011502 am: ef9d91b7ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15723183

Change-Id: I5574eba839d8e186a3fff27b5198ab34ec10e1ce
2021-08-31 17:50:32 +00:00
Kousik Kumar f04dc7f1b1 Load env variables before c.config() am: 062b011502
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15723183

Change-Id: I13773a3be06c8ad4426960b0f2fbc45bbed3e85f
2021-08-31 17:33:30 +00:00
Kousik Kumar ef9d91b7ac Load env variables before c.config() am: 062b011502
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15723183

Change-Id: I6fd005904a174ae685853fcb9303e678ab7a48d0
2021-08-31 17:33:30 +00:00
Kousik Kumar 062b011502 Load env variables before c.config()
If the env variables are loaded after the config object is created, they aren't set in the Environment object inside the config object which causes RBE to not work

Bug: b/198045383
Test: Tested by running a build against rvc-dev branch and ensuring it works.
Change-Id: I509289467df81e5535b4cbbfe4e5eb336c0e4e59
2021-08-31 05:44:29 +00:00
Treehugger Robot 5fa40b1a2b [automerger skipped] Add FAILED: prefix to RBE Fatal error message" am: 907bbdfc9f am: 46d4a14089 -s ours am: 0b7859c0d9 -s ours
am skip reason: Merged-In Ie0c9acee2739acf149384e33804b5fca3273c24f with SHA-1 1e4d5f3e67 is already in history

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

Change-Id: I74586233adc72131f77e4fb6c6ee777df07dffd2
2021-08-19 19:40:34 +00:00
Treehugger Robot 1ffe58c42b [automerger skipped] Add FAILED: prefix to RBE Fatal error message" am: 907bbdfc9f am: 9ba871bbe9 -s ours am: 41a0ece7d4 -s ours
am skip reason: Merged-In Ie0c9acee2739acf149384e33804b5fca3273c24f with SHA-1 1e4d5f3e67 is already in history

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

Change-Id: I7169df1cda5f89648159bff750aea245384346a6
2021-08-19 19:40:30 +00:00
Treehugger Robot 0b7859c0d9 [automerger skipped] Add FAILED: prefix to RBE Fatal error message" am: 907bbdfc9f am: 46d4a14089 -s ours
am skip reason: Merged-In Ie0c9acee2739acf149384e33804b5fca3273c24f with SHA-1 1e4d5f3e67 is already in history

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

Change-Id: Ibf4e6d9cb9077871b480651137e7444670eb88ac
2021-08-19 19:24:21 +00:00
Treehugger Robot 41a0ece7d4 [automerger skipped] Add FAILED: prefix to RBE Fatal error message" am: 907bbdfc9f am: 9ba871bbe9 -s ours
am skip reason: Merged-In Ie0c9acee2739acf149384e33804b5fca3273c24f with SHA-1 1e4d5f3e67 is already in history

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

Change-Id: If98b1b5871568e54889b195a475d670e00030c6e
2021-08-19 19:23:27 +00:00
Treehugger Robot 46d4a14089 Add FAILED: prefix to RBE Fatal error message" am: 907bbdfc9f
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15625816

Change-Id: If65b22f21e7b46113800525668598d63020c26fe
2021-08-19 19:09:43 +00:00
Treehugger Robot 9ba871bbe9 Add FAILED: prefix to RBE Fatal error message" am: 907bbdfc9f
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15625816

Change-Id: I9e55824b4e8359eb514c6cb3d31b8e0a98c55a7d
2021-08-19 19:09:04 +00:00
Treehugger Robot 907bbdfc9f Add FAILED: prefix to RBE Fatal error message"
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1560871

Bug: b/195592452
Change-Id: I00e2cb26eb3e1e3b695ba067cad24f45169f3a58
(cherry picked from commit ab2803a870)
Merged-In: Ie0c9acee2739acf149384e33804b5fca3273c24f
2021-08-19 17:08:49 +00:00
Colin Cross e9fc2e55b3 Collect lint reports from apps in apexes am: 192221b55e
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15531885

Change-Id: I013e140227377cb6226a1e771f858f11f0f17fe8
2021-08-11 18:57:57 +00:00
Colin Cross 192221b55e Collect lint reports from apps in apexes
Lint reports were only being collected from jars in apexes, not
apps.

Bug: 188772607
Test: mainline_modules_arm64 build
Change-Id: Ie84819343f8b8ab3f43496bbc9b7876d0d0d8e70
Merged-In: Ie84819343f8b8ab3f43496bbc9b7876d0d0d8e70
(cherry picked from commit 8355c1524fbb1d6b7b7a25a13f66feffb1aa7214)
2021-08-11 09:07:57 -07:00
Kun Niu fe1d6c535c Merge "Use prebuild modules even when coverage is enabled." into sc-dev 2021-08-06 19:12:27 +00:00
Kousik Kumar 0c49dac503 resolve merge conflicts of 233c1be0bd to rvc-dev am: 3c12576942 am: a907f283fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15473760

Change-Id: I42938333328a0a42f99f80ba4b53e64b33935316
2021-08-06 16:09:04 +00:00
Kousik Kumar e8d959e5cf resolve merge conflicts of 233c1be0bd to rvc-dev am: 3c12576942 am: 4d645c7791
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15473760

Change-Id: I5568c2f0fed211356a521bed0e26332e930bd22b
2021-08-06 16:03:42 +00:00
Kousik Kumar a907f283fc resolve merge conflicts of 233c1be0bd to rvc-dev am: 3c12576942
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15473760

Change-Id: Ied3e486f490decd767d4ae3c7c63947bf41cdc64
2021-08-06 15:45:40 +00:00
Kousik Kumar 4d645c7791 resolve merge conflicts of 233c1be0bd to rvc-dev am: 3c12576942
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15473760

Change-Id: I2168fdd669b5ea1b73fce690609be8293fd9069a
2021-08-06 15:45:38 +00:00
Kousik Kumar 3c12576942 resolve merge conflicts of 233c1be0bd to rvc-dev
Bug: b/194679562

Change-Id: Icb42c43c1b4c8018b1402bd508271a0d4a052b14
Merged-In: I416e8da75f84aa2b53995f525cf50501488dc972
2021-08-05 20:16:26 +00:00
Kun Niu ce1dcf6a9f Use prebuild modules even when coverage is enabled.
Bug: 194323871
Test: local build passed.
Change-Id: I94a3922453473de7d754afce4b05ac3b6ae3765d
2021-08-05 18:15:28 +00:00
Kousik Kumar 233c1be0bd Merge "Load RBE related env vars from config files" am: b3a5d18470 am: 9f6fa868c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15454953

Change-Id: Ie1e7b2bdb392c33a286d7f52e0fee4ccf560b1b7
2021-08-05 18:08:31 +00:00
Kousik Kumar 9f6fa868c5 Merge "Load RBE related env vars from config files" am: b3a5d18470
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1773209

Bug: b/194679562
Change-Id: Id84167a3ae6ab15c8b74b72b4cc2c179e0da5d0c
Merged-In: I416e8da75f84aa2b53995f525cf50501488dc972
(cherry picked from commit a7ab7c9394ccfc80e163b5e405792a3975eaf2f3)
2021-08-03 13:22:44 -04:00
Mathew Inwood e6cc66da0e Merge "Build updatable-bcp-packages.txt from prebuilts in sdk snapshot" into sc-dev 2021-07-26 12:16:14 +00:00
Paul Duffin dbcc29647a Build updatable-bcp-packages.txt from prebuilts in sdk snapshot
Previously, the java_import and java_sdk_library_import modules did not
make their permitted_packages available to the rule that generates the
updatable-bcp-packages.txt file. This change corrects that.

Bug: 193095050
Test: m nothing
      - Added unit tests, which all failed and then fixed the tests.
Merged-In: If0706e4551a331b48d383123088e63924dded48b
Change-Id: If0706e4551a331b48d383123088e63924dded48b
(cherry picked from commit 630b11e9d4d63e5fabaa20adf5d1b1c81ede6681)
2021-07-23 09:42:28 +01:00
Chang Li 66d3cb727f Allowlist external/libtextclassifier for sdk_variant_only.
Bug: 166040889
Change-Id: If8a9d916dada116f52fd84194fa42e9179526b2c
2021-07-22 09:42:33 +00:00
Paul Duffin 7b3e10a1c2 Propagate permitted packages to sdk snapshot
Previously, permitted_packages were not copied to the sdk snapshot.
This change corrects that.

Bug: 193763688
Test: m nothing
      - Added unit tests, which all failed and then fixed the tests.
Merged-In: I4560987f746f78c0ae706058195b6db4bea438aa
Change-Id: I4560987f746f78c0ae706058195b6db4bea438aa
(cherry picked from commit 869de147abdb2c86a91cced4fda7d27746c52af4)
2021-07-15 16:00:11 +01:00
Ulya Trafimovich fa20b187dc Drop "prebuilt_" prefix when adding libraries to class loader context.
This is needed when some source libraries get replaced with prebuilt
variants: CLC should contain one entry for a library (the prebuilt one
or the source one, whichever of them is preferred). Because the prebuilt
module name starts with "prebuilt_" prefix, previously Soong considered
such libraries as two different ones libraries and added both to CLC.

Bug: 193425964

Test: mark "prebuilt_android.net.ipsec.ike" as preferred and `m nothing`
      (before this CL it would fail the build, now it builds fine).

Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd
      $ adb wait-for-device && \
        adb root && \
        adb logcat | \
        grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C 1
      # empty output, no errors
Change-Id: Icc42533d9915060d7fffda12aa93b9d18dc4f83d
Merged-In: Icc42533d9915060d7fffda12aa93b9d18dc4f83d
(cherry picked from commit 69c1aa94ac88bcb07f32c2ae4217776e82903068)
2021-07-15 11:17:24 +01:00
Martin Stjernholm 8410eb1551 Merge "Do not allow duplicate deapexer dependencies." into sc-dev 2021-07-12 09:01:43 +00:00
Paul Duffin d507060257 Merge "Generate boot images for host from prebuilts" into sc-dev 2021-07-07 09:02:20 +00:00
Paul Duffin 4ca4800023 Merge "Switch boot image generation to use GetGlobalSoongConfig(ctx)" into sc-dev 2021-07-07 09:02:13 +00:00
TreeHugger Robot 0618d4e9ec Merge changes from topic "revert-15071196-init_first_stage_soong-GBJXQRPEKC" into sc-dev
* changes:
  Revert "Add install_in_root to cc_binary"
  Revert "Add ramdisk_available to sysprop_library"
  Revert "Fix ndk and aml arch order"
2021-07-07 03:02:00 +00:00
Paul Duffin 6e89b54780 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
Merged-In: I6af00f19bb71aa18dd462f5eac6aa38e3e721023
Change-Id: I6af00f19bb71aa18dd462f5eac6aa38e3e721023
(cherry picked from commit a56be7d7815ad164cdd854f8fc6b1cbc3bbf1918)
2021-07-06 22:20:24 +01:00
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 8fc51a8eb6ca20dbb4b65822123201568bb297f1)
2021-07-06 22:20:24 +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 56afb27fb099cb79c1537c661628db1776f1fcc3)
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 56c93e899a355311463d41e988c9ba511af14278)
2021-07-06 13:34:25 +01: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
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
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 ef083c9556c53738e5d7a3ab791c49ef00501f73)
2021-07-01 17:20:53 +01: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
Paul Duffin 71e98fa303 Revert "Make bootclasspath_fragments always perform hidden API processing"
This reverts commit 2b255d7f6b.

Reason for revert: build breakage http://b/192554546

Bug: 179354495
Change-Id: Id758af3f59bc83b02d8af4b1b83b3f279a208595
2021-07-01 15:27:27 +00:00
Paul Duffin f4a65fee98 Merge "Make bootclasspath_fragments always perform hidden API processing" into sc-dev 2021-07-01 14:20:41 +00:00
Orion Hodson a8ea2833a2 Merge ""module_current" and "system_server_current" should contain ART's @SystemApi(MODULE_LIBRARIES)" into sc-dev 2021-07-01 13:48:57 +00:00
Paul Duffin 5842387832 Support using java_sdk_library components in stub_libs
Previously, if a bootclasspath_fragment had both a java_sdk_library
module and one of its components in stub_libs properties they would be
treated as separate modules instead of simply different APIs from the
same module. That would result in them both providing stub dex jars to
"hiddenapi list" which would fail because it found duplicate
definitions of the same class.

e.g. Specifying something like this:
    api: {
        stub_libs: [
            "art.module.public.api",
        ],
    },
    core_platform_api: {
        stub_libs: [
            "art.module.public.api.stubs.module_lib",
        ],
    },

would cause "hiddenapi list" to fail because it would have been passed
paths to two dex jars (actually the same dex jar but that does not
matter) each of which defined the same class, e.g. java.lang.Object.

This change treats the "art.module.public.api.stubs.module_lib" and
"art.module.public.api" modules as being the same for the purposes of
hidden API processing.

(cherry picked from commit 3f0290ef7940c70a491dcbd4b57cabd8b2e753ef)

Bug: 192446466
Test: m nothing
Merged-In: I9de96337f64f26e24cff040d4bbed9eecc67b1ed
Change-Id: I9e1cb82bea96022faaec98edc0c9ea7eac6204b0
2021-07-01 14:27:42 +01:00
Paul Duffin ba96f7c5b6 Ensure that systemserverclasspath_fragment does not depend on prebuilts
Bug: 190037398
Test: m nothing
Change-Id: I85671613c70bbfe8adde1d24d7f59ed7b53a8120
2021-07-01 12:24:12 +01:00
Paul Duffin 2b255d7f6b 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: I0cbf11986adff1f2f967b96f86e6bfe0e9b8b1ef
2021-07-01 11:56:41 +01:00