Commit graph

639 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Mohammad Islam
17544fe23a Merge "Relax restriction on suffix of apex_set filename to include .capex" am: 385cde82d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821656

Change-Id: I91189bd060d0c365892234daab5a59b70a8018c7
2021-09-09 09:08:51 +00:00
Samiul Islam
7c02e26cba Relax restriction on suffix of apex_set filename to include .capex
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
2021-09-08 18:29:47 +01:00
Treehugger Robot
b8d4e69927 Merge "Allows prebuilts in override_apex." am: e267bc8f74
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1811097

Change-Id: I732915686e54509c30f6855ea29d562bc83cf680
2021-09-03 16:13:56 +00:00
Treehugger Robot
e267bc8f74 Merge "Allows prebuilts in override_apex." 2021-09-03 16:01:31 +00:00
Daniel Norman
5a3ce13c6a Allows prebuilts in override_apex.
Bug: 197787336
Test: Create an override_apex that uses a different `prebuilts` than its
      base. Observe built contents.
Test: apex_test.go
Change-Id: I7666ed6cfe3f2fa5dd81e5f8c1961477dabbbd3c
2021-09-02 09:28:52 -07:00
Spandan Das
ab47a767d8 Merge "Skip dexbootjar check using AllowMissingDependencies flag" am: b7e5985fd5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1803934

Change-Id: I55ae4c5858330385876eb42e0fa16773ca748150
2021-08-31 16:12:21 +00:00
Spandan Das
b7e5985fd5 Merge "Skip dexbootjar check using AllowMissingDependencies flag" 2021-08-31 16:06:10 +00:00
Lukács T. Berki
8526bc95ef Merge "Rename BuildDir and NinjaBuildDir." am: 5602d33025
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1810356

Change-Id: I6af3316fb122af7a05b71de7f9cd371746bb5f21
2021-08-27 13:54:13 +00:00
Lukacs T. Berki
9f6c24a887 Rename BuildDir and NinjaBuildDir.
These are just out/ and out/soong/ and the old names were quite
confusing.

Test: Presubmits.
Merged-In: I999ca62162062f27e449f83ffb00fa580d4065b8
Merged-In: I2fcd80a9e376a6842a06aa104a9f6f5c5e16f8c7
Change-Id: Ib481d2aac40df8da1b74174dc8ec576c1cb48be0
2021-08-27 10:08:49 +02:00
Treehugger Robot
a88fc3e79e Merge "Make bpfs properties overridable" am: 60dc5c0db2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1810456

Change-Id: Ib8196d660983d724e4ecde5c08a9ab2da979df99
2021-08-27 05:07:16 +00:00
Treehugger Robot
60dc5c0db2 Merge "Make bpfs properties overridable" 2021-08-27 04:57:10 +00:00
markchien
7c803b8746 Make bpfs properties overridable
To support different variable bpfs file between mainline module and
non-updatable module(e.g. Android GO). Make bpfs properties overridable.

Test: m
Bug: 190523685
Change-Id: I4c63e35f74230de94b21f3ceb2beb90f0f9ddb11
2021-08-27 03:03:45 +00:00
Spandan Das
10ea4bf9d4 Skip dexbootjar check using AllowMissingDependencies flag
Soong checks that every module part of a bootclass_fragment provides a
dex boot jar file, even if the module is not a dependency of vendor.img

Using AllowMissingDepdencies() to skip this check allows vendors to be
more aggressive in removing projects from their source tree

Test: In build/soong, run go test ./...
Test: m nothing
Bug: 196306898
Bug: 192616764
Change-Id: I78b062afdc19a6a3251aa8552230f3fcf334b6fb
2021-08-27 02:54:07 +00:00
Jiyong Park
b4adefa58e Merge changes I15328e0b,I731227c2 am: 19312d4224
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1808218

