Commit graph

37782 commits

Author SHA1 Message Date
Colin Cross
e3fee34a3d Create toolchainBionic for the various bionic-based toolchains to inherit from
Host bionic and each of the device bionic architectures will share some
new toolchain functionality in common, create a toolchainBionic and embed
it into the toolchains.  Use it to implement Bionic() once and change
the default implementation from true to false.

Test: go test ./cc/...
Test: m checkbuild
Change-Id: Ia34b80d9691edc4ab1cbdbd005d1ffc950d0881c
2021-06-22 16:54:39 -07:00
Paul Duffin
99fc06f8ed Merge "Disable boot jars package check if no boot jars have been configured" 2021-06-22 18:28:16 +00:00
Paul Duffin
3302871b7d Add test for sdk that contains overlapping members
This change adds a test for an sdk that includes a java_sdk_library
directly as well as transitively includes one of the component modules
that it creates. It also adds a test for the names of a versioned
java_sdk_library_import's components as fixing one requires fixing the
other.

The use case added is one that does occur in the art-module-sdk. It has
a couple of pairs of java_sdk_library and java_system_modules that
cause both the java_sdk_library and one of its component modules to be
included in the sdk snapshot. That causes problems when building
against prebuilts.

e.g. The art-module-sdk_art.module.public.api.stubs module is a
duplicate of the art.module.public.api.stubs module created by the
art.module.public.api java_sdk_library_import. The former is added
because the art-module-public-api-stubs-system-modules depends on it.

A follow up change will avoid the component being added to the sdk
snapshot separately and instead cause the snapshot to use the
component created by the java_sdk_library_import in the snapshot.

Bug: 179354495
Test: m nothing
Change-Id: Ifdc1b4a5a7968db2ded3fdb7eb02f9cff77c7c3f
2021-06-22 16:07:27 +01:00
Paul Duffin
9ffbecc2c8 Disable boot jars package check if no boot jars have been configured
Some build configurations do not configure boot jars. In those cases
the boot jars package check fails so should be skipped.

Bug: 177892522
Test: m nothing
      lunch fvp_mini && m
Change-Id: I5498a8f5cdfb2fabf5223e94dfcee0e853059d01
2021-06-22 14:55:30 +01:00
Paul Duffin
86fe8f8514 Remove unused apiModuleName
Bug: 179354495
Test: m nothing
Change-Id: Id1dd09a11c63981b32af524cffcdbd177c8f0232
2021-06-22 12:45:07 +01:00
Paul Duffin
a1a2baf8a7 Merge "Fix monolithic hidden API processing with prebuilts" 2021-06-22 11:44:11 +00:00
Paul Duffin
f93d38835c Merge "Fix bootDexJarByModule with UNSAFE_DISABLE_HIDDENAPI_FLAGS" 2021-06-22 09:37:17 +00:00
Colin Cross
e7d190866a Merge "Add --skip-config flag to soong_ui.bash" 2021-06-21 17:14:47 +00:00
Paul Duffin
07cdd37ae5 Merge "Make CheckHiddenAPIRuleInputs more reusable" 2021-06-21 16:16:12 +00:00
Paul Duffin
9d31361873 Merge "Use classpath elements in platform_bootclasspath" 2021-06-21 16:16:00 +00:00
Adrian Roos
e95a15e7c7 Fix bootDexJarByModule with UNSAFE_DISABLE_HIDDENAPI_FLAGS
Fixes: 191652687
Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true m
Change-Id: I7d85340681e54fbd0da69596b6846eb446c6ec6d
2021-06-21 14:55:19 +00:00
Treehugger Robot
789093a9ad Merge "Direct Bazel builds from m." 2021-06-21 08:16:21 +00:00
Treehugger Robot
348f20be0e Merge "AIDEGen: Collect dependencies info from APEX module." 2021-06-21 07:17:28 +00:00
Jingwen Chen
c63677b3c9 Direct Bazel builds from m.
This CL adds support to bp2build/Soong to dump a BUILD file under
out/soong/soong_injection/targets containing alias targets to their real
targets for every converted Soong module, regardless of whether they are
handcrafted or generated.

