Commit graph

214 commits

Author SHA1 Message Date
Rico Wind
351bac996c Add soong support for resource shrinking
This adds a new flag to the optimize section to allow invoking the resource shrinker

Bug: 246217952
Test: m
Change-Id: I2e7851af1189db2a6adf6f9f9f444a1d7f3a8d60
2022-09-23 19:11:11 +02:00
Sorin Basca
198c51c868 Pin javadoc to JDK 11
Bug: 240421555
Test: m sdk
Change-Id: I6fed538a3a0d05a3115dd930b860aa7769aa6d16
2022-09-08 17:15:18 +01:00
Cole Faust
bcc3d05aba Fix module-file name collisions
Bazel doesn't allow a module and file with the same name.

Bug: 198619163
Test: Presubmits
Change-Id: Ie9731b627945d2ff221d3a5d08a32a5a172f9dcd
2022-09-01 15:20:00 -07:00
Jordan Demeulenaere
c33f79996f Increase R8 max heap size to 4GB.
Bug: 241220562
Test: Manual
Change-Id: I983ded61b3a588e3d3b5c8e71596f80aaa2d59e6
2022-08-08 11:40:15 +02:00
Ian Zerny
dc2893aeea Use R8 wrapper target and flags.
Bug: b/227746536
Test: atest --host r8retrace-check-retraced-stacktrace
Change-Id: Ia0f65180181df19f5c043cc371893cfe45d248a9
2022-06-23 12:23:18 +02:00
Rico Wind
1cd1729011 Disable deferred tracing in R8
Bug: 227455445
Bug: 233630328
Test: m -j77 SystemUI + disasm grep mStatusBarWindowCallback
Change-Id: I2d6bb859e74c1afc398e629e53d2ce541ef27642
2022-05-30 12:54:25 +00:00
Ian Zerny
727ab9033a Replace DEX_FLAGS by flags for D8 and R8.
This adds the heap space flag currently set in wrappers.

Bug: b/227746536
Test: manual
Change-Id: Ic3cb8feb7a09d690ecd309162236e49a8d1e52c6
2022-04-25 11:17:07 +02:00
Jared Duke
0cf7c9686d Limit JIT tier for D8
Standalone D8 invocations tend to be shorter-lived than R8 invocations
that involve deeper layers of bytecode optimization. Introduce a
separate set of JVM flags to pass to D8 invocations which limit the
runtime JIT tiering, reducing overall compile times and significantly
reducing total CPU consumption for D8 build workloads.

Representative incremental build times with this change:
 * real 6m1.388s
 * user 63m32.412s
and without:
 * real 6m30.624s
 * user 79m12.626s

Bug: 205303544
Test: time m
Change-Id: Ic568a4316325c6a4e0da41ffebbb07f0c5f7e8e3
2022-04-21 18:24:52 +00:00
Treehugger Robot
a2a7b57924 Merge changes from topic "export-vars"
* changes:
  export Java variables to Bazel
  refactor Bazel variable export
2022-04-08 17:31:23 +00:00
Sam Delmerico
932c01cf9e export Java variables to Bazel
Test: build/bazel/bp2build.sh
Change-Id: Ia06f9265c9f96e6add6edbd0cee925fe37b430d3
2022-04-08 14:15:43 +00:00
Colin Cross
93d65fb60d Merge "Enable kotlin's jvm-abi-gen plugin to generate header jars" 2022-04-05 23:32:54 +00:00
Anton Hansson
51bbac2137 Remove apex framework jars from hard-coded list
All apex jars get auto-instrumented since
I2b1c0736202de26c5ea88c0ab14574bd7207a5fb

Test: $ EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m nothing && \
      $ grep LOCAL_MODULE.*framework-sdkextensions.com.android.sdkext$ \
            out/soong/Android-aosp_coral.mk  -A9 -B2 | grep JACO
Change-Id: I1de5ba6673bef93b16c302412f920d93129d4420
2022-04-05 09:00:57 +00:00
Colin Cross
220a9a1245 Enable kotlin's jvm-abi-gen plugin to generate header jars
Kotlin's jvm-abi-gen plugin can generate header jars similar to the
turbine output for java sources, which can be used to avoid recompiling
downstream modules when the ABI hasn't changed.  Unlike turbine, the
plugin runs as part of the main kotlinc invocation, so it doesn't allow
the downstream modules to start compiling any sooner.

