I want to call external processes during configura...
# configuration-cache
t
I want to call external processes during configuration to grab ephemeral data for use in build scans. I don't want this data to impact the configuration cache. Is there a way to achieve this? I'm looking at https://docs.gradle.org/7.5-rc-1/userguide/configuration_cache.html#config_cache:requirements:external_processes, and note that I have
enableFeaturePreview "STABLE_CONFIGURATION_CACHE"
as well (in an experimental branch)
m
We are working on a solution for the build scan use case which is scheduled for 7.6, but so far it is not possible. Are you using a
background
block for this? It is possible to achieve what you want now with a buildFinished block, but it has obvious performance cost.
g
We’re using
buildScan.background
blocks to log custom values out of external processes with no problem so far (on 7.4). This was a suggestion from Gradle support a few months back
t
@Mikhail Lopatkin yes, we are using
background
for several of these. Are you saying Gradle wouldn't warn if I used
buildFinished
instead? I can confirm that many of the warnings go away if I use
buildFinished
instead
m
Yes,
buildFinished
happens way after the configuration phase, and the configuration cache stops tracking inputs at the end of the configuration phase.
👍 1
t
@Mikhail Lopatkin another use-case for running processes during a build is, we have a shared build service that gets the thermal state of the CPU, and then at the end of the build we produce a report showing how hot the laptop was 😂 It shouldn't be an input to the configuration state
m
Thanks, that's an interesting use case. Do you want to cover the configuration phase with this thermal tracking too?
t
ideally the whole build, from hitting
enter
on the command line, to the build finishing. If the configuration phase is skipped due to CC, that's fine. We started doing this when we observed how hot our mac book pros would get during builds and were looking to correlate that with build performance