Skip to content

Write text analysis store files to help debug determinism issues #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: lucid-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rules/private/phases/phase_zinc_compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ load(
def phase_zinc_compile(ctx, g):
toolchain = ctx.toolchains["//rules/scala:toolchain_type"]
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 @@ -76,6 +77,7 @@ def phase_zinc_compile(ctx, g):
g.classpaths.jar,
mains_file,
analysis_store,
analysis_store_text,
used,
tmp,
] + g.semanticdb.outputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,17 +335,13 @@ object ZincRunner extends WorkerMain[ZincRunnerWorkerConfig] {
)
}

// This will be true if the `--worker_verbose` Bazel flag is set
if (task.verbosity >= 10) {
val analysisStoreText = AnalysisUtil.getAnalysisStore(
new File(pathString.substring(0, pathString.length() - 3) + ".text.gz"),
true,
readWriteMappers,
)

analysisStoreText.set(AnalysisContents.create(resultAnalysis, compileResult.setup))
}
val analysisStoreText = AnalysisUtil.getAnalysisStore(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we planning on applying this change to all branches in our main repo? How large are the text files again?

new File(pathString.substring(0, pathString.length() - 3) + ".text.gz"),
true,
readWriteMappers,
)

analysisStoreText.set(AnalysisContents.create(resultAnalysis, compileResult.setup))
analysisStore.set(AnalysisContents.create(resultAnalysis, compileResult.setup))

// create used deps
Expand Down