Change-Id: I58224f0fc056f174567241a13d9eb54dbaef5d12
2021-08-25 22:48:34 +00:00
Jiyong Park
5df7bd33f7 crt objects for APEX and vendor variants have correct target API levels
Previously, crt objects for APEX and vendor variants targetted API level
16 regardless of their context. For example, even if BOARD_VNDK_VERSION
is set to 29, or an APEX has `min_sdk_version: "29"`, the target API
level was from `min_sdk_version` property of the crt object which is set
to 16.

The meaning of min_sdk_version is quite different when it comes to crt
objects. It means the lowest API level that it CAN target for. It does
NOT mean the API level it SHOULD always target.

This has caused some other problems like TLS segment underalignment for
vendor libraries because the vendor libraries were all built with TLS
layout from API level 16.

This change fixes the problem by correctly implementing the different
semantic of min_sdk_version for crt objects.

Bug: N/A
Test: m nothing

Change-Id: I15328e0b6cbabbe151dd65c7469c6355e167b78a
2021-08-25 16:26:47 +09:00
satayev
4d566bea9b Merge "Fix tests to use correct fixtures for configuring (Apex)BootJars." am: 721f42d12a am: 9958b36643
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1787998

Change-Id: Id9248b6b54547e55c28bb386c867294ec20df873
2021-08-11 16:42:47 +00:00
satayev
abcd59731e Fix tests to use correct fixtures for configuring (Apex)BootJars.
This is in preparation to r.android.com/1740313 where setting correct
variables would be enforced (i.e. apex and non-apex boot jars must be in
config.ApexBootJars and config.BootJars correspondingly).

Bug: 191369843
Test: m nothing
Change-Id: Ic86680c1f7af53d229083b2cc58beb3ceccb4b6a
2021-08-10 15:35:52 +01:00
Treehugger Robot
69c6143138 Merge changes Ie2012adb,Ib0283ca6 am: 03beb0ec77 am: 47992dd860
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1784476

Change-Id: I7e41072eaf3e953591232b6bb8df6a7c1b961c2a
2021-08-04 05:06:04 +00:00
Jiyong Park
a9baefe81f Merge "Revert "Prohibit static executable in APEX"" am: 2fe71a5165 am: 2af22b8729
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1784474

Change-Id: I125a2dfb96277064ff7daa195d4a80c315655879
2021-08-03 08:19:22 +00:00
Jiyong Park
d12979d09a static rust binaries are also prohibited in APEXes
Also fixes a bug that the test runs for host APEXes like
com.android.art.host.

Bug: 185971244
Test: m
Test: build mainline_modules target on aosp-master
Change-Id: Ie2012adbf2f4eda5454d5eaa30f128fb1e20ad37
2021-08-03 07:52:46 +00:00
Jiyong Park
192600a7d0 Revert "Revert "Prohibit static executable in APEX""
This reverts commit 2125aab504.

Reason for revert: relanding along with a forward fix

Change-Id: Ib0283ca6beefa2f3073860287d00553ad0af6317
2021-08-03 07:52:17 +00:00
Yen-Chao Chen
2125aab504 Revert "Prohibit static executable in APEX"
This reverts commit 3a8130c797.

Reason for revert: Build failed.

Change-Id: I28c72c8c3adaeb23bff9bffe3994971aa3f2e4f4
2021-08-03 04:51:12 +00:00
Jiyong Park
42a7f17aa1 Merge "Prohibit static executable in APEX" am: d8a3513155 am: 7986f564b6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1779746

Change-Id: Iefdcf93ceb0d0b9654afffe0c03be28af33a9eaf
2021-08-03 04:16:24 +00:00
Jiyong Park
3a8130c797 Prohibit static executable in APEX
If a library is statically included in a static executable, it's
behavior is different from the case where the same library is statically
(or dynamically) linked to a non-static executable. To reduce the number
of test configs that we need to consider, it is required to prohibit
static executables in APEXes.

Bug: 185971244
Test: m
Change-Id: I0cd8fca669d55088e2329fef1f859eeb297502dd
2021-07-27 22:42:23 +09:00
satayev
ad6cb082a4 Merge "Rename UpdatableBootJars to ApexBootJars." am: 4102c0cc47 am: adb9e9f752
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1773912

