Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[zinc-compile] fully adopt enum based switches for hermetic/not; test coverage #7268
@cosmicexplorer wrote this as part of #7227. This patch is pulling out just the Zinc changes, with a few differences. I also added a new test for hermetic failures and some additional assertions to ensure that the right message is being communicated on failures, while doing that I discovered that hermetic/non-hermetic appear to produce error messages on different streams.
referenced this pull request
Feb 21, 2019
I agree with that. I considered moving the warning loop above without a guard, but ...…
On Fri, Feb 22, 2019, 1:00 PM Danny McClanahan ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_compile.py <#7268 (comment)>: > + + def _compile_hermetic(self, jvm_options, ctx, classes_dir, zinc_args, + compiler_bridge_classpath_entry, dependency_classpath, + scalac_classpath_entries): + zinc_relpath = fast_relpath(self._zinc.zinc, get_buildroot()) + + snapshots = [ + self._zinc.snapshot(self.context._scheduler), + ctx.target.sources_snapshot(self.context._scheduler), + ] + + relevant_classpath_entries = dependency_classpath + [compiler_bridge_classpath_entry] + directory_digests = tuple( + entry.directory_digest for entry in relevant_classpath_entries if entry.directory_digest + ) + if len(directory_digests) != len(relevant_classpath_entries): To me it feels harder to piece together the logic of why len(directory_digests) != len(relevant_classpath_entries) from the comprehension above. I'm very comfortable with this code either way. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#7268 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAAc0nyrU3r7u02By4qi5Cx8XXuMSYz3ks5vQExXgaJpZM4bGBky> .