apex_set modules failed to set prebuiltCommon.installedFile, which
caused LOCAL_SOONG_INSTALLED_MODULE to be empty and base_rules.mk
to create a duplicate install rule. Set it to the path to the
apex file installed by Soong.
Bug: 204136549
Bug: 209867137
Test: m SOONG_CONFIG_art_module_source_build=false
Change-Id: Ia7fec09598823343242ebd44f1732e6bba21d027
Move apex module installation rules into Soong by overriding
InstallBypassMake.
Soong installs don't support post install commands, so move the
symlinks into separate rules and add dependencies on them.
This relands If65d283abc86f18ad266da0bf16fe95971a0bf9c with fixes
to install files into $OUT/apex and I606286e971b55d9d1fc4dcd0fbd476962de5fa79
with a fix for reversed logic.
Bug: 204136549
Test: m checkbuild
Change-Id: Ie65c53ebc7911efacdb8e11ba49059448f03c658
Move apex module installation rules into Soong by overriding
InstallBypassMake.
Soong installs don't support post install commands, so move the
symlinks into separate rules and add dependencies on them.
Bug: 204136549
Test: m checkbuild
Change-Id: If65d283abc86f18ad266da0bf16fe95971a0bf9c
A prebuilt_apex/apex_set module can make a dex implementation jar
available for use by Make targets but it does not have access to a real
classes implementation jar; the jar in the corresponding sdk is just an
empty file. Exporting that invalid file to Make means that the phony
target created for the module depends on an invalid classes jar which
causes the build to fail.
This change removes the logic that make classes and header jars
available to Make so that building the phony target no longer fails.
Bug: 202521005
Test: m TARGET_PRODUCT=armv8 TARGET_PRODUCT_VARIANT=eng TARGET_BUILD_UNBUNDLED=true SOONG_ALLOW_MISSING_DEPENDENCIES=true core-icu4j
- above was performed in master-art.
Change-Id: If667b36b988e2d331acd85f60f3369778838d034
This is for exporting the contents of systemserverclasspath_fragment for
dexpreopting.
Bug: 194150908
Test: manual - 1. Patch aosp/1818020 and aosp/1834534
2. m SOONG_CONFIG_art_module_source_build=false com.android.art
Change-Id: I7d2d2e02869d8a523f7c0efbbff81706672a95c5
It will get more logic in upcoming CLs.
Add a property to DeapexerInfo for the APEX name, for use in error
messages.
Test: m nothing
Bug: 192006406
Change-Id: I957f3df8b34543a38cde38768dac93e78132d672
invalid with a message.
This will allow propagating any error from the deapexer module for
prebuilt APEXes to the location where the dex jars get used. It's only
at those points that we can raise errors about not being able to
extract files from the deapexer modules if they are invalid, and this
way we avoid encoding knowledge there about why they may be invalid.
To keep the refactoring limited it intentionally does not change any of
the existing logic for when dexJarFiles are set or not (non-nil vs nil
prior to this change), although there may be opportunity to use this
for more conditions when dex jars aren't available.
The refactoring is also not extended to
dexpreopt.ClassLoaderContextMap.
Test: m nothing
Bug: 192006406
Change-Id: I68986dccd9a9b3fee4d24caa1947ea17a36caedc
Similar to the previous CL, but for jars from prebuilts.
Test: manual - 1. Patch aosp/1818020 and aosp/1810840.
2. m SOONG_CONFIG_art_module_source_build=false com.android.art
Bug: 194150908
Change-Id: Idc0c73a78045a602ad3a91cb5071d291bd611015
Compressed APEX files generated by the build system have the .capex
extension. This CL allows us using those .capex files with their actual
suffix.
Bug: 197258691
Test: manual + unit test added
Change-Id: I79173ef942326b48b5e659f1873d80f12b212339
Previously, when determining which dependencies, direct or transitive,
of a prebuilt_apex/apex_set required APEX variants the code assumed
that all dependencies implemented ApexModule. While that is true for
the modules that can be explicitly mentioned in the exported...
properties it is not true for all of them. e.g. A
prebuilt_apex/apex_set can depend on license modules which do not
implement ApexModule.
This change simply ignores any module that does not implement
ApexModule.
Bug: 179354495
Test: m nothing
Merged-In: Iead6f9d1085d169335b88ceadcce2d8cc042254d
Change-Id: Iead6f9d1085d169335b88ceadcce2d8cc042254d
(cherry picked from commit fee8cf36e3)
Previously, when determining which dependencies, direct or transitive,
of a prebuilt_apex/apex_set required APEX variants the code assumed
that all dependencies implemented ApexModule. While that is true for
the modules that can be explicitly mentioned in the exported...
properties it is not true for all of them. e.g. A
prebuilt_apex/apex_set can depend on license modules which do not
implement ApexModule.
This change simply ignores any module that does not implement
ApexModule.
Bug: 179354495
Test: m nothing
Change-Id: Iead6f9d1085d169335b88ceadcce2d8cc042254d
Add an apex_name property to prebuilt APEX modules to allow specifying
the "runtime" name of the APEX, i.e. the one it gets mounted as in /apex/,
which is also the one used for the apex variations.
Introduce a callback to retrieve that name consistently for all APEX
modules (apex, override_apex, prebuilt_apex, and apex_set), and update
some apex mutator code paths to use it.
For APEX source modules (apex and override_apex), it's necessary to add
a new field in apexBundle, since the name property gets overridden for
the override variant that override_apex creates.
Cherry-picked from https://r.android.com/1748294.
Test: m nothing
Bug: 191269918
Change-Id: If8612639bffdf91cbcab3387b0603bf5dffef1f5
Merged-In: If8612639bffdf91cbcab3387b0603bf5dffef1f5
Add an apex_name property to prebuilt APEX modules to allow specifying
the "runtime" name of the APEX, i.e. the one it gets mounted as in /apex/,
which is also the one used for the apex variations.
Introduce a callback to retrieve that name consistently for all APEX
modules (apex, override_apex, prebuilt_apex, and apex_set), and update
some apex mutator code paths to use it.
For APEX source modules (apex and override_apex), it's necessary to add
a new field in apexBundle, since the name property gets overridden for
the override variant that override_apex creates.
Test: m nothing
Bug: 191269918
Change-Id: If8612639bffdf91cbcab3387b0603bf5dffef1f5
Uses the apex relative path to the file as the identifier that is used
to obtain the path to the corresponding file extracted from the apex.
That is instead of a special constructed string id.
Bug: 177892522
Test: m nothing
Merged-In: I5dc77c8fb272bac289b8891d1eac801e541af1f5
Change-Id: I5dc77c8fb272bac289b8891d1eac801e541af1f5
(cherry picked from commit b4bbf2ca10)
Removes the special case in createDeapexerModuleIfNeeded for handling
java libraries and just get the Import and SdkLibraryImport module
types to implement RequiredFilesFromPrebuiltApex instead.
Bug: 177892522
Test: m nothing
Merged-In: I5cc341b5b4168b8eb196f72273a00d498de6856f
Change-Id: I5cc341b5b4168b8eb196f72273a00d498de6856f
(cherry picked from commit fef5500a76)
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.
Merged-In: Ia063b513f758e1bbe73407c0441b72453f412acf
Change-Id: Ia063b513f758e1bbe73407c0441b72453f412acf
(cherry picked from commit 155c17779c)
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.
Merged-In: I1d4d9545172d79282918130df6b9aa55471bffc1
Change-Id: I1d4d9545172d79282918130df6b9aa55471bffc1
(cherry picked from commit 5466a3699c)
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.
Merged-In: I05ecf652535ec097125fb76d6ca80fee6587f98d
Change-Id: I05ecf652535ec097125fb76d6ca80fee6587f98d
(cherry picked from commit 85fa344d09)
Previously, the apex variants of modules exported from prebuilt_apex
and apex_set modules were not exported to make. Neither by the modules
themselves or by the prebuilt apex module. The master-art build relied
on the platform variants of the conscrypt and core-icu4j libraries
being exported to make so that they could be used by vogar.
Unfortunately, a change to export the prebuilt_bootclasspath_fragment
modules that contain the conscrypt and core-icu4j prebuilt libraries
from the corresponding prebuilt_apex prevented the platform variants
of those libraries from being exported at all which broke the
master-art builds as it only has prebuilts of those modules. It did not
break the aosp/master build as that has source modules.
The difference between the two builds is that the apex module type
makes its contents available in make but the prebuilt_apex/apex_set
module types do not.
This change causes the prebuilt_apex/apex_set module types to behave
more like the apex module type by making its exported libraries
available in make.
Bug: 179354495
Test: m droid
- in aosp/master
art/tools/buildbot-build.sh --target --installclean
- in master-art and aosp/master
Merged-In: I57537d17d4920d37d896ed491c6aaa15302cb25d
Change-Id: I57537d17d4920d37d896ed491c6aaa15302cb25d
(cherry picked from commit a35f8db127)
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
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
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
Uses the apex relative path to the file as the identifier that is used
to obtain the path to the corresponding file extracted from the apex.
That is instead of a special constructed string id.
Bug: 177892522
Test: m nothing
Change-Id: I5dc77c8fb272bac289b8891d1eac801e541af1f5
Removes the special case in createDeapexerModuleIfNeeded for handling
java libraries and just get the Import and SdkLibraryImport module
types to implement RequiredFilesFromPrebuiltApex instead.
Bug: 177892522
Test: m nothing
Change-Id: I5cc341b5b4168b8eb196f72273a00d498de6856f
Previously, the apex variants of modules exported from prebuilt_apex
and apex_set modules were not exported to make. Neither by the modules
themselves or by the prebuilt apex module. The master-art build relied
on the platform variants of the conscrypt and core-icu4j libraries
being exported to make so that they could be used by vogar.
Unfortunately, a change to export the prebuilt_bootclasspath_fragment
modules that contain the conscrypt and core-icu4j prebuilt libraries
from the corresponding prebuilt_apex prevented the platform variants
of those libraries from being exported at all which broke the
master-art builds as it only has prebuilts of those modules. It did not
break the aosp/master build as that has source modules.
The difference between the two builds is that the apex module type
makes its contents available in make but the prebuilt_apex/apex_set
module types do not.
This change causes the prebuilt_apex/apex_set module types to behave
more like the apex module type by making its exported libraries
available in make.
Test: m droid
- in aosp/master
art/tools/buildbot-build.sh --target --installclean
- in master-art and aosp/master
Change-Id: I57537d17d4920d37d896ed491c6aaa15302cb25d
Moves common properties, fields and method into the prebuiltCommon
type.
One slight change is that this change causes the Prebuilt module to use
the outputApex when generating the AndroidMkEntries instead of the
inputApex that it used before. They are the exact same files as the
inputApex is simply copied to the outputApex. The only impact will be
on build time as some rules now depend on the cp rule being run when
they did not before and the base name of the file may be different.
Test: m droid
- check generated out/soong/Android...mk file before and after
to make sure the only difference is due to switching from the
inputApex to outputApex.
Bug: 179354495
Change-Id: I8437af00d6bb7d0d339f25b3b02cd1cf67d6938a
Merged-In: I8437af00d6bb7d0d339f25b3b02cd1cf67d6938a
Moves common properties, fields and method into the prebuiltCommon
type.
One slight change is that this change causes the Prebuilt module to use
the outputApex when generating the AndroidMkEntries instead of the
inputApex that it used before. They are the exact same files as the
inputApex is simply copied to the outputApex. The only impact will be
on build time as some rules now depend on the cp rule being run when
they did not before and the base name of the file may be different.
Test: m droid
- check generated out/soong/Android...mk file before and after
to make sure the only difference is due to switching from the
inputApex to outputApex.
Bug: 179354495
Change-Id: I8437af00d6bb7d0d339f25b3b02cd1cf67d6938a
Merged-In: I8437af00d6bb7d0d339f25b3b02cd1cf67d6938a
Neither InApexVariants nor InApexModules should have them. This allows
us to get rid of InApexVariantByBaseName as well.
Test: m nothing
Test: m nothing SOONG_CONFIG_art_module_source_build=false
Bug: 180325915
Change-Id: Icbe4e025ce1a4c8dd258ff95d326ca2f27905188
Consider this case:
apex {
name: "com.android.foo",
native_libs: ["foo"],
}
override_apex {
name: "com.mycompany.android.foo",
base: "com.android.foo",
}
cc_library {
name: "foo",
}
There are two APEXes defined: "com.android.foo" and
"com.mycompany.android.foo" which is a copy of "com.android.foo" with
some properties overridden (e.g. signing keys).
The module "foo" is mutated into two variants by the apex mutator: the
platform variant and the apex variant. The former has the variation name
"" and the later has "apex<min_api_ver>" which usually is "apex10000".
Internally, the apex variant has an alias "com.android.foo".
ApexInfo.InApexVariants() returns only "com.android.foo" when called for
the module "foo".
We can see that the information that "foo" is also part of
"com.mycompany.android.foo" is completely lost. This is causing problem
when we compare the apex membership by their "soong module name", not
the "apex name". In the example above, the two modules have different
soone module names, but have the same apex name: "com.android.foo".
To fix that, this CL introduces a new field `InApexes` to the `ApexInfo`
struct. It has the actual name of the APEXes that the module is part of.
With the example above, `InApexes` is ["com.android.foo",
"com.mycompany.android.foo"].
Cherry-picked from https://r.android.com/1710529.
Bug: 180325915
Test: m nothing
Test: m nothing on non-AOSP targets with ag/13740887 applied.
Change-Id: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e
Merged-In: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e
.. in preparation for the upcoming change. This change doesn't alter any
behavior.
InApexes is a misleading name. People expects that it has the list of
soong module names of the APEXes that a module is part of. So, for
example, `core-oj` is a part of both `com.android.art` and
`com.google.android.art`. However, in reality, that's not true. The
field has `com.android.art` only. This is because the two APEXes
(android and Google) have the same apex name which is `com.android.art`.
That apex name is used in various places like the `apex_available` and
allows us to keep using the same name regardless of whether the APEX is
overridden or not.
However, this is causing problems in some cases where the exact list of
soong module names is required. The upcoming change will add a new field
to handle the case and the new field actually will get the name
'InApexes'. So, the existing field is renamed to a less misleading name
`InApexVariants`.
Cherry-picked from https://r.android.com/1710528.
Bug: 180325915
Test: m nothing
Change-Id: I0c73361b452eddb812acd5ebef5dcedaab382436
Merged-In: I0c73361b452eddb812acd5ebef5dcedaab382436
Consider this case:
apex {
name: "com.android.foo",
native_libs: ["foo"],
}
override_apex {
name: "com.mycompany.android.foo",
base: "com.android.foo",
}
cc_library {
name: "foo",
}
There are two APEXes defined: "com.android.foo" and
"com.mycompany.android.foo" which is a copy of "com.android.foo" with
some properties overridden (e.g. signing keys).
The module "foo" is mutated into two variants by the apex mutator: the
platform variant and the apex variant. The former has the variation name
"" and the later has "apex<min_api_ver>" which usually is "apex10000".
Internally, the apex variant has an alias "com.android.foo".
ApexInfo.InApexVariants() returns only "com.android.foo" when called for
the module "foo".
We can see that the information that "foo" is also part of
"com.mycompany.android.foo" is completely lost. This is causing problem
when we compare the apex membership by their "soong module name", not
the "apex name". In the example above, the two modules have different
soone module names, but have the same apex name: "com.android.foo".
To fix that, this CL introduces a new field `InApexes` to the `ApexInfo`
struct. It has the actual name of the APEXes that the module is part of.
With the example above, `InApexes` is ["com.android.foo",
"com.mycompany.android.foo"].
Bug: 180325915
Test: m nothing
Test: m nothing on non-AOSP targets with ag/13740887 applied.
Change-Id: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e
.. in preparation for the upcoming change. This change doesn't alter any
behavior.
InApexes is a misleading name. People expects that it has the list of
soong module names of the APEXes that a module is part of. So, for
example, `core-oj` is a part of both `com.android.art` and
`com.google.android.art`. However, in reality, that's not true. The
field has `com.android.art` only. This is because the two APEXes
(android and Google) have the same apex name which is `com.android.art`.
That apex name is used in various places like the `apex_available` and
allows us to keep using the same name regardless of whether the APEX is
overridden or not.
However, this is causing problems in some cases where the exact list of
soong module names is required. The upcoming change will add a new field
to handle the case and the new field actually will get the name
'InApexes'. So, the existing field is renamed to a less misleading name
`InApexVariants`.
Bug: 180325915
Test: m nothing
Change-Id: I0c73361b452eddb812acd5ebef5dcedaab382436
Previously, the deapexer module had to duplicate the java library
specific logic for constructing the path to the library's dex file in
the .apex file. That is not something that the deapexer needs to be
aware of, all it needs is a list of files that should be exported.
This change moves that logic into the prebuilt_apex/apex_set modules
and generalizes the deapexer module so that it can export any files
that are requested.
The deapexer module does still need to know which java modules need
access to exported files so it can add dependencies from them onto
itself. However, it does not need to know what the type of the module
is.
Bug: 186455808
Test: m nothing
m SOONG_CONFIG_art_module_source_build=false nothing
Change-Id: I71c6f0f761efe3b6d66d54273786e98cd545811c
Moves all properties common to prebuilt_apex and apex_set module types
into prebuiltCommonProperties. Removes selectedApexProperties from
Prebuilt as that duplicated, and masked, the same property in
prebuiltCommon.
Bug: 187266082
Test: m nothing
m SOONG_CONFIG_art_module_source_build=false nothing
- this fails but not because of missing APEX variants
Change-Id: Ice7dfb8e18bb526fdd5b41bcd518c6971564d81b
Previously, the deapexer module properties were simply passed through
from the prebuilt_apex/apex_set modules. This change derives the
properties from the transitive dependencies of the modules so that it
can automatically include the contents of a bootclasspath_fragment
module without having to duplicate them in the exported_java_libs
property.
Part of this change involves moving the addition of dependencies onto
the prebuilt apex's contents from DepsMutator to ComponentDepsMutator
so that they can be visited in the createDeapexerModule() function. The
ComponentDepsMutator runs before prebuilts without matching sources are
renamed to match the source name which simplifies the process of adding
dependencies directly onto the prebuilts.
The deapexerDeps method was renamed as the dependencies are added both
for use by deapexer and also to create APEX variants for access by
platform_bootclasspath so the name was confusing.
Bug: 187266082
Test: m nothing
m SOONG_CONFIG_art_module_source_build=false nothing
- this fails but not because of missing APEX variants
Change-Id: Icb4f883e7d2b63739e5ff0dc6edb8a906d80189b