bored-art-40741
03/21/2021, 5:47 PMWorkspace
is. Is this like a hermetic temp directory made for each rule execution, or process invocation? Based on poking around at code, I'm having trouble deciding whether it's just for interacting with the equivalent of dist/
, (i.e. "repo global"), or if it's a sandbox for hermetizing task activitywitty-crayon-22786
03/21/2021, 6:06 PMwitty-crayon-22786
03/21/2021, 6:06 PM@goal_rule
switty-crayon-22786
03/21/2021, 6:09 PMdist
, but it’s also capable of writing files anywhere else in the working copy, so it’s used by the fmt
goal to re-format code, and tailor
to write update BUILD filesbored-art-40741
03/21/2021, 6:10 PMbored-art-40741
03/21/2021, 6:10 PMoutput_directories
and output_files
?bored-art-40741
03/21/2021, 6:12 PMProcess
chroot? (I'm assuming that all processes are run in some sort of chroot-like temp dir)bored-art-40741
03/21/2021, 6:13 PMoutput_directories=(".",)
?witty-crayon-22786
03/21/2021, 6:16 PMis there a notion of just implicitly capturing all writes to theno, there isn’t… this is mostly for conformance with the remoting APIchroot?Process
witty-crayon-22786
03/21/2021, 6:16 PMwitty-crayon-22786
03/21/2021, 6:16 PMbored-art-40741
03/21/2021, 6:16 PMwitty-crayon-22786
03/21/2021, 6:17 PMwitty-crayon-22786
03/21/2021, 6:18 PMwitty-crayon-22786
03/21/2021, 6:19 PMoutput_directories=(".",)
would work, but i think that it would rarely be what you want, because it would re-capture all of the inputs as wellbored-art-40741
03/21/2021, 6:20 PMbored-art-40741
03/21/2021, 6:20 PMwitty-crayon-22786
03/21/2021, 6:22 PMbored-art-40741
03/21/2021, 6:23 PMwitty-crayon-22786
03/21/2021, 6:25 PMbored-art-40741
03/21/2021, 6:26 PMProcess
invocation but might give you performance improvements because of sideband cachingwitty-crayon-22786
03/21/2021, 6:26 PMProcess
es run in sandboxes, which you can preserve and inspect by setting --no-process-execution-cleanup-local-dirs
bored-art-40741
03/21/2021, 6:27 PMwitty-crayon-22786
03/21/2021, 6:27 PMwitty-crayon-22786
03/21/2021, 6:28 PMAnd even those it seems need to be treated with care, as though they’re ephemeral to ayea, exactly. they’re only for well behaved append-only caches.invocation but might give you performance improvements because of sideband cachingProcess
witty-crayon-22786
03/21/2021, 6:36 PM--no-*-cleanup
to the Process
page. was already on the debugging page: https://www.pantsbuild.org/docs/rules-api-tips#debugging-look-inside-the-chrootfast-nail-55400
03/21/2021, 7:23 PM… i don’t know off the top of my head whether output_directories=(“.”,) would work, but i think that it would rarely be what you want, because it would re-capture all of the inputs as wellREAPI does support the empty string as an output directory to capture the entire input root, but (a) I’m not sure Pants supports it; and (b) I agree with Stu that is probably not what you want. I suggest designing how you want jar files to show up in input roots and then have the fetch process generate that directory structure when capturing.
fast-nail-55400
03/21/2021, 7:31 PM__coursier__/cache
and (2) then capture specific jar resolutions from the cache as output directories, e.g. __coursier__/cache/https/repo1.maven.org/maven2/io/circe/circe-generic_2.13/0.12.3/
(or as an output file if that works better). then you’ll have a digest for each resolved jar and could construct a specific input root from those digestsfast-nail-55400
03/21/2021, 7:35 PMcoursier fetch foo:1.2.3 bar:5.6.7
into two synthetic actions for coursiser fetch foo:1.2.3
and coursier fetch bar:5.6.7
)fast-nail-55400
03/21/2021, 7:37 PMwitty-crayon-22786
03/21/2021, 7:38 PMwitty-crayon-22786
03/21/2021, 7:40 PMfetch
is transitive, so you can’t split itbored-art-40741
03/21/2021, 7:55 PMbored-art-40741
03/21/2021, 8:00 PMDigest
witty-crayon-22786
03/21/2021, 8:01 PMwitty-crayon-22786
03/21/2021, 8:03 PMbored-art-40741
03/21/2021, 8:05 PMwitty-crayon-22786
03/21/2021, 8:06 PMwitty-crayon-22786
03/21/2021, 8:06 PMwitty-crayon-22786
03/21/2021, 8:08 PMbored-art-40741
03/21/2021, 8:20 PM