Commit graph

2571 commits

Author SHA1 Message Date
Colin Cross
790ef35d1e Make HostToolPath, HostJNIToolPath and sboxPathForToolRel use pathForInstall
Use pathForInstall instead of PathForOutput for HostToolPath,
HostJNIToolPath and sboxPathForToolRel so that they internally produce
an InstallPath that can later support being converted to Make install
path.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie16a62641d113873daeec4d1dd4261251bc0d0eb
2021-10-29 16:34:55 -07:00
Colin Cross
a44551fec6 Add PathForGoBinary
Add PathForGoBinary that uses pathForInstall to return the install
path of a GoBinaryTool.  This will replace various places that used
PathForOutput to reconstruct a path to a Go tool, and will support
moving Go tools to the Make install directory outside of the
PathForOutput directory in a future patch.

Bug: 204136549
Test: m checkbuild
Change-Id: I83a3be9f5c621975540f5ed601a0b9e2611c98b9
2021-10-29 16:34:55 -07:00
Sophie Zheng
7fe4ccafc1 Merge "Save all the detected native shared library backing by mainline modules." 2021-10-21 18:42:35 +00:00
Paul Duffin
eb8051d80d Remove artApex parameter from ApexBundleFactory
Since coverage support was added to bootclasspath_fragment in
https://r.android.com/1684807 and bootclasspath_fragments were
integrated into the ART APEX it is no longer necessary to treat ART
APEXes differently to other APEXes.

Change https://r.android.com/1684807 added coverage support, follow
up changes integrated

Bug: 177892522
Test: m droid
      m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true
Change-Id: I4800a003c7459c4686607e16f4c5bde0be105f16
2021-10-20 10:29:14 +00:00
sophiez
9a6eabf952 Save all the detected native shared library backing by mainline modules.
Test: TARGET_BUILD_APPS=com.google.android.adbd m dist apps_only

Change-Id: I510292542bf2550c9244e9374cd6f7b40a971486
2021-10-19 14:33:57 -07:00
Dan Willemsen
47e1a75851 Fix mac/allowmissingdeps builds
This WalkDeps loop was expecting the dependencies to be fully filled
out, which isn't necessarily true on AllowMissingDependencies builds,
especially on Mac when the modules may exist, but not be enabled.

This was triggered when make_erofs was added to an apex, but wasn't
enabled on Mac.

It shouldn't be a problem to skip the disabled dependencies, since we'll
have already marked the current module as missing dependencies, which
means it won't actually get built.

Test: `m nothing` on a mac
Change-Id: Icd6d597117be4cde5bff041be3fd47361c54cad9
2021-10-17 01:40:34 +00:00
Mohammad Islam
214a923f0d Merge "Add EROFS support for APEX build system" 2021-10-15 15:44:47 +00:00
Jiyong Park
ddf4ebae19 Merge "Remove use_apex_name_macro" 2021-10-14 02:32:43 +00:00
Jiyong Park
91f1b42226 Remove use_apex_name_macro
The property is no longer used.

Bug: 161926892
Test: m
Change-Id: I98948152d6d09bde2eeba4875c7ca01531a24930
2021-10-14 08:57:59 +09:00
Paul Duffin
13dd220448 Merge "Stop prebuilt_apex/apex_set exporting invalid jars to Make" 2021-10-13 14:53:17 +00:00
Jiakai Zhang
470b7e22a7 Add more tests for dexpreopting.
This CL adds more tests to ensure that dexpreopted files are generated
and APEXes depends on them.

Bug: 201371822
Test: m nothing
Change-Id: I407ad54c55cbca9ef78bbd335e95d4b765e174a0
2021-10-12 03:25:52 +00:00
Paul Duffin
2579631bd1 Stop prebuilt_apex/apex_set exporting invalid jars to Make
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
2021-10-11 17:53:54 +01:00
Paul Duffin
bf027e4e58 Retry: Separate hidden API flags needed in sdk snapshots for S and T am: 191be3a186
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844294

Change-Id: Id8977b8160f175b736214428cae94ea27f95675b
2021-10-05 18:04:10 +00:00
Paul Duffin
191be3a186 Retry: Separate hidden API flags needed in sdk snapshots for S and T
Previous change that was reverted: https://r.android.com/1835222
An additional test was added that revealed a bug in the previous change
which has been fixed here.

