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
Change the PathGlobs
, SnapshotSubset
, and UrlToFetch
intrinsics to return Digest
#10449
Change the PathGlobs
, SnapshotSubset
, and UrlToFetch
intrinsics to return Digest
#10449
Conversation
# Rust tests will be skipped. Delete if not intended. [ci skip-rust-tests]
There are three legit test failures in Any help would be much appreciated. I think this is a real bug on the code to go from |
The originals seem incorrect. These tests now emulate how an actual FS works if you were to expand the Tar file and use `ls` to traverse the directories. These fixes also make logical sense; if we have `a/b` in the output dirs, then I would expect `a` to show up too. # Rust tests will be skipped. Delete if not intended. [ci skip-rust-tests]
Nevermind, the original was wrong. There's a bug in the original implementation. Given this code: sn = await Get(Snapshot, PathGlobs(["src/python/pants/util/*.py"]))
print(sn.dirs)
sn2 = await Get(Snapshot, Digest, sn.digest)
print(sn2.dirs) We get:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I'd recommend getting a review from someone more versed in this before merging.
…shot [ci skip-rust-tests]
[ci skip-rust-tests]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
[ci skip-rust-tests]
[ci skip-rust-tests]
The engine knows how to go from
Digest -> Snapshot
, but not the other way around. By changing these three intrinsics, rules have much more flexibility.Now, the claim in https://www.pantsbuild.org/v2.0/docs/rules-api-file-system#core-abstractions-digest-and-snapshot that "The core building block is a Digest" is true.
--
This also renames
SnapshotSubet
toDigestSubset
, given that it takes as inputDigest
and returns aDigest
.