melodic-agent-3403
09/09/2024, 3:37 PMshell_command
rule. The generator pulls in metadata from the environment at build time. I want this metadata to always be fresh when someone runs pants run
or pants package
on anything that uses this rule, even if none of the inputs to the shell_command
rule have changed.
Is there a way to do this? It somewhat breaks pants' purity assumption, but I would like to know if this is a viable solution to get access to "build time environment state".fast-nail-55400
09/09/2024, 4:13 PMfast-nail-55400
09/09/2024, 4:13 PMcache_scope="session"
on shell_command
and adhoc_tool
targets which has the effect of rerunning the process for each Pants invocation.fast-nail-55400
09/09/2024, 4:16 PMfast-nail-55400
09/09/2024, 4:16 PMfast-nail-55400
09/09/2024, 4:17 PMmelodic-agent-3403
09/11/2024, 8:10 AMcache_scope="session"
sounds like exactly what I would need here. For now I worked around it by generating a random file from .pants.bootstrap
and depending on its contents as a "do_not_cache" rule. Feels very hacky, but it does the job.melodic-agent-3403
09/11/2024, 8:15 AMvcs_version
encodes) that we want to have available from Python for versioning and for generating useful user warnings depending on some internal best practices. This must be retained even after PEX packaging, so computing it during the Pants build seemed appropriate.