Test: TH
Change-Id: Ic1816fda5d019c395301618134fac68b3057d752
2021-06-21 06:12:34 +00:00
Xin Li
9e2dcbd080 Merge "DO NOT MERGE - Merge RQ3A.210605.005" 2021-06-21 05:49:09 +00:00
Paul Duffin
d061d40eb6 Fix monolithic hidden API processing with prebuilts
Prebuilt modules do not provide classesJars containing annotations.
Previously, the monolithic hidden API processing just used classesJars
from all the modules that provided them so when building against
prebuilts would have fewer classesJars than when building against
sources and so would produce different hidden API flags.

This change will generate the monolithic files from both classesJars
and files previously generated from hidden API processing. A fragment
that has performed hidden API processing will contribute its generated
files whereas standalone libraries and fragments which have not
performed hidden API processing will contribute classesJars.

Bug: 177892522
Test: m out/soong/hiddenapi/hiddenapi-flags.csv
      m SOONG_CONFIG_art_module_source_build=false out/soong/hiddenapi/hiddenapi-flags.csv
      - verify that the files are identical whether built from
        source or prebuilts.
Change-Id: I06f3c7df49626bec21a452bc9abf1bb9e7545e5c
2021-06-20 19:09:09 +01:00
Paul Duffin
51d7da2c4e Make CheckHiddenAPIRuleInputs more reusable
Adds a message parameter and allows leading spaces in the expected file
string to allow them to be nicely indented.

Bug: 177892522
Test: m nothing
Change-Id: I33df26610738c48879fa0b8250dc377dd04bb07d
2021-06-20 19:09:09 +01:00
Paul Duffin
89f570ac44 Use classpath elements in platform_bootclasspath
Use classpath elements in newMonolithicHiddenAPIInfo. That means the
method can collate information from both fragments and libraries rather
than just fragments. So, this change moves the collation of the
classesJars into the method.

Bug: 177892522
Test: m out/soong/hiddenapi/hiddenapi-flags.csv out/soong/hiddenapi/hiddenapi-index.csv
      - make sure that this change does not affect the contents.
Change-Id: I7c2a229fab60d02bd211438735a8d7303ed83386
2021-06-20 19:09:09 +01:00
Paul Duffin
0d7f2d30b5 Merge "Simplify deapexer support" 2021-06-20 18:08:41 +00:00
Paul Duffin
6b592bdcdc Merge "Remove javalib special case in createDeapexerModuleIfNeeded" 2021-06-20 18:08:29 +00:00
Xin Li
4a5f1256e8 DO NOT MERGE - Merge RQ3A.210605.005
Bug: 190855093
Merged-In: Ie1f9147e02f79062d1a17dca5f61ff518a2ae5a6
Change-Id: I34d36eeeef40d372c0585b90685a2cee7e37a1a8
2021-06-18 15:41:15 -07:00
Treehugger Robot
d430ddd0c5 Merge "Allow disabling errorprone even when RUN_ERROR_PRONE is true" 2021-06-18 21:37:39 +00:00
Cole Faust
2b1536e4db Allow disabling errorprone even when RUN_ERROR_PRONE is true
Some modules use -XepDisableAllChecks to disable errorprone.
However, this still causes them to be compiled twice when
RUN_ERROR_PRONE is true. Allow the new enabled property to
be set to false to disable errorprone entirely, so that those
modules are only compiled once.

Bug: 190944875
Test: New unit tests
Change-Id: Ie68695db762fffcaf11bbbcb0509c4fcab73f5c5
2021-06-18 12:34:51 -07:00
Treehugger Robot
79c4bdb3fe Merge "[cc/pgo] Mark pgo.sampling property as an arch-variant" 2021-06-18 19:09:26 +00:00
Colin Cross
30e444be67 Add --skip-config flag to soong_ui.bash
--skip-config can be combined with --soong-only to skip creating
soong.variables from Make, allowing a custom soong.varibles.

Test: manual
Change-Id: Iee9bfa4efeed801339e7c3c1e4807709485e701a
2021-06-18 11:26:19 -07:00
Paul Duffin
e6aefedeba Merge "Add ClasspathElement support" 2021-06-18 18:13:06 +00:00
Pirama Arumuga Nainar
8195cdf8e3 [cc/pgo] Mark pgo.sampling property as an arch-variant
Bug: http://b/189438896

This allows disabling sampling PGO for some arches.

