Commit Graph

46175 Commits

Author SHA1 Message Date
Colin Cross
19aa461cc0 Merge changes I04f2f558,Ie16a6264,I83a3be9f,Icb3eeef3 am: 91eaa6316a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1869551

Change-Id: Ida831ee9684ce97052443a012d5c4986c0d4399c
2021-10-30 19:37:28 +00:00
Colin Cross
91eaa6316a Merge changes I04f2f558,Ie16a6264,I83a3be9f,Icb3eeef3
* changes:
  Rename amod variable in AndroidMkEntries.fillInEntries to base
  Make HostToolPath, HostJNIToolPath and sboxPathForToolRel use pathForInstall
  Add PathForGoBinary
  Remove PathForOutput from InstallPathToOnDevicePath
2021-10-30 19:19:53 +00:00
Colin Cross
f9b1f0b3d0 Merge "Use --skip-config --soong-only instead of --skip-make" am: e7fc5a25c5 am: 814909b0f3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1875216

Change-Id: I383e03d4fec215afdf5a4f344364d6eed3aa9a99
2021-10-30 16:30:53 +00:00
Colin Cross
814909b0f3 Merge "Use --skip-config --soong-only instead of --skip-make" am: e7fc5a25c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1875216

Change-Id: I3da344ae1c31d292b7e1ef446151893b723a88f5
2021-10-30 16:13:21 +00:00
Colin Cross
e7fc5a25c5 Merge "Use --skip-config --soong-only instead of --skip-make" 2021-10-30 15:56:22 +00:00
Colin Cross
385517b48d Merge "Make installable arch-variant and static vs shared variant for cc modules" am: 4985224198 am: 5dc0ab4daa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874552

Change-Id: I7bdfd8ec00a798076d00a5b893bf54397a0e6e0f
2021-10-30 05:25:40 +00:00
Colin Cross
5dc0ab4daa Merge "Make installable arch-variant and static vs shared variant for cc modules" am: 4985224198
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874552

Change-Id: I076443da26723441f0534187d686cee2ed4b8a88
2021-10-30 05:13:17 +00:00
Colin Cross
4985224198 Merge "Make installable arch-variant and static vs shared variant for cc modules" 2021-10-30 04:56:22 +00:00
Chih-hung Hsieh
8044ebf38b Merge "Add -{checkbuild,tidy} targets only for modules in mm" am: 7b2239f648 am: 6ac43742fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1858736

Change-Id: I80f4d3794d8592c5ae918074d461ace8254bfcfe
2021-10-30 04:43:07 +00:00
Chih-hung Hsieh
6ac43742fc Merge "Add -{checkbuild,tidy} targets only for modules in mm" am: 7b2239f648
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1858736

Change-Id: I9297a7c901e736676e0e03f1b56694b79d5fddbd
2021-10-30 04:14:10 +00:00
Chih-hung Hsieh
7b2239f648 Merge "Add -{checkbuild,tidy} targets only for modules in mm" 2021-10-30 03:57:06 +00:00
Chih-Hung Hsieh
a3d135b1af Add -{checkbuild,tidy} targets only for modules in mm
Test: lunch aosp_coral-userdebug; WITH_TIDY=1
      make 7-libgptutils.coral-checkbuild 7-libgptutils.coral-tidy
Test: only coral libgptutils in out/build-aosp_coral.ninja
Test: lunch aosp_arm64-eng; make has no *libgptutils* tagets
Test: no libgptutils in out/build-aosp_arm64.ninja
Test: lunch aosp_cf_arm64_phone-userdebug; make libskia-checkbuild
Test: lunch aosp_arm64-eng; WITH_TIDY=1 make tidy-soong

Bug: 202763874
Change-Id: I2d5a3fdc627d62e43c3f10e61b338a03c10440be
2021-10-29 18:02:27 -07:00
Treehugger Robot
f11c7c9e18 Merge "apex.custom_sign_tool property" am: cae893ae40 am: e18be41278
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1869522

Change-Id: I191fcd8a85296f208f0dbbb151c93bc09f8be7a6
2021-10-30 00:13:05 +00:00
Treehugger Robot
e18be41278 Merge "apex.custom_sign_tool property" am: cae893ae40
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1869522