Change-Id: Iecc5f48620b2d4e5390ab9a081b2193924bd0dda
2021-07-26 18:29:56 +00:00
satayev
4102c0cc47 Merge "Rename UpdatableBootJars to ApexBootJars." 2021-07-26 17:59:36 +00:00
satayev
d604b210c4 Rename UpdatableBootJars to ApexBootJars.
Note that ART apex boot jars and core-icu4j are exceptions here as they
are not part of ApexBootJars. ART apex boot jars are defined in their
own variable, while core-icu4j is treated as a regular non-updatable
boot jar.

Bug: 191127295
Test: atest CtsClasspathsTestCases
Change-Id: I3cea3d82ef521655a1a5ffa8cae2258ab9d08bfc
2021-07-22 17:35:42 +01:00
Treehugger Robot
4760903116 Merge "Require prebuilt_bootclasspath_fragment to provide hidden API files" am: 41461f3660 am: 70d39ce053
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1772628

Change-Id: I276e323889e5a70ddf56b7ca71add649858c32a1
2021-07-20 20:38:22 +00:00
Treehugger Robot
854571f683 Merge changes I343712d7,Ic076ea85 am: 9c01fc686d am: 93ece5b8e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1772627

Change-Id: Id0587dc7c2a4e1019f3699aa3b3b7e5015e5e2e5
2021-07-20 20:38:13 +00:00
Paul Duffin
54e4197da1 Require prebuilt_bootclasspath_fragment to provide hidden API files
Previously, the prebuilt_bootclasspath_fragment was not required to
provide hidden API files as not all usages of that module provided
them. That should no longer be the case so this change makes the
prebuilt_bootclasspath_fragment stricter and so now always require
them.

Bug: 194063708
Test: m out/soong/hiddenapi/hiddenapi-flags.csv
      - check that this does not change the contents.
Change-Id: I3f19a1b4246f09a927c0f6b0f41b8678150d6cc2
2021-07-20 19:18:13 +01:00
Paul Duffin
40a3f65430 Improve hidden API checking in TestBootDexJarsFromSourcesAndPrebuilts
Previously, the test only checked how the intermediate index file was
created from class jars. This change also checks how the monolithic
index file was created from the intermediate index file and the index
files generated from each bootclasspath_fragment.

At the moment the checks reveal that the monolithic index file is
created solely from the intermediate index file. However, a follow up
change to Soong will alter the behavior of the test.

Bug: 194063708
Test: m nothing
Change-Id: I343712d7d17ab0a07f5b32226321fc6815847e1f
2021-07-20 19:17:56 +01:00
Treehugger Robot
4c72f68962 Merge "SdkLibraryImport's DexJarInstallPath uses installPath from source module" am: 257608f993 am: 64614bbcff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1758354

Change-Id: Ibd345e6d76706c54d5cfb0799d80f5d107332f78
2021-07-14 01:21:18 +00:00
Jeongik Cha
d5fe8782e0 SdkLibraryImport's DexJarInstallPath uses installPath from source module
Even though actual installed module path is the same as source module,
it uses impl's one.

Bug: 188179858
Bug: 193082464
Test: compare dexpreopt_config.zip files from
  1. TARGET_BUILD_UNBUNDLED_IMAGE=true m dexpreopt_config_zip
  2. m dexpreopt_config_zip
  (note that m clean should run between steps)
Test: build aosp_cf_x86_64_phone,  launch_cvd, and then
  adb wait-for-device \
      && adb root \
      && adb logcat \
      | grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C 1
      and then check if there is no message.

Change-Id: I34ffd9a2d214a6614c2befc35b2beec003cfcd25
2021-07-13 13:54:03 +00:00
Treehugger Robot
a2792263fa Merge "Fix inconsistencies in the apex names used for the apex variations." am: f46e95899b am: 28bbdf23f7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748294

Change-Id: I930769a7d48eedace77d12cf51f1e50ebb874cbb
2021-06-25 23:33:49 +00:00