A future possible optimization is to use turbine to compile the kapt
stubs, at least for the  kotlin+annotation processor modules that already
generate them, which would allow compiling downstream modules before
invoking kotlinc or javac, as well as invoking kotlinc and javac in
parallel with each other.

Bug: 222095735
Test: TestKotlin
Test: m SystemUI
Change-Id: Ib1bb2ecea47c851a108a26f9ed4f827f289d1321
2022-04-04 16:42:46 -07:00
Colin Cross
c2d504873f Prevent kotlinc from reading /tmp/build.txt
Pass -Didea.plugins.compatible.build=999.SNAPSHOT to kotlinc and kapt
to prevent it from reading /tmp/build.txt and failing with an obscure
exception:
exception: java.lang.ExceptionInInitializerError
	at com.intellij.openapi.util.BuildNumber.currentVersion(BuildNumber.java:297)
...

Bug: 222162908
Test: m metalava with /tmp/build.txt present
Change-Id: I5faced4a2e94561ce3aa37bfaacf5bd7d988a4f0
2022-03-18 20:48:51 +00:00
Colin Cross
59c1e6ac0e Support experimental building with OpenJDK 17
Use EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN=true to build with OpenJDK 17
while still targeting java language version 11.

Bug: 219098645
Test: m EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN=true
Change-Id: I89fb04ecde4dbd1e102098f316692624dd67f8a2
2022-03-04 21:40:02 +00:00
Colin Cross
8bf6cad170 Increase errorprone heap size
Increase the size of the errorprone heap to fix OOM exceptions.

Bug: 221480398
Test: forrest
Change-Id: Ia74fd4ecc57f08bcbaa1388e0734ee0cce8ae1a4
2022-02-28 13:10:50 -08:00
Jared Duke
0849c14aea Limit JIT tier for javac
javac is generally a short-lived JVM invocation that doesn't greatly
benefit from deep JIT tiering. As such, favor faster startup time
by limiting to tier 1 JIT for javac execution. This should greatly
reduce overall CPU usage from Java compilation for an arbitrary
Android build (~20%), and deliver a small but modest improvement in
overall Java build times (~5%).

Representative incremental build times with this change:
  * real 18m3.507s
  * user 563m4.838s
and without:
  * real 19m11.909s
  * user 751m27.790s

Follow-up changes will apply similar flags for other short-lived JVM
build commands.

Bug: 205303544
Test: m
Change-Id: Ic6315b976063f4330902930a6cf5e5cb394c554c
2022-01-28 11:39:47 -08:00
Colin Cross
c899d7808e Revert "Temporarily add method to get java binary tool"
Java binaries and cc binaries are in the same directory again, the
separate method can be removed.

Bug: 204136549
Test: m checkbuild
Change-Id: I2e7ca82448aba5c7e54d3c3c376fe14a953ef4af
2021-11-05 14:26:53 -07:00
Colin Cross
3e3eda6eb6 Temporarily add method to get java binary tool
cc binaries are moving from out/soong/host/linux-x86/bin to
out/host/linux-86/bin first, to be followed by java binaries.
Temporarily add a method that gets the java binary path while
it is different from the cc binary path.

Bug: 204136549
Test: m checkbuild
Change-Id: I04a7e741436da6be68078f23d074870413a5bb5e
2021-11-04 10:28:58 -07:00
Colin Cross
a832a04db2 Revert "Time out and dump stacks from R8 processes after 30 minutes"
This reverts commit 29c294b2cf.

The deadlock in R8 was fixed, and the timeout causes problems when
RBE is enabled and the R8 action gets stuck in a queue for 30
minutes.

Test: checkbuild
Change-Id: Ia0c3826aea3288e9db3bdbd4955e1e16c0a38fe3
2021-08-05 17:04:06 -07:00
Colin Cross
29c294b2cf Time out and dump stacks from R8 processes after 30 minutes
R8 processes are sometimes hanging on the build servers.  Wrap R8 with
run_with_timeout to dump the stacks with jstack and kill the process
after 30 minutes.  Switch from running with the r8-compat-proguard
shell script to running the jar directly so that jstack gets the pid
of the java process.

