Skip to content

Commit

Permalink
Remove scratch_dir from javacd/kotlincd's declared output
Browse files Browse the repository at this point in the history
Summary:
Nobody uses scratch output and they cause kotlincd_jar and javacd_jar actions to become nondeterministic: https://fburl.com/unidash/wnzz8hxm

More context: T136237109

Reviewed By: hick209

Differential Revision: D61726987

fbshipit-source-id: d4a3225852aa7c03979a4a3630d4e1b7bc5a2427
  • Loading branch information
navidqar authored and facebook-github-bot committed Aug 27, 2024
1 parent b2bad9f commit fa3ccd6
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions jvm/cd_jar_creator_util.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ OutputPaths = record(
jar = Artifact,
classes = Artifact,
annotations = Artifact,
scratch = Artifact,
)

def qualified_name_with_subtarget(label: Label) -> str:
Expand Down Expand Up @@ -126,7 +125,6 @@ def define_output_paths(actions: AnalysisActions, prefix: [str, None], label: La
jar = jar_parent.project("{}.jar".format(label.name)),
classes = declare_prefixed_output(actions, prefix, "__classes__", dir = True),
annotations = declare_prefixed_output(actions, prefix, "__gen__", dir = True),
scratch = declare_prefixed_output(actions, prefix, "scratch", dir = True),
)

# buildifier: disable=uninitialized
Expand All @@ -138,16 +136,13 @@ def output_paths_to_hidden_cmd_args(output_paths: OutputPaths, path_to_class_has
hidden.append(output_paths.jar.as_output())
hidden.append(output_paths.classes.as_output())
hidden.append(output_paths.annotations.as_output())
hidden.append(output_paths.scratch.as_output())
return cmd_args(hidden = hidden)

def encode_output_paths(label: Label, paths: OutputPaths, target_type: TargetType) -> struct:
paths = struct(
classesDir = paths.classes.as_output(),
outputJarDirPath = paths.jar_parent.as_output(),
annotationPath = paths.annotations.as_output(),
pathToSourcesList = cmd_args([paths.scratch.as_output(), "/", "__srcs__"], delimiter = ""),
workingDirectory = paths.scratch.as_output(),
outputJarPath = paths.jar.as_output(),
)

Expand Down

0 comments on commit fa3ccd6

Please sign in to comment.