Commit 2adc53c
committed
build: parallelize forced reference evaluation
Use an errgroup helper to evaluate result refs concurrently during forced
evaluation, and fail fast on the first evaluation error.
This mitigates current case in bake where chained targets with
a multi-platform build could miss secrets and other session properties.
The outline for the issue case:
- Base target is solved but only lazily and not really loaded/tracked
in build graph yet.
- Child targets are loaded, base target waits.
- Evaluate is called for base stage (because it might be missing result
condition), child stage is processed as build result. This happens in
parallel.
- Because `Evaluate()` was called synchronously, it may have not been
called yet for the second platform while the child target already
needs to run `RUN --mount=type=secret`.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>1 parent d315c08 commit 2adc53c
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
633 | | - | |
| 633 | + | |
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
| |||
1321 | 1321 | | |
1322 | 1322 | | |
1323 | 1323 | | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1324 | 1342 | | |
1325 | 1343 | | |
1326 | 1344 | | |
| |||
0 commit comments