Bug: 181095653
Test: m checkbuild
Test: m NetworkStackNextIntegrationTests
Test: m USE_RBE=true RBE_R8=true RBE_R8_EXEC_STRATEGY=remote NetworkStackNextIntegrationTests
Change-Id: If6996bd8eb39c7a8453d79e825004339c009ade2
2021-04-30 14:14:46 -07:00
Colin Cross
d47f4ac828 Silence kotlinc JDK9 warnings
Silence the "Illegal reflective access" warning from kotlinc tracked
by https://youtrack.jetbrains.com/issue/KT-43704

Test: m SystemUI
Change-Id: I98eaf530c69cc4d3cefe09f5feab54c764352912
2021-03-31 13:17:42 -07:00
Colin Cross
77cdcfdeaf Move android package on top of remotexec
Remove the references to the android package in remotexec so that
the android package can reference the remoteexec package.  This
will allow RuleBuilder to integrate directly with remoteexec.

Bug: 182612695
Test: m checkbuild
Change-Id: I15be5ef126d8aacbd605518638f341daf6f31bb3
2021-03-18 16:17:34 -07:00
Bob Badour
02040de891 Add LOCAL_LICENSE_KINDS to build/soong
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  android/Android.bp
  android/soongconfig/Android.bp
  androidmk/Android.bp
  apex/Android.bp
  bazel/Android.bp
  bp2build/Android.bp
  bpf/Android.bp
  bpfix/Android.bp
  cc/Android.bp
  cc/config/Android.bp
  cc/libbuildversion/Android.bp
  cc/libbuildversion/tests/Android.bp
  cc/ndk_api_coverage_parser/Android.bp
  cc/ndkstubgen/Android.bp
  cc/symbolfile/Android.bp
  cmd/dep_fixer/Android.bp
  cmd/diff_target_files/Android.bp
  cmd/extract_apks/Android.bp
  cmd/extract_jar_packages/Android.bp
  cmd/extract_linker/Android.bp
  cmd/fileslist/Android.bp
  cmd/host_bionic_inject/Android.bp
  cmd/javac_wrapper/Android.bp
  cmd/merge_zips/Android.bp
  cmd/multiproduct_kati/Android.bp
  cmd/path_interposer/Android.bp
  cmd/pom2bp/Android.bp
  cmd/pom2mk/Android.bp
  cmd/sbox/Android.bp
  cmd/soong_build/Android.bp
  cmd/soong_env/Android.bp
  cmd/soong_ui/Android.bp
  cmd/zip2zip/Android.bp
  cmd/zipsync/Android.bp
  cuj/Android.bp
  dexpreopt/Android.bp
  dexpreopt/dexpreopt_gen/Android.bp
  env/Android.bp
  etc/Android.bp
  filesystem/Android.bp
  finder/Android.bp
  finder/cmd/Android.bp
  genrule/Android.bp
  jar/Android.bp
  java/Android.bp
  java/config/Android.bp
  kernel/Android.bp
  linkerconfig/Android.bp
  linkerconfig/proto/Android.bp
  makedeps/Android.bp
  partner/Android.bp
  phony/Android.bp
  python/Android.bp
  python/tests/Android.bp
  remoteexec/Android.bp
  rust/Android.bp
  rust/config/Android.bp
  scripts/Android.bp
  sdk/Android.bp
  sh/Android.bp
  shared/Android.bp
  symbol_inject/Android.bp
  symbol_inject/cmd/Android.bp
  sysprop/Android.bp
  tradefed/Android.bp
  ui/build/Android.bp
  ui/logger/Android.bp
  ui/metrics/Android.bp
  ui/metrics/proc/Android.bp
  ui/status/Android.bp
  ui/terminal/Android.bp
  ui/tracer/Android.bp
  xml/Android.bp
  zip/Android.bp
  zip/cmd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  finder/fs/Android.bp
  third_party/zip/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: Ia47ca14f16b8c9f84f9d533a07e5b00e2c04e8d4
2021-02-06 04:23:21 +00:00
Xin Li
65cb5c69ea Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Ifca7b65f4e27bf14cdc30f72f790b0de90130bae
Change-Id: I3a39be5f0b8736de4822c6a14072c78d4e4ad89d
2020-08-29 01:17:45 -07:00
Treehugger Robot
90905c0c68 Merge "Make the default exec strategy for javac/r8/d8 remote local fallback." 2020-08-18 00:54:03 +00:00
Andrei Onea
23fea04e27 Rename class2greylist
Use a more inclusive name (go/hiddenapi-list-renaming).
Bug: 163797539
Test: atest class2nonsdklisttest

