Skip to content

Commit

Permalink
Temporarily add text analysis as additional output to find reproducib…
Browse files Browse the repository at this point in the history
…ility problems

Consistent text format deserialization has a problem, so that's why I'm
adding the additional output for now. Will remove it once I've figured
out what is going on.
  • Loading branch information
James Judd committed Jul 5, 2024
1 parent b540e61 commit eb2991a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rules/private/phases/phase_zinc_compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def phase_zinc_compile(ctx, g):
zinc_configuration = ctx.attr.scala[_ZincConfiguration]

analysis_store = ctx.actions.declare_file("{}/analysis_store.gz".format(ctx.label.name))
analysis_store_text = ctx.actions.declare_file("{}/analysis_store.text.gz".format(ctx.label.name))
mains_file = ctx.actions.declare_file("{}.jar.mains.txt".format(ctx.label.name))
used = ctx.actions.declare_file("{}/deps_used.txt".format(ctx.label.name))
tmp = ctx.actions.declare_directory("{}/tmp".format(ctx.label.name))
Expand Down Expand Up @@ -72,7 +73,7 @@ def phase_zinc_compile(ctx, g):
] + [zinc.deps_files for zinc in zincs],
)

outputs = [g.classpaths.jar, mains_file, analysis_store, used, tmp]
outputs = [g.classpaths.jar, mains_file, analysis_store, analysis_store_text, used, tmp]

execution_requirements_tags = {
"supports-multiplex-workers": "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,16 @@ object ZincRunner extends WorkerMain[Namespace] {
}

// create analyses
val path = analysisStoreFile.getCanonicalPath()
val analysisStoreText = AnalysisUtil.getAnalysisStore(
new File(path.substring(0, path.length() - 3) + ".text.gz"),
true,
usePersistence,
)
analysisStoreText.set(AnalysisContents.create(compileResult.analysis, compileResult.setup))
analysisStore.set(AnalysisContents.create(compileResult.analysis, compileResult.setup))


// create used deps
val resultAnalysis = compileResult.analysis.asInstanceOf[Analysis]
val usedDeps =
Expand Down

0 comments on commit eb2991a

Please sign in to comment.