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

Snapshot is backed by LMDB not tar files #5496

Merged
merged 3 commits into from
Feb 22, 2018
Merged
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
4 changes: 2 additions & 2 deletions src/python/pants/engine/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def create(relative_to, include, exclude=tuple()):
tuple(join(relative_to, f) for f in exclude))


class Snapshot(datatype('Snapshot', ['fingerprint', 'path_stats'])):
class Snapshot(datatype('Snapshot', ['fingerprint', 'digest_length', 'path_stats'])):
"""A Snapshot is a collection of Files and Dirs fingerprinted by their names/content.

Snapshots are used to make it easier to isolate process execution by fixing the contents
Expand All @@ -77,7 +77,7 @@ def file_stats(self):
return [p.stat for p in self.files]

def __repr__(self):
return '''Snapshot(fingerprint='{}', entries={})'''.format(hexlify(self.fingerprint)[:8], len(self.path_stats))
return '''Snapshot(fingerprint='{}', digest_length='{}', entries={})'''.format(hexlify(self.fingerprint)[:8], self.digest_length, len(self.path_stats))

def __str__(self):
return repr(self)
Expand Down
6 changes: 3 additions & 3 deletions src/python/pants/engine/isolated_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,18 @@ def create_out(product_type, input_selectors, output_conversion):
return TaskRule(product_type, inputs, func)


class ExecuteProcessRequest(datatype('ExecuteProcessRequest', ['argv', 'env'])):
class ExecuteProcessRequest(datatype('ExecuteProcessRequest', ['argv', 'env', 'input_files_digest', 'digest_length'])):
"""Request for execution with args and snapshots to extract."""

def __new__(cls, argv, env):
def __new__(cls, argv, env, input_files_digest, digest_length):
"""

:param args: Arguments to the process being run.
:param env: A tuple of environment variables and values.
"""
if not isinstance(argv, tuple):
raise ValueError('argv must be a tuple.')
return super(ExecuteProcessRequest, cls).__new__(cls, argv, tuple(env))
return super(ExecuteProcessRequest, cls).__new__(cls, argv, tuple(env), input_files_digest, digest_length)


class ExecuteProcessResult(datatype('ExecuteProcessResult', ['stdout', 'stderr', 'exit_code'])):
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/option/options_fingerprinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

from pants.base.build_environment import get_buildroot
from pants.base.hash_utils import stable_json_hash
from pants.option.custom_types import (UnsetBool, dict_with_files_option, dir_option,
file_option, target_option)
from pants.option.custom_types import (UnsetBool, dict_with_files_option, dir_option, file_option,
target_option)


class Encoder(json.JSONEncoder):
Expand Down
43 changes: 4 additions & 39 deletions src/rust/engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/rust/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cc = "1.0"
# [workspace]

[dependencies]
bazel_protos = { path = "process_execution/bazel_protos" }
boxfuture = { path = "boxfuture" }
fnv = "1.0.5"
fs = { path = "fs" }
Expand Down
1 change: 0 additions & 1 deletion src/rust/engine/fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ lmdb = "0.7.2"
ordermap = "0.2.8"
protobuf = { version = "1.4.1", features = ["with-bytes"] }
sha2 = "0.6.0"
tar = "0.4.13"
tempdir = "0.3.5"

[dev-dependencies]
Expand Down
Loading