bitter-ability-32190
10/18/2022, 7:33 PMPaths.store_paths
-> I'm not sure if Paths
should be symlink aware/oblivious
• <http://directory.rs:paths_of_child_dir|directory.rs:paths_of_child_dir>
-> Not sure what the method does, exactlywitty-crayon-22786
10/18/2022, 7:34 PM•oblivious, i think. it’s essentially just supposed to be “`Snapshot` but without capturing content”-> I’m not sure ifPaths.store_paths
should be symlink aware/obliviousPaths
bitter-ability-32190
10/18/2022, 7:34 PMwitty-crayon-22786
10/18/2022, 7:35 PMpaths_of_child_dir
bitter-ability-32190
10/18/2022, 7:38 PMstore_paths
the question is, is a symlink a file? or is it the dir/file it points to (which we can't know so its nothing?)witty-crayon-22786
10/18/2022, 7:38 PM•it looks like it selects the children of a given name from a flat list… i.e., if you had a list of-> Not sure what the method does, exactly<http://directory.rs:paths_of_child_dir|directory.rs:paths_of_child_dir>
['a/1.txt', 'a/2.txt', 'b/3.txt']
and called it with a
, it would give you ['1.txt', '2.txt']
I guess forum, i don’t think so… PathGlobs expansion gives you back a PathStat, which has everything you need: see abovethe question is, is a symlink a file? or is it the dir/file it points to (which we can’t know so its nothing?)store_paths
path
of the pathstat was its “symbolic” path in the filesystem.bitter-ability-32190
10/18/2022, 7:48 PMlink
?witty-crayon-22786
10/18/2022, 7:51 PMPathStat
cannot represent a symlinkbitter-ability-32190
10/18/2022, 7:53 PMwitty-crayon-22786
10/18/2022, 7:54 PMbitter-ability-32190
10/18/2022, 7:55 PMwitty-crayon-22786
10/18/2022, 7:57 PMfn expand
which returns PathStats
, but to essentially (be able to) assert that the resulting stats didn’t contain any links if you called it in mode 1CreateDigest
to make test data?bitter-ability-32190
10/18/2022, 7:59 PMwitty-crayon-22786
10/18/2022, 7:59 PMbitter-ability-32190
10/18/2022, 8:00 PMwitty-crayon-22786
10/18/2022, 8:00 PMbitter-ability-32190
10/18/2022, 8:01 PMPathStat::Link
witty-crayon-22786
10/18/2022, 8:02 PMbitter-ability-32190
10/18/2022, 8:02 PMCreateDigest
)witty-crayon-22786
10/18/2022, 8:15 PMbitter-ability-32190
10/18/2022, 8:17 PMDigestTrie::from_unique_paths(path_stats.iter().map(|p| p.into()).collect(), &file_digests)?;
TypedPath
needs a lifetime of the items
var, but we async move
the block which constructs the Trie
. I'm assuming the async store_file_bytes_batch
has to occur before trie creation?witty-crayon-22786
10/18/2022, 8:30 PMbitter-ability-32190
10/18/2022, 8:30 PMwitty-crayon-22786
10/18/2022, 8:33 PMbitter-ability-32190
10/18/2022, 8:44 PMthejcannon:symlinks
) has it. note I moved the trie creation out, but had to use .unwrap()
witty-crayon-22786
10/18/2022, 9:38 PMitems
, you needed to iterate over references into the list: https://github.com/pantsbuild/pants/pull/16844/commits/9859cd8767707d8811643e48d1483a9a0c264729 … think of the list of items
as sitting on the stack, and for item in &items
as iterating over references to the existing list in place, while for item in items
consumes items
, such that each item
“moves into” the body of the for
loop (and is dropped at the end of each iteration)bytes.clone()
is cheap here, because Bytes
is reference counted)bitter-ability-32190
10/18/2022, 9:51 PMwitty-crayon-22786
10/18/2022, 9:53 PM&path
is redundant, since it will already be a reference.bitter-ability-32190
10/18/2022, 10:01 PM