Change-Id: I9d94371728b68252e0056a9574fe7d0791c7ae68
2021-10-29 23:56:00 +00:00
Treehugger Robot
cae893ae40 Merge "apex.custom_sign_tool property" 2021-10-29 23:39:26 +00:00
Colin Cross
6301c3cffa Export Soong install rules to Make
Previously Soong's install rules have been disabled when embedded
in Make (ctx.Config().KatiEnabled() == true).  The primary blocker
for moving installation into Soong has been the `required` proeprty,
which is too vague to be easily handled in Soong.  Keeping
installation in Make has resulted in two host bin directories,
the Make-owned directory (e.g. out/host/linux-x86/bin), and the
Soong-owned directory (e.g. out/soong/host/linux-x86/bin).  The
lack of knowledge in Soong about the final, Make-owned installation
location makes it hard to support NOTICE files entirely in Soong.

This patch begins to solve this problem by supporting the creation of
the installation rules into Soong, but rather than writing the rules
to the ninja file it writes them to a Makefile and lets Kati convert
them to ninja.  This allows Kati to inject extra dependencies to
handle the `required` property.

Converting all modules to create their installation rules in Soong
would be too complex, so only modules that return true from
InstallBypassMake will use the Soong installation rules.  This
is currently only set for robolectric tests.

Bug: 204136549
Test: m checkbuild
Change-Id: I28af9fa7fadece8ea1f98f5efd140c823751cae7
2021-10-29 16:34:55 -07:00
Colin Cross
f1f763a981 Rename amod variable in AndroidMkEntries.fillInEntries to base
AndroidMkEntries.fillInEntries calls its android.ModuleBase amod,
despite also handling an android.Module.  Rename amod to base to
match other locations, and add a new amod for the android.Module.
This will simplify the next patch that needs to access the
android.Module.

Bug: 204136549
Test: m checkbuild
Change-Id: I04f2f558959def22e8b3f5b8c534b8d655b06a4e
2021-10-29 16:34:55 -07:00
Colin Cross
34d60c9281 Use --skip-config --soong-only instead of --skip-make
--skip-make is deprecated because of its odd behavior around the
out/.soong.kati_enabled file.  Replace it with --skip-config --soong-only
instead, which will unambigiously skip running kati.

Bug: 204136549
Test: build/soong/tests/run_integration_tests.sh
Test: build/soong/scripts/build-mainline-modules.sh
Test: build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I629ee7542687aaafd68eea50346b0cf53eafe1ef
2021-10-29 16:34:55 -07:00
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
Colin Cross
b1692a3468 Remove PathForOutput from InstallPathToOnDevicePath
The next patches will make more InstallPaths use the Make output
directory, which is not inside PathForOutput.  Fix the assumption
that the InstallPath is relative to PathForOutput by storing
enough information in the InstallPath to find the on-device path
without PathForOutput.

Bug: 204136549
Test: soong tests
Change-Id: Icb3eeef3f1c72f773f333267f8a7dfc503feacb5
2021-10-29 16:34:55 -07:00
Colin Cross
1bc9412fb3 Make installable arch-variant and static vs shared variant for cc modules
libc's native_bridge shared variant needs to be installable: false,
make the installable property arch-variant and allow the static and
shared clauses to override it.

This relands I8e0eaed2169e89520b07bb0326bb97ac0b4a70ac with fixes to
allow only the shared variant to be marked installable: false.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie579b5ba56ca21f4d9243088afd5078d8c122a68
2021-10-29 15:00:38 -07:00
Treehugger Robot
038ce8bb1d Merge "Revert "Do not build tests with ThinLTO"" am: a471535c72 am: 77f08017ab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874098

Change-Id: Iecc95a11903c804c3454348967a9901cd366a6c0
2021-10-29 20:13:05 +00:00
Paul Duffin
2a27960bd6 Merge changes I88ee9709,If2ea3fde,I657fbcde,I585a8861 am: e8412c4e7a am: fed3551805
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1873694

Change-Id: If7edc3a99f09c61806f1e010f88aa06f18e004f6
2021-10-29 20:12:45 +00:00
Treehugger Robot
77f08017ab Merge "Revert "Do not build tests with ThinLTO"" am: a471535c72
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874098

Change-Id: If0c43fa11b2fe3b5e8f0b43860d0b99ade205309
2021-10-29 19:56:26 +00:00
Paul Duffin
fed3551805 Merge changes I88ee9709,If2ea3fde,I657fbcde,I585a8861 am: e8412c4e7a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1873694

