Skip to content

Commit a15a134

Browse files
authored
Fix missing digest for m.jar (pantsbuild#8447)
### Problem ``` [ 27/207] Rsc-ing 302 mixed sources in 1 target ('<some target>). rsc(finagle/finagle-core/src/main:main) failed: ClasspathEntry ClasspathEntry(path='<some path>/source/.pants.d/compile/rsc/c1e3836b60e5/finagle.finagle-core.src.main.main/current/rsc/m.jar', directory_digest=None) didn't have a Digest, so won't be present for hermetic ``` The issue is that when we are setting the directory like this ``` ctx.rsc_jar_file = ClasspathEntry(ctx.rsc_jar_file.path, res.output_directory_digest) ``` it creates a new object and assign it to `ctx.rsc_jar_file`, whereas somewhere else in the code still points to the `ClasspathEntry` that `ctx.rsc_jar_file` used to point to. ### Solution Do not create an object, but change its attribute. ### Result RSC does not choke on this anymore.
1 parent 7134456 commit a15a134

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/python/pants/backend/jvm/tasks/jvm_compile/rsc/rsc_compile.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,15 +674,13 @@ def _runtool_hermetic(self, main, tool_name, distribution, input_digest, ctx):
674674
# TODO: parse the output of -Xprint:timings for rsc and write it to self._record_target_stats()!
675675

676676
res.output_directory_digest.dump(ctx.rsc_jar_file.path)
677-
678-
ctx.rsc_jar_file = ClasspathEntry(ctx.rsc_jar_file.path, res.output_directory_digest)
679-
680677
self.context._scheduler.materialize_directories((
681678
DirectoryToMaterialize(
682679
# NB the first element here is the root to materialize into, not the dir to snapshot
683680
get_buildroot(),
684681
res.output_directory_digest),
685682
))
683+
ctx.rsc_jar_file.hydrate_missing_directory_digest(res.output_directory_digest)
686684

687685
return res
688686

0 commit comments

Comments
 (0)