Skip to content

Commit 7ea17fd

Browse files
authored
Merge pull request #94 from lucidsoftware/jjudd-write-text-files
Write text analysis store files to help debug determinism issues
2 parents bc0001b + 3074a98 commit 7ea17fd

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

rules/private/phases/phase_zinc_compile.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ load(
1818
def phase_zinc_compile(ctx, g):
1919
toolchain = ctx.toolchains["//rules/scala:toolchain_type"]
2020
analysis_store = ctx.actions.declare_file("{}/analysis_store.gz".format(ctx.label.name))
21+
analysis_store_text = ctx.actions.declare_file("{}/analysis_store.text.gz".format(ctx.label.name))
2122
mains_file = ctx.actions.declare_file("{}.jar.mains.txt".format(ctx.label.name))
2223
used = ctx.actions.declare_file("{}/deps_used.txt".format(ctx.label.name))
2324
tmp = ctx.actions.declare_directory("{}/tmp".format(ctx.label.name))
@@ -76,6 +77,7 @@ def phase_zinc_compile(ctx, g):
7677
g.classpaths.jar,
7778
mains_file,
7879
analysis_store,
80+
analysis_store_text,
7981
used,
8082
tmp,
8183
] + g.semanticdb.outputs

src/main/scala/higherkindness/rules_scala/workers/zinc/compile/ZincRunner.scala

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -335,17 +335,13 @@ object ZincRunner extends WorkerMain[ZincRunnerWorkerConfig] {
335335
)
336336
}
337337

338-
// This will be true if the `--worker_verbose` Bazel flag is set
339-
if (task.verbosity >= 10) {
340-
val analysisStoreText = AnalysisUtil.getAnalysisStore(
341-
new File(pathString.substring(0, pathString.length() - 3) + ".text.gz"),
342-
true,
343-
readWriteMappers,
344-
)
345-
346-
analysisStoreText.set(AnalysisContents.create(resultAnalysis, compileResult.setup))
347-
}
338+
val analysisStoreText = AnalysisUtil.getAnalysisStore(
339+
new File(pathString.substring(0, pathString.length() - 3) + ".text.gz"),
340+
true,
341+
readWriteMappers,
342+
)
348343

344+
analysisStoreText.set(AnalysisContents.create(resultAnalysis, compileResult.setup))
349345
analysisStore.set(AnalysisContents.create(resultAnalysis, compileResult.setup))
350346

351347
// create used deps

0 commit comments

Comments
 (0)