Change-Id: Ib2b791e2fe8b8685f28c07f0ecd09cdd9a2fba1e
2021-10-29 19:55:58 +00:00
Treehugger Robot
a471535c72 Merge "Revert "Do not build tests with ThinLTO"" 2021-10-29 19:48:30 +00:00
Paul Duffin
e8412c4e7a Merge changes I88ee9709,If2ea3fde,I657fbcde,I585a8861
* changes:
  Use toModule for all "standard" API surfaces
  Run TestClasspath test cases with Always_use_prebuilt_sdks=true/false
  Refactor TestClasspath to simplify follow up change
  Add tests for prebuilts of all API surfaces
2021-10-29 19:41:33 +00:00
Colin Cross
b6289005da Merge "Revert "Make installable arch-variant for cc modules"" am: 972e7ba893 am: c6dd42f2ae
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1875314

Change-Id: I3cbd2651039034ad699e014aa8a8c9949651f493
2021-10-29 18:43:13 +00:00
Jiakai Zhang
c5ae770e62 Merge "Add a build-time check for dexpreopting system server jars." am: 65947f6fc4 am: 4e5ffa8d5c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1840058

Change-Id: I21d31cd549ed63a70de4c3e634b1c8b25371bfb0
2021-10-29 18:43:00 +00:00
Colin Cross
c6dd42f2ae Merge "Revert "Make installable arch-variant for cc modules"" am: 972e7ba893
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1875314

Change-Id: I2ac1120f1a596759e7cf85f4580caa62b7191cba
2021-10-29 18:18:42 +00:00
Jiakai Zhang
4e5ffa8d5c Merge "Add a build-time check for dexpreopting system server jars." am: 65947f6fc4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1840058

Change-Id: Ie4a934d49ede52be2a74724061d8f1af1534847d
2021-10-29 18:18:18 +00:00
Colin Cross
972e7ba893 Merge "Revert "Make installable arch-variant for cc modules"" 2021-10-29 18:10:59 +00:00
Colin Cross
545104bea1 Revert "Make installable arch-variant for cc modules"
Revert submission 1874144-native_bridge_libc_dup_rules

Reason for revert: breaks ndk_translation_all build
Reverted Changes:
I5379aa959:Make native bridge libc uninstallable
I2220d6b48:Remove BUILD_BROKEN_DUP_RULES from cuttlefish buil...
I8e0eaed21:Make installable arch-variant for cc modules

Bug: 204136549
Fixes: 204572444
Change-Id: I089a13675123a33a3ec3fea8eaa40c65fb2e5e59
2021-10-29 18:08:36 +00:00
Jiakai Zhang
65947f6fc4 Merge "Add a build-time check for dexpreopting system server jars." 2021-10-29 18:00:51 +00:00
Yi Kong
04e459d9ff Revert "Do not build tests with ThinLTO"
On second thought, this is actually counter-productive rather than an
optimisation. LTOing test code is usually quite cheap, however since
tests can pull in additional static libraries (e.g. to set up test
environment), we will have to create non-LTO variants for these
dependent libraries, which can be much more expensive.

This reverts commit 85d7297318.

Bug: 195134194
Bug: 203737712
Change-Id: I1a105136075133a5b5895d00847d8796c419964c
Test: m GLOBAL_THINLTO=true dist device-tests platform_tests
2021-10-29 17:53:27 +00:00
Paul Duffin
e9758b0415 Use toModule for all "standard" API surfaces
For the purposes of this change a standard API surface is one of the
following:
* public
* system
* test
* module-lib
* system-server

Test: m droid
Bug: 204189791
Change-Id: I88ee9709430ca455dd6c7d1523ae22f8c22b0b7e
2021-10-29 17:57:12 +01:00
Paul Duffin
132c3e61c0 Run TestClasspath test cases with Always_use_prebuilt_sdks=true/false
Previously, the TestClasspath test cases were only run with the default
setting of Always_use_prebuilt_sdks=false. That meant that some of the
code under test that depended on the setting of that variable was not
tested properly.

This change runs the test cases m with Always_use_prebuilt_sdks=true as
well. Those test cases whose behavior depends on the setting of that
variable are split into two separate test cases, each of which only
runs with the appropriate setting of that variable. All other test
cases are run for both settings of the variable.

That revealed a slight issue with the test setup (a missing
prebuilts/sdk/public/core/android.jar file) which broke the
core_current test when run with Always_use_prebuilt_sdks=true which has
also been fixed.