Previously, the behavior of the stub_flags and all_flags properties
was different between S and T. In S they contained paths for the
complete set of stub flags and all the encoded flags. However, in T
they contained filtered sets of flags which if used in S would prevent
build checks from detecting possible inconsistencies. Also, a new
signature_patterns property was added in T that is not supported in S.

This change creates separate properties/files for T and reverts the
behavior of the properties/files that were added in S back to how they
behaved in S. The new properties are called filtered_stub_flags and
filtered_flags.

The S and T properties are tagged with the appropriate
supported_build_releases tag to ensure that they are only output when
specifically targeted.

Bug: 197842263
Test: m nothing
Change-Id: I1ce0a3d6623dabf73e32af1a7457b9b444fc3b7c
2021-10-05 15:27:42 +01:00
Treehugger Robot
3e745e63f3 Merge "Bp2Build common properties auto-handling" am: d905146590
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815376

Change-Id: I38f1063302ea90583a51e625076e6232b4364ab7
2021-10-04 19:20:28 +00:00
Treehugger Robot
d905146590 Merge "Bp2Build common properties auto-handling" 2021-10-04 19:02:07 +00:00
Ulya Trafimovich
ef92591c59 Update variable name in error messages. am: e5b2b49a73
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844308

Change-Id: Icb57f58d9efdf8793162254eefe8e3150d6d9cf5
2021-10-04 16:18:58 +00:00
Ulya Trafimovich
e5b2b49a73 Update variable name in error messages.
Variable PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS was renamed to
PRODUCT_APEX_SYSTEM_SERVER_JARS in https://r.android.com/1779472.