Test: Build this topic.
Change-Id: Ib6ddca6685c2e53092afd440ad95ec42d3a9538b
Merged-In: Ib6ddca6685c2e53092afd440ad95ec42d3a9538b
(cherry picked from commit 19a5aae35e)
2021-06-18 11:11:46 -07:00
Inseob Kim
957ef7a648 Merge changes from topic "init_first_stage_soong"
* changes:
  Fix ndk and aml arch order
  Add ramdisk_available to sysprop_library
  Add install_in_root to cc_binary
2021-06-18 17:12:23 +00:00
Paul Duffin
e91f1537e2 Merge "Extract createEntriesForApexFile" 2021-06-18 17:11:29 +00:00
Nikita Ioffe
59b8d28cf6 Merge "Set default value of generate_hashtree property to true" am: f932613c3f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1736785

Change-Id: Ie1f9147e02f79062d1a17dca5f61ff518a2ae5a6
2021-06-18 13:27:46 +00:00
Nikita Ioffe
f932613c3f Merge "Set default value of generate_hashtree property to true" 2021-06-18 13:14:22 +00:00
Paul Duffin
e245b61aa2 Add ClasspathElement support
The configuration of the bootclasspath, e.g. PRODUCT_BOOT_JARS,
includes libraries that are standalone and libraries that are part of
an APEX. All libraries that are part of an APEX must also be part of a
bootclasspath_fragment. Currently, the libraries and fragments are
handled separately but that is limiting as it does not make it easy to
process all the libraries while treating those from fragments
differently to standalone libraries. That is needed for hidden API
processing as it needs to use classesJars from standalone libraries
but pre-generated flag files from fragments.

This change adds support for ClasspathElements which is represents the
classpath as a whole while differentiating between standalone libraries
and fragments.

Bug: 177892522
Test: m nothing
Change-Id: I7a4adc67164a46079eb8ec0a17fc755044b4949d
2021-06-18 11:46:52 +01:00
satayev
6ea9e45d9c Merge "Add classpath fragment property to skip proto generation." am: f45966f35b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1738336

Change-Id: I153af3111b835ce3bbfb56b9d91cf43269285ee4
2021-06-18 10:29:26 +00:00
satayev
f45966f35b Merge "Add classpath fragment property to skip proto generation." 2021-06-18 10:17:50 +00:00
Paul Duffin
c4a3e6d2f3 Export boot image files from prebuilt_apex/apex_set am: 5466a3699c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1736777

Change-Id: I1cf84ff519ca6865d3a87ae75b1f48fc6ed1e3f4
2021-06-18 06:48:21 +00:00
Paul Duffin
56a6834640 Copy boot dex jars from prebuilt art-bootclasspath-fragment if preferred am: ce918b0278
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1736226

Change-Id: I116ef8467e180b691ba6e6f2bcf38cd275f6ecba
2021-06-18 06:47:41 +00:00
Paul Duffin
155c17779c Extract createEntriesForApexFile
While this seems like a simple refactoring it does actually fix an
issue. Previously, when the ExtraEntries func was being defined inline
within the for ... loop it used the loop variable "fi". Unfortunately,
that meant that the func created on each iteration ended up using the
value for "fi" that was set on the last iteration.

Extracting the creation of the entry into a separate method means that
each func created gets its own "fi" variable with the correct values.

Bug: 177892522
Test: m SOONG_CONFIG_art_module_source_build=false nothing
      - without this change it reported duplicate rules for apache-xml.jar
        which is the last entry in the art-bootclasspath-fragment. With
        this change it works fine.
Change-Id: Ia063b513f758e1bbe73407c0441b72453f412acf
2021-06-18 07:43:32 +01:00
Xin Li
ea50a05063 DO NOT MERGE - Mark RQ3A.210410.001 as merged
Bug: 190855093
Merged-In: I33b074204ffba5aa2bf83bbbe350d744ee9d8c57
Change-Id: I50911f727ba98df1035500dbbf467b849be8d6c2
2021-06-17 22:43:25 -07:00
Inseob Kim
5219c0e4bf Fix ndk and aml arch order
Some codes assume that the first arch is the primary arch. But ndk/aml
arch order have been [arm, arm64, x86, x86_64]. This fixes the order to
workaround possible breakage while building ndk.