Bug: 204189791
Test: m nothing
Change-Id: If2ea3fde40c7573262e93691af0b5a57e4d54469
2021-10-29 17:57:12 +01:00
Paul Duffin
0b3b36a402 Refactor TestClasspath to simplify follow up change
Extracts classpathTestCase and extracts the logic for creating the test
into a separate testClasspathTestCases func.

Bug: 204189791
Test: m nothing
Change-Id: I657fbcde23a18f7f5651c174fbf17a9b7b7f1a9a
2021-10-29 17:57:12 +01:00
Paul Duffin
12e311d958 Add tests for prebuilts of all API surfaces
Previously, the tests only covered checking the sdk dependencies added
when using a prebuilt current (public) and system SDKs, i.e. with
sdk_version set to "current_30" or "system_30". This change adds tests
to cover other APIs, e.g. "test_30", "module_30" and
"system_server_30". It adds tests for "module" and "system-server" up
to API level 32 as following changes will give them different behavior
as API levels less than or equal to 31 do not have a separate
core-for-system-modules.jar file for the module-lib API.

Bug: 204189791
Test: m nothing
Change-Id: I585a88615439a24abf75250114a86113b5f5da57
2021-10-29 17:57:12 +01:00
Colin Cross
1dc06ad960 Merge "Make installable arch-variant for cc modules" am: f87065fedb am: 10f31785fa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874481

Change-Id: I610bfc478e69d9cbd19e59559699858048477b2d
2021-10-29 15:36:46 +00:00
Colin Cross
10f31785fa Merge "Make installable arch-variant for cc modules" am: f87065fedb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874481

Change-Id: I7bd7b0e4ed20604af1b104dbd748b5b19e2e7758
2021-10-29 15:19:04 +00:00
Colin Cross
f87065fedb Merge "Make installable arch-variant for cc modules" 2021-10-29 14:58:03 +00:00
Treehugger Robot
5cd602678b Merge "Remove MainNinjaFile()" am: 3bf5986bb3 am: 0dcc020ae4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874417

Change-Id: If10f5ef7b30e8288fbf60c7a910c0233ef16d319
2021-10-29 13:49:51 +00:00
Treehugger Robot
0dcc020ae4 Merge "Remove MainNinjaFile()" am: 3bf5986bb3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874417

Change-Id: I00ca2e67995e5da1486165b897a46089314f3873
2021-10-29 13:26:31 +00:00
Treehugger Robot
3bf5986bb3 Merge "Remove MainNinjaFile()" 2021-10-29 13:12:00 +00:00
Jiakai Zhang
0a0a2fbea9 Add a build-time check for dexpreopting system server jars.
This change adds a Soong module that stores the paths to the compilation
artifacts of system server jars in a variable, which will then be
consumed by Make to check if the artifacts are installed. When the check
fails, it means that dexpreopting is not working for some system server
jars and needs to be fixed.

Bug: 201371822
Test: m nothing
Test: manual -
  1. Add "service-permission" to DEXPREOPT_DISABLED_MODULES (https://cs.android.com/android/platform/superproject/+/master:build/make/core/product_config.mk?q=DEXPREOPT_DISABLED_MODULES)
  2. m nothing
  3. See the error:
    Missing compilation artifacts. Dexpreopting is not working for some system server jars
    Offending entries:
    system/framework/oat/x86_64/apex@com.android.permission@javalib@service-permission.jar@classes.odex
    system/framework/oat/x86_64/apex@com.android.permission@javalib@service-permission.jar@classes.vdex
Change-Id: I4816f19668f1dae180a34adafdbfa448c97aa0db
2021-10-29 11:55:20 +00:00
Mohammad Islam
53c61eed3a Merge "Make car apex's library optional in PRODUCT_APEX_SYSTEM_SERVER_JARS" am: c874504988 am: e6de0ed5b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1871662

Change-Id: I4606ebde1889d09734627e34a9e5d96750523363
2021-10-29 10:15:52 +00:00
Mohammad Islam
e6de0ed5b8 Merge "Make car apex's library optional in PRODUCT_APEX_SYSTEM_SERVER_JARS" am: c874504988
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1871662

Change-Id: I323170bd1a82c0ebc6d2a189c836e880f4339abd
2021-10-29 09:57:54 +00:00
Mohammad Islam
c874504988 Merge "Make car apex's library optional in PRODUCT_APEX_SYSTEM_SERVER_JARS" 2021-10-29 09:40:49 +00:00