Bug: 191127295
Test: m nothing
Change-Id: I0c8ae839cab443c824760b40d30b4374982010f9
2021-10-04 15:43:39 +01:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
447f6c99c9 Bp2Build common properties auto-handling
Introduce `commonAttributes` & `fillCommonBp2BuildModuleAttrs used in
CreateBazelTargetModule

Adapt `bp2BuildInfo` to use `commonAttrs` instead of `Name`.
And thus also all downstream users of `CreateBazelTargetModule`.

As initial user, the Soong `required` property will be
translated to Bazel's `data`.

Bug: 198146582, 196091467
Test: build_converstion_test.go:TestCommonBp2BuildModuleAttrs
Test: go test
Test: mixed_{libc,droid}.sh
Change-Id: Ib500e40f7e2cb48c459f1ebe3188962fc41ec124
2021-10-04 14:43:04 +00:00
Salmax Chang
12d6b80da2 Merge changes from topic "bb_201948713" am: 8bb9c6a1d9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844137

Change-Id: Ia042b5b24141be4ebfa17ab15adf34c3af632635
2021-10-04 08:13:19 +00:00
Salmax Chang
8194d61ae0 Revert "Separate hidden API flags needed in sdk snapshots for S and T"
This reverts commit ba68c93630.

Reason for revert: suspect to cause build break in b/201948713

Change-Id: Ide3693ac1f8e24bd2f7c12857361885cb6b787ef
2021-10-04 05:28:58 +00:00
Paul Duffin
afe55d6598 Merge "Separate hidden API flags needed in sdk snapshots for S and T" am: 6b383e9ef2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835222

Change-Id: I092500dc977cc482a6c662ae9fcd4e71fea32810
2021-10-02 11:34:00 +00:00
Paul Duffin
ba68c93630 Separate hidden API flags needed in sdk snapshots for S and T
Previously, the behavior of the stub_flags and all_flags properties
was different between S and T. In S they contained paths for the
complete set of stub flags and all the encoded flags. However, in T
they contained filtered sets of flags which if used in S would prevent
build checks from detecting possible inconsistencies. Also, a new
signature_patterns property was added in T that is not supported in S.

This change creates separate properties/files for T and reverts the
behavior of the properties/files that were added in S back to how they
behaved in S. The new properties are called filtered_stub_flags and
filtered_flags.

The S and T properties are tagged with the appropriate
supported_build_releases tag to ensure that they are only output when
specifically targeted.

Bug: 197842263
Test: m nothing
Change-Id: Iec8b9c539796c507245b69c0aed980fde6d8694f
2021-10-01 17:28:13 +01:00
Jiakai Zhang
d20f37f014 Merge changes I7876b077,Ib2e7d5e6,I7d2d2e02,Ibf5322f8 am: dcc42b6f7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835088

Change-Id: Ifefcf876e203406967f44c035495dbba49c4362f
2021-09-30 15:24:48 +00:00
Jiakai Zhang
dcc42b6f7e Merge changes I7876b077,Ib2e7d5e6,I7d2d2e02,Ibf5322f8
* changes:
  Generate prebuilt_systemserverclasspath_fragment.
  Add a new SDK member type java_systemserver_libs.
  Add exported_systemserverclasspath_fragments to prebuilt_apex rule.
  Add prebuilt_systemserverclasspath_fragment rule.
2021-09-30 15:13:45 +00:00
Treehugger Robot
84de371ad9 Merge "Call InstallFile even when !installable" am: a07b559571
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1836921

Change-Id: I9c18959a7733877c1b3adddd8251bd0539205913
2021-09-30 10:15:12 +00:00
Jiakai Zhang
774dd305f4 Add exported_systemserverclasspath_fragments to prebuilt_apex rule.
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
2021-09-30 10:06:21 +00:00
Jiakai Zhang
c9864278da Add prebuilt_systemserverclasspath_fragment rule.
This is the prebuilt side of systemserverclasspath_fragment, currently
for used for dexpreopting.

The change to automactially generate
prebuilt_systemserverclasspath_fragment rules will be in a separate CL.

Bug: 194150908
Test: m nothing
Change-Id: Ibf5322f80f78ac3ca037489f4a279456fe38a23f
2021-09-30 10:05:58 +00:00
Jiyong Park
17ff2838fc Call InstallFile even when !installable
Not calling InstallFile when !installable prevents the module not only
from being installed to the partition, but also from being packaged for
a packaging_base. InstallFile already has a routine for not generating
the install rule when the module is not installable. So, the check for
can be safely omitted at the call site.

Bug: 199674764
Test: m com.android.virt. the virt apex has
com.android.runtime.64only.apex in system/apex

Change-Id: I0249f5916496ed136dbf1978e04e2971852de244
2021-09-28 00:02:54 +00:00
Martin Stjernholm
40fc93fb3c Merge changes I957f3df8,I68986dcc am: cf6bf37d04
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1829372

Change-Id: Ifcf471f2746c1037b83c2a11b8f5120b86fd6cb2
2021-09-24 09:44:00 +00:00
Martin Stjernholm
4482560cc7 Consolidate the code to resolve a deapexer module dependency.
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
2021-09-23 17:19:55 +01:00
Martin Stjernholm
8be1e6db16 Propagate the dex jar path as an OptionalPath which is either valid or
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
2021-09-23 17:19:55 +01:00
Treehugger Robot
45dd37c6e3 Merge "Add test to TestJavaStableSdkVersion for legacy core platform" am: 3769a27c5e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655611

Change-Id: I752f24a2e6b9763019866402a8af6adb3e96ee2a
2021-09-20 14:20:18 +00:00
Treehugger Robot
3769a27c5e Merge "Add test to TestJavaStableSdkVersion for legacy core platform" 2021-09-20 14:04:35 +00:00
Jiakai Zhang
23a5cba0af Merge changes I9c94a54a,Idc0c73a7 am: 2c6ede11cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824513

Change-Id: I1f3ce39cd3b3988e676791a59f0c70e2bc80015d
2021-09-17 11:33:22 +00:00
Jiakai Zhang
dc2c1c2625 Merge "Revert^2 "Preopt APEX system server jars."" am: c9f9d56ed4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1828115

Change-Id: I2a991341934af96455f136cbe44ef824f5e3e7f5
2021-09-17 11:33:13 +00:00
Jiakai Zhang
2c6ede11cc Merge changes I9c94a54a,Idc0c73a7
* changes:
  Preopt system server jars with updatable bootclasspath.
  Preopt APEX system server jars from prebuilts.
2021-09-17 11:20:10 +00:00
Jiakai Zhang
c9f9d56ed4 Merge "Revert^2 "Preopt APEX system server jars."" 2021-09-17 11:19:51 +00:00
Martin Stjernholm
44cbc71c78 Merge "Remove fallback code path for missing BCP fragments that is no longer necessary." am: 33ce5d6c0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821658

Change-Id: I145f398e8b22cca8e9e91a62d83cbb2014032261
2021-09-16 14:48:57 +00:00
Martin Stjernholm
33ce5d6c0e Merge "Remove fallback code path for missing BCP fragments that is no longer necessary." 2021-09-16 14:38:01 +00:00
Paul Duffin
1ea7c9fa52 Add test to TestJavaStableSdkVersion for legacy core platform
Adds a test case to TestJavaStableSdkVersion for the case where a
module uses sdk_version: "core_platform" but is in the list of modules
that can use the legacy version.

This required storing the lookup map in the Config to allow it to be
customized for the test.

Bug: 180399951
Test: m nothing
Change-Id: I404705c3fd8a559649c6ab2624856cf78f49f85c
2021-09-16 11:12:43 +01:00
Jiakai Zhang
519c5c82e5 Revert^2 "Preopt APEX system server jars."
This reverts commit 92346c4832.

Reason for revert: Fixed build error.

The build error is fixed by ag/15841934. This CL remains unchanged. This
CL will be submitted AFTER ag/15841934 is submitted.

Bug: 200024131
Test: 1. Patch this CL and ag/15841934 into internal master.
  2. sudo vendor/google/build/build_test.bash

Change-Id: I5f2b8357846fc7dda56e25ebe6ffb095e8047ec8
2021-09-16 06:25:26 +00:00
Treehugger Robot
6e5aabb91b Merge "Share cFlags, tidyFlags, etc. in a module" am: b1a12462a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824024

Change-Id: Iaf6050178f9d172a5a17103504e8f081277df9cf
2021-09-16 02:35:38 +00:00
Martin Stjernholm
b1e61cb8bc Remove fallback code path for missing BCP fragments that is no longer
necessary.

#codehealth

Test: m nothing
Bug: 179354495
Change-Id: Iaddf163e69b52cef82d522311e81bef9bdb4aa8d
2021-09-16 00:55:53 +01:00
Chih-Hung Hsieh
b8082295b6 Share cFlags, tidyFlags, etc. in a module
* In builder.go, share common flags in a module.
  * This replaces the sharing of cflags/cppflags/asflags in cc.go.
  * A unit test in apex_test.go now fails and is commented out.
    It is a failing test hidden by old optimization in cc.go.
* In module.go, expand the reference variable $someflags<n>,
  or ${someflags<n>} to keep many existing unit tests work as is.
* The build.ninja size was reduced from 8.1GB to 6.2GB,
  for aosp_arm64-eng WITH_TIDY=1 USE_RBE=true,
  and from 7.5GB to 5.6GB when USE_RBE is 0.
  Content of build.ninja is also more readable and searchable.
  Read/write build.ninja times are also reduced,
  depending on disk I/O speed.

Test: make WITH_TIDY=1
Change-Id: I17f96adf4844136d52e5d40f57a19d9e290162b7
2021-09-15 16:05:41 -07:00
Adrian Roos
755a09490f Merge "Revert "Preopt APEX system server jars."" am: 79839d94c1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1827535

Change-Id: I2281010a93a89b69b859272627c7eac0d7e6d3ed
2021-09-15 14:53:58 +00:00
Adrian Roos
92346c4832 Revert "Preopt APEX system server jars."
This reverts commit ca9bc98e0c.

Reason for revert: breaks build
Bug: 200024131

Change-Id: Ide07b4c4d267370ae31107b1598b2f878c701282
2021-09-15 14:11:07 +00:00
Jiakai Zhang
83d0d8ac1c Preopt APEX system server jars. am: ca9bc98e0c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821984

Change-Id: If42b905c0636b10881b372efafd3e2f9bc84923c
2021-09-15 10:48:53 +00:00
Jiakai Zhang
ca9bc98e0c Preopt APEX system server jars.
The path to the artifacts will in the form of
/system/framework/oat/<arch>/<encoded-jar-path>@classes.{odex,vdex,art},
where <encoded-jar-path> is the path to the jar file with "/" replaced
by "@". For example,
/system/framework/oat/x86_64/apex@com.android.art@javalib@service-art.jar@classes.odex

There will be a follow-up CL to update ART runtime to recognize
artifacts in that path.

Test: m com.android.art
Bug: 194150908
Change-Id: Ic89fd63c4b1cd565684cead83fc91dae3bc97a4c
2021-09-15 09:01:07 +00:00
Jiakai Zhang
204356f3b5 Preopt APEX system server jars from prebuilts.
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
2021-09-15 09:01:07 +00:00