mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-29 17:05:46 +08:00

This patch adds support for block-based interpolation, so that properties of blocks can be referenced in the current block and across other blocks. Previously, order-of-evaluation did not matter for blocks, and could be evaluated in any order. However, now that blocks can refer to each other, we split out this dynamic evaluation order into a separate resolveBlock function. Additionally, we need to support partial block evaluations - if block A refers to property X of block B, when we should only evaluate property X, and not the entire block. This ensures that we can safely evaluate blocks that refer to other properties within themselves, and allows sequences that would otherwise be co-recursive. We take special care in this logic to ensure that each property is evaluated once *and only* once - this could otherwise present inconsistencies with stateful functions, and could risk inconsistent results. Signed-off-by: Justin Chadwell <me@jedevc.com>