Skip to content
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

[WIP, pending performance investigations] remote hermetic experiments revisited #7231

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1b40674
add .resolve_for_enum_variant() to enum() and refactor type checking …
cosmicexplorer Feb 7, 2019
0dccf3a
make native backend Platform into an enum
cosmicexplorer Feb 7, 2019
cc26f22
make ToolchainVariant into an enum
cosmicexplorer Feb 7, 2019
f19ff49
add .iterate_enum_variants() and clean up testing in test_ctypes_inte…
cosmicexplorer Feb 7, 2019
e44ce51
make NailgunTask execution strategy into an enum
cosmicexplorer Feb 7, 2019
0963c3a
override __new__ and clean up error messages in enum
cosmicexplorer Feb 9, 2019
26e89a7
add ticket links!
cosmicexplorer Feb 9, 2019
66e4f57
fix outdated method name
cosmicexplorer Feb 10, 2019
cb8f9d5
actually invoke the lazy pattern matching
cosmicexplorer Feb 10, 2019
daa13c1
add yet another lambda invocation
cosmicexplorer Feb 10, 2019
82c93c4
add .resolve_for_enum_variant() to enum() and refactor type checking …
cosmicexplorer Feb 7, 2019
44d200d
override __new__ and clean up error messages in enum
cosmicexplorer Feb 9, 2019
34b63d9
make mixed mode rsc/zinc compilation work
cosmicexplorer Jan 30, 2019
0af128f
add the enum docstring
cosmicexplorer Feb 7, 2019
3d2c617
use ZincCompileError for fun
cosmicexplorer Feb 7, 2019
eb96992
add .resolve_for_enum_variant() to enum() and refactor type checking …
cosmicexplorer Feb 7, 2019
b7eff46
add experimental hermetic-with-nailgun jvm execution strategy
cosmicexplorer Jan 30, 2019
cd44656
add merged rsc and zinc jar
cosmicexplorer Feb 1, 2019
a4ab1cb
Cache compilers in zinc nailgun instance
illicitonion Dec 21, 2018
77d448d
"productionize" hermetic-with-nailgun execution strategy for zinc and…
cosmicexplorer Feb 9, 2019
158fa85
use .resolve_for_enum_variant() in a couple more places
cosmicexplorer Feb 9, 2019
42a26de
fix error introduced into non-hermetic nailgun zinc invocations
cosmicexplorer Feb 11, 2019
010c498
add necssary locally-built rsc components to produce jar
cosmicexplorer Feb 12, 2019
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
17 changes: 12 additions & 5 deletions src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,15 @@ def do_compile(self, invalidation_check, compile_contexts, classpath_product):
invalid_targets = [vt.target for vt in invalidation_check.invalid_vts]
valid_targets = [vt.target for vt in invalidation_check.all_vts if vt.valid]

if self.execution_strategy == self.HERMETIC:
self._set_direcotry_digests_for_valid_target_classpath_directories(valid_targets, compile_contexts)
def set_directory_digests_for_hermetic():
self._set_directory_digests_for_valid_target_classpath_directories(
valid_targets, compile_contexts)
self.execution_strategy_enum.resolve_for_enum_variant({
self.HERMETIC: set_directory_digests_for_hermetic,
self.HERMETIC_WITH_NAILGUN: set_directory_digests_for_hermetic,
self.SUBPROCESS: lambda: None,
self.NAILGUN: lambda: None,
})()

for valid_target in valid_targets:
cc = self.select_runtime_context(compile_contexts[valid_target])
Expand Down Expand Up @@ -451,20 +458,20 @@ def _record_compile_classpath(self, classpath, target, outdir):
with open(path, 'w') as f:
f.write(text)

def _set_direcotry_digests_for_valid_target_classpath_directories(self, valid_targets, compile_contexts):
def _set_directory_digests_for_valid_target_classpath_directories(self, valid_targets, compile_contexts):
snapshots = self.context._scheduler.capture_snapshots(
tuple(PathGlobsAndRoot(PathGlobs(
[self._get_relative_classes_dir_from_target(target, compile_contexts)]
), get_buildroot()) for target in valid_targets))
[self._set_direcotry_digest_for_compile_context(
[self._set_directory_digest_for_compile_context(
snapshot.directory_digest, target, compile_contexts)
for target, snapshot in list(zip(valid_targets, snapshots))]

def _get_relative_classes_dir_from_target(self, target, compile_contexts):
cc = self.select_runtime_context(compile_contexts[target])
return fast_relpath(cc.classes_dir.path, get_buildroot()) + '/**'

def _set_direcotry_digest_for_compile_context(self, directory_digest, target, compile_contexts):
def _set_directory_digest_for_compile_context(self, directory_digest, target, compile_contexts):
cc = self.select_runtime_context(compile_contexts[target])
new_classpath_entry = ClasspathEntry(cc.classes_dir.path, directory_digest)
cc.classes_dir = new_classpath_entry
Expand Down
Loading