Skip to content

Commit

Permalink
Revert D65074404: Only full_library build can be incremental
Browse files Browse the repository at this point in the history
Differential Revision:
D65074404

Original commit changeset: 8d5808f7bde2

Original Phabricator Diff: D65074404

fbshipit-source-id: 0fadb8eb3157ec217cd8cf7c00a090286bd11cfe
  • Loading branch information
jiawei-lyu authored and facebook-github-bot committed Oct 29, 2024
1 parent 83850bd commit 4d38208
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions prelude/java/javacd_jar_creator.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ def create_jar_artifact_javacd(
target_type: TargetType,
path_to_class_hashes: Artifact | None,
is_creating_subtarget: bool = False,
source_only_abi_compiling_deps: list[JavaClasspathEntry] = [],
should_action_run_incrementally: bool | None = False): # @unused
source_only_abi_compiling_deps: list[JavaClasspathEntry] = []):
proto = declare_prefixed_output(actions, actions_identifier, "jar_command.proto.json")

proto_with_inputs = actions.write_json(proto, encoded_command, with_inputs = True)
Expand Down
2 changes: 0 additions & 2 deletions prelude/jvm/cd_jar_creator_util.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ def generate_abi_jars(
source_abi_dir,
source_abi_target_type,
path_to_class_hashes = None,
should_action_run_incrementally = False,
)
source_abi = source_abi_output_paths.jar

Expand Down Expand Up @@ -602,7 +601,6 @@ def generate_abi_jars(
source_only_abi_target_type,
path_to_class_hashes = None,
source_only_abi_compiling_deps = source_only_abi_compiling_deps,
should_action_run_incrementally = False,
)
source_only_abi = source_only_abi_output_paths.jar

Expand Down
3 changes: 1 addition & 2 deletions prelude/kotlin/kotlin_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ def build_kotlin_library(
"deps": deps + [kotlin_toolchain.kotlin_stdlib],
"extra_kotlinc_arguments": ctx.attrs.extra_kotlinc_arguments,
"friend_paths": ctx.attrs.friend_paths,
"incremental": ctx.attrs.incremental,
"is_building_android_binary": ctx.attrs._is_building_android_binary,
"jar_postprocessor": ctx.attrs.jar_postprocessor[RunInfo] if hasattr(ctx.attrs, "jar_postprocessor") and ctx.attrs.jar_postprocessor else None,
"java_toolchain": ctx.attrs._java_toolchain[JavaToolchainInfo],
Expand All @@ -417,7 +418,6 @@ def build_kotlin_library(
plugin_params = create_plugin_params(ctx, ctx.attrs.plugins),
extra_arguments = extra_arguments,
actions_identifier = "",
incremental = ctx.attrs.incremental,
**common_kotlincd_kwargs
)

Expand Down Expand Up @@ -450,7 +450,6 @@ def build_kotlin_library(
# To make sure that even for pure Kotlin targets empty output dir is always present
optional_dirs = [nullsafe_info.output.as_output()],
is_creating_subtarget = True,
incremental = False,
**common_kotlincd_kwargs
)

Expand Down
10 changes: 4 additions & 6 deletions prelude/kotlin/kotlincd_jar_creator.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@ def create_jar_artifact_kotlincd(
path_to_class_hashes: Artifact | None,
source_only_abi_compiling_deps: list[JavaClasspathEntry] = [],
is_creating_subtarget: bool = False,
incremental_state_dir: Artifact | None = None,
should_action_run_incrementally: bool = False):
incremental_state_dir: Artifact | None = None):
_unused = source_only_abi_compiling_deps

proto = declare_prefixed_output(actions, actions_identifier, "jar_command.proto.json")
Expand Down Expand Up @@ -339,11 +338,11 @@ def create_jar_artifact_kotlincd(

dep_files["classpath_jars"] = classpath_jars_tag

incremental_run_params = {
common_params = {
"metadata_env_var": "ACTION_METADATA",
"metadata_path": "action_metadata.json",
"no_outputs_cleanup": True,
} if should_action_run_incrementally else {}
} if (incremental_state_dir != None) and ("nullsafe" != actions_identifier) else {}
actions.run(
args,
env = {
Expand All @@ -359,7 +358,7 @@ def create_jar_artifact_kotlincd(
low_pass_filter = False,
weight = 2,
error_handler = kotlin_toolchain.kotlin_error_handler,
**incremental_run_params
**common_params
)
return proto

Expand All @@ -377,7 +376,6 @@ def create_jar_artifact_kotlincd(
path_to_class_hashes = path_to_class_hashes_out,
is_creating_subtarget = is_creating_subtarget,
incremental_state_dir = incremental_state_dir,
should_action_run_incrementally = should_kotlinc_run_incrementally,
)

final_jar_output = prepare_final_jar(
Expand Down

0 comments on commit 4d38208

Please sign in to comment.