bored-art-40741
03/21/2021, 2:39 AMcoursier fetch
, which returns me a report on which jars were fetched and the absolute paths where they were fetched. They're fetched into a subdir of global_options.options.named_caches_dir
. But now I want to gather up only the jars that were relevant to this resolve into a Digest
where the jars have been flattened out (or at least have the named cache prefix trimmed off). AFAICT the only way to do this would be with PathGlobs
, but it only works on paths relative to the build root. Is there some other way to capture arbitrary files from known locations on disk into a Digest
?fast-nail-55400
03/21/2021, 3:23 AMRemovePrefix
would help? https://github.com/pantsbuild/pants/blob/64a69b8e1f596308895153222c2b5e1377ccd5d3/src/python/pants/engine/fs.py#L216witty-crayon-22786
03/21/2021, 4:01 AMIs there some other way to capture arbitrary files from known locations on disk into athe?Digest
named_caches
are only intended to be accessible from inside of Process
runs: so running a process that copies the files out of the named_caches and into its own directory, where they can be captured using the output_directories
or output_files
of the Process
would be the right way to go about it probablywitty-crayon-22786
03/21/2021, 4:03 AMProcess
, but there is no guarantee that the first and second processes will run on the same machinewitty-crayon-22786
03/21/2021, 4:24 AMbored-art-40741
03/21/2021, 5:23 PMRemovePrefix
, but you need to get to a Digest
first, which is where I was stuck.bored-art-40741
03/21/2021, 5:25 PMbored-art-40741
03/21/2021, 5:25 PMwitty-crayon-22786
03/21/2021, 6:03 PMI suppose I just trust that the CAKVS is smart enough to deduplicate individual jars that get slurped in from the named cacheexactly: it ignores timestamps and filenames
witty-crayon-22786
03/21/2021, 6:03 PMProcess
is not a probelm.witty-crayon-22786
03/21/2021, 7:55 PMbored-art-40741
03/21/2021, 7:57 PM