Remove unused dexopts to save Blaze/Bazel heap. The main impactful change is removing `--no-optimize` from _DEXOPTS_SUPPORTED_IN_INCREMENTAL_DEXING. This list is used by the dex_desugar_aspect. A set of dexing actions is created for each combination of dexopts. In `android_binary` we just pull the outputs from the actions with the set of dexopts matching the value passed to the dexopts attribute of the `android_binary` target. So we create many sets of actions that are never executed. This is a waste of Blaze heap. The `--no-optimize` flag is completely ignored CompatDexBuilder which is the wrapper we use around D8 to trigger dexing. This means removing the no-op dexopt cuts the number of dexing actions generated by the dex_desugar_aspect in half with no functional impact. PiperOrigin-RevId: 959735674 Change-Id: I0d2db2102b1826c366c51f7466d927219f46e54a
diff --git a/rules/dex.bzl b/rules/dex.bzl index d7adb7a..1da43d3 100644 --- a/rules/dex.bzl +++ b/rules/dex.bzl
@@ -39,7 +39,7 @@ # Dexing flags that are allowed in incremental dexing. # Previously this was exposed via the --dexopts_supported_in_incremental_dexing native flag. -_DEXOPTS_SUPPORTED_IN_INCREMENTAL_DEXING = ["--no-optimize", "--no-locals"] +_DEXOPTS_SUPPORTED_IN_INCREMENTAL_DEXING = ["--no-locals"] # Dexing flags that are allowed in dex merger. # Previously this was exposed via the --dexopts_supported_in_dexmerger native flag.