native icon indicating copy to clipboard operation
native copied to clipboard

[hooks_runner] Omit dependencies between hooks from `HookResult`

Open dcharkes opened this issue 6 months ago • 0 comments

When a build hook or link hook depends on a file from another build hook, that file changing leads to such hook being rerun. However, of no hooks are rerun, then none of those files change. So, the embedder/SDK does not need to know about these files. It shouldn't know about these files, because then it would hash the contents to see if they changed for nothing. This is especially bad if we output for example a large static binary that we then convert into a dynamic library in the link hook.

I don't believe this scenario to be common right now. Tree-shaking (with recorded uses) are an experiment in flux, and metadata is usually a small JSON file. But, we should fix this.

Since there is no structure in the dependencies, we'd need to check the path of the files to see if they are inside the .dart_tool/hooks_runner/.

dcharkes avatar May 13 '25 20:05 dcharkes