Change-Id: I1b72c243746dde9926a11d5a559b84e753e8fd4f
2020-08-13 17:33:14 +01:00
Ramy Medhat
2889166b6c Make the default exec strategy for javac/r8/d8 remote local fallback.
Test: presubmits
Change-Id: Ia67c2a1e13638db1fb9c93755ce72159767d46b4
2020-08-13 11:41:35 -04:00
Dan Willemsen
9f43597ff7 Remove obsolete PDK build functionality
This hasn't worked for a couple years, and continues to bitrot. Just
remove it.

Adds a bpfix rule so that we can eventually remove the
product_variables.pdk definition, which is now always a no-op.

Test: treehugger
Change-Id: I830b54d419b59f6db1d4617b45e61a78234f57a7
Merged-In: I830b54d419b59f6db1d4617b45e61a78234f57a7
2020-08-11 01:11:44 +00:00
Jeongik Cha
816a23a50d Introduce AlwaysUsePrebuiltSdks
Instead of UnbundledBuild, use AlwaysUsePrebuiltSdks
to determine if java modules needs to be built against prebuilt sdks.
And rename UnbundledBuildUsePrebuiltSdks to AlwaysUsePrebuiltSdks to
express its behavior more correctly.(It can be orthgonal to "Unbundled")

Bug: 160390776
Test: TARGET_BUILD_UNBUNDLED_IMAGE=true m vendorimage

Change-Id: I0be7265c1959d8774c295372cd7a9250169f6df9
2020-08-07 12:15:52 +09:00
Pete Gillin
84c3807b99 Enforce the legacy core/platform API restriction.
This change silently decides whether modules which depend on either
sdkPrivate or sdkCorePlatform get the legacy or the stable version of
the core/platform API, based on whether the module's name is on a
hard-coded list or not.

Test: m java
Test: make a target from the list when its entry is commented out, which correctly fails
Bug: 157640067
Change-Id: I15e5a6c2f07e73718803501d705de0d7ab9bec90
Merged-In: I15e5a6c2f07e73718803501d705de0d7ab9bec90
Merged-In: Iaa97ddaa015e8079fcb3426585c5101c7ec9e22a
(cherry picked from commit c0f4373106)
2020-07-23 09:06:52 +01:00
Treehugger Robot
8034eafbed Merge "Rename the Default* constants in java/config." am: 8f70db2b48 am: 98d8ee9bd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1353886

Change-Id: Ibf0533b6bd01244d30c5df89aa849a7f8da6f777
2020-07-01 15:25:53 +00:00
Treehugger Robot
8f70db2b48 Merge "Rename the Default* constants in java/config." 2020-07-01 14:43:46 +00:00
Pete Gillin
0638dfcf94 Rename the Default* constants in java/config.
These values are used in two out of the many possible sdk_version
configurations, and therefore weren't really defaults in any
meaningful sense. Giving them more descriptive names makes the code
easier to follow.

Bug: 157640067
Test: m nothing
Change-Id: Icf38a9c0be2606ad0478929e1b40dfcee36cddef
2020-07-01 12:40:58 +01:00
Treehugger Robot
9e57eedbad Merge "Move gen-kotlin-build-file.sh to python" am: e9eacaa061 am: 46d1053e49
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1351107

Change-Id: I34404ace3cda9d908fe7354598bb3fafc414298c
2020-06-29 21:35:21 +00:00
Treehugger Robot
e9eacaa061 Merge "Move gen-kotlin-build-file.sh to python" 2020-06-29 21:12:45 +00:00
Colin Cross
9b1aa0cb86 Move gen-kotlin-build-file.sh to python
Kotlin common multiplatform sources support will require more
complexity in gen-kotlin-build-file.sh, move it to python instead.

Test: m checkbuild
Change-Id: I02312160ad781877f1fec971168331c0dcecf136
2020-06-26 22:41:34 -07:00
Chris Gross
5ea55cd054 Merge "Use a default exclude filter for JaCoCo in Soong." am: 8f3386e49b am: 8a203b5cd7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1349522