Bug: 187196593
Test: OUT_DIR=out build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I33164a7e7c64a23f2cc1860acb24a2584f4dffad
2021-06-18 05:26:39 +00:00
Inseob Kim
9da1f81382 Add ramdisk_available to sysprop_library
Bug: 187196593
Test: build
Change-Id: Ib8d92904a9004ccbc18634a97f9d75c2093ac2ae
2021-06-18 05:26:33 +00:00
Inseob Kim
800d114003 Add install_in_root to cc_binary
To support init_first_stage, install_in_root property is added to
cc_binary. The output is installed to {partition}, rather than
{partition}/{mount_point}/bin.

Bug: 187196593
Test: build init_first_stage
Change-Id: Ibc351645308676ed188f748972eb6312c9cbd64f
2021-06-18 05:25:44 +00:00
TreeHugger Robot
aee99b3a13 Merge "DO NOT MERGE - Merge ab/7272582" into stage-aosp-master 2021-06-18 00:30:18 +00:00
Paul Duffin
5466a3699c Export boot image files from prebuilt_apex/apex_set
Previously, the prebuilt art-bootclasspath-fragment did not provide any
boot image files. That meant it was impossible to build any module that
requires access to those files from prebuilts, e.g. any module that
needs to be dexpreopt-ed.

This change enables that module to retrieve those files from the
prebuilt_apex.

Bug: 177892522
Bug: 189298093
Test: m nothing
      m droid SOONG_CONFIG_art_module_source_build=false SKIP_BOOT_JARS_CHECK=true
      - the previous command does not work but this change does fix one
        of the issues reported.
Change-Id: I1d4d9545172d79282918130df6b9aa55471bffc1
2021-06-17 23:05:43 +01:00
Paul Duffin
ce918b0278 Copy boot dex jars from prebuilt art-bootclasspath-fragment if preferred
Previously, the boot dex jars were only copied to the predefined
locations used by the build from the source art-bootclasspath-fragment
if it was preferred, otherwise no files were copied. That caused build
failures when attempting to build with ART prebuilts. This change
copies the files from prebuilts too.

Bug: 177892522
Bug: 189298093
Test: m nothing
      m droid SOONG_CONFIG_art_module_source_build=false SKIP_BOOT_JARS_CHECK=true
      - the previous command does not work but this change does fix one
        of the issues reported.
Change-Id: I35b37355170546daf6ecac2134d1ca9a73d0e3bc
2021-06-17 23:05:43 +01:00
Xin Li
007875cd10 DO NOT MERGE - Merge ab/7272582
Bug: 190855093
Merged-In: I0f5da13644fd2ec7b0472fe82918e3c6a72d953c
Change-Id: I33b074204ffba5aa2bf83bbbe350d744ee9d8c57
2021-06-17 21:41:17 +00:00
Paul Duffin
d11c1c8fa4 Merge "Copy implementation and header jars to make when possible" am: 94b2e705d1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1740074

Change-Id: I5faab59bcde87b6be2e1b21ec9e85bdd75a5f687
2021-06-17 20:46:57 +00:00
Paul Duffin
eaae506467 Exclude jacocoagent from boot jars package check am: 7f8721618c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1739993

Change-Id: I83ba8899b202dd89ee613543eead69ab1f88ac4c
2021-06-17 20:37:45 +00:00
Paul Duffin
94b2e705d1 Merge "Copy implementation and header jars to make when possible" 2021-06-17 20:34:49 +00:00
Paul Duffin
85fa344d09 Copy implementation and header jars to make when possible
Fixes test issues caused by a jar containing a classes.dex file was
copied to a place that was expected a jar containing class files.

Bug: 191360201
Test: - in master-art
      find out/ -name \*core-icu4j\* | xargs rm -fr
      art/tools/buildbot-build.sh --target --installclean
      art/tools/bootjars.sh --path --core
      - examine file output from previous script for core-icu4j,
        before this change it contained classes.dex file after this
        change it contained *.class files.
Change-Id: I05ecf652535ec097125fb76d6ca80fee6587f98d
2021-06-17 20:33:54 +01:00
Paul Duffin
7f8721618c Exclude jacocoagent from boot jars package check
This replicates the previous behavior when the boot jars package check
was performed by a singleton. When the singleton was removed and the
check was performed by the platform-bootclasspath the logic to exclude
jacocoagent from the list was lost. This change replaces it.

Bug: 191377804
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true check-boot-jars
      - fails without this change passes with this change.
Change-Id: If9eae254045bef9a0c0963213721fc12a9f463cb
2021-06-17 19:33:24 +01:00