Change-Id: I9c99a709a0a930e4114682d00a38ddd7210a602b
2020-06-26 15:21:01 +00:00
Chris Gross
2f748692dd Use a default exclude filter for JaCoCo in Soong.
Instrumented builds should exclude certain classes from instrumenation
by default. (e.g. JaCoCo itself) Leverage the existing
DefaultJacocoExclusionFilter to do this.

Note: Two different default filters exist now (one for Make and one for
Soong), as they have different wildcard rules.

Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_STATIC=true m -j32
TeleService and inspected the resulting temporary jar that was
instrumented to confirm that anything from org/jacoco was excluded.
Bug: 159748844

Change-Id: I5466b0a03957edfbe53971d5d1a7729fdb8337db
2020-06-25 16:45:44 +00:00
Pete Gillin
811814282d Merge "Split the core/platform API into stable and legacy versions." am: d7db79cc8b am: 5dbf9e09f2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1322704

Change-Id: I731da4ed59432a67bdc3df124a8939bcf316aa0c
2020-06-09 16:37:21 +00:00
Pete Gillin
1f41dbff64 Split the core/platform API into stable and legacy versions.
For now, everything outside libcore still uses the legacy version.

Test: treehugger
Bug: 157640067
Change-Id: If5234e9ee533ff537926801a0af045d36b1caf01
2020-06-08 10:53:51 +01:00
Jaewoong Jung
8066ebc38f Merge "Soong package structure refactoring" am: 264700345d am: ca9ed9158d
Original change: undetermined

Change-Id: I5cd95c02ab8af420dc2b7166ba24bdf0c7dc6496
2020-06-02 16:57:16 +00:00
Jaewoong Jung
4b79e98a6e Soong package structure refactoring
Give prebuilt_etc and sh_binary their own packages and split the
gigantic main Android.bp up to small, per-package ones.

Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
2020-06-01 13:44:48 -07:00
Kousik Kumar
2b6185810a Merge "Add support for remote-execution / caching of jar/zip actions" am: c4cdba07d3 am: d996ff6a68
Change-Id: I41f544531788cfdf7a16560e24f27c9d31b186ad
2020-05-29 13:56:58 +00:00
Kousik Kumar
0f5e5c724e Merge "Add support for remote-execution / caching of signapk actions" am: 8f37ec82d9 am: f52d6420ea
Change-Id: I3c51e0ff23903ba101d2029a632f99fc8342c2d9
2020-05-28 19:06:40 +00:00
Kousik Kumar
366afc5011 Add support for remote-execution / caching of jar/zip actions
Test: Ran a build with `RBE_JAR="true" RBE_JAR_EXEC_STRATEGY="remote"
RBE_ZIP="true" RBE_ZIP_EXEC_STRATEGY="remote" ... use_rbe m` and that
succeeded.

Bug: b/156765207
Change-Id: Ia17b532fbb282be414adf879914870082dd0841b
2020-05-28 11:56:48 -07:00
Kousik Kumar
309b1c0da3 Add support for remote-execution / caching of signapk actions
Test: "RBE_SIGNAPK=true RBE_SIGNAPK_EXEC_STRATEGY=remote ... use_rbe m" on crosshatch-userdebug and
signapk targets worked
Bug: b/156765091

Change-Id: I4b8c21320c2f38914ef39d3d8f036d885fab4e72
2020-05-28 06:14:56 -07:00
Kousik Kumar
02332a2e8b Merge "Add support for remote-execution / caching of turbine actions" am: 97d095516e am: a858736c86
Change-Id: I3fd5bd5a82f6a69a57f0105ed4eb21ab45651a57
2020-05-27 04:17:07 +00:00
Kousik Kumar
1372c1b430 Add support for remote-execution / caching of turbine actions
Test: Ran a sample turbine action with:
RBE_TURBINE_EXEC_STRATEGY="remote" RBE_TURBINE="true" ... use_rbe m out/soong/.intermediates/external/protobuf/libprotobuf-java-micro/android_common/turbine/libprotobuf-java-micro.jar
and checked in reproxy_log.txt that remote-metadata had status SUCCESS.

Bug: b/156765475
Change-Id: I85c334e6998c6dd2a68460b3580d50fffd900e6f
2020-05-20 07:57:37 -07:00
Jaewoong Jung
eb899879a1 Merge changes from topic "prebuilt_apk_set" am: a3e8885658 am: c067b0280c
Change-Id: Id7848044c6a0bbf18c005fc04e037b8ae4345903
2020-05-15 12:54:15 +00:00