Commit f040eaa
committed
Fix two-phase CA derivation resolution and
Fix several issues with the `ca-resolve-two-phase` branch:
- Fix `find_build_step_outputs` SQL: `?` → `$1` (PostgreSQL), add
`s.build = o.build` join condition
- Fix dep graph propagation: when resolving a CA derivation, remove
the original step from each dependent's deps and replace with the
resolved step, so downstream steps become runnable
- Skip two-phase resolution for CA floating drvs with only `Opaque`
inputs (no `Built` deps) — these are already resolved
- Replace `resolvedToStep` (integer FK) with `resolvedDrvPath` (text
basename) so output lookups work across builds by drv path
So it turns out that only scheduled or finishes steps go in the DB
with the current desing. Steps which totally pending (blocked on other
steps, for example) just live in memory. So we won't get our step
number at resolution time to use as a foreign key.
Instead, we can just write down the drv path, which is enough for the
in-memory step, and only when that step is processsed will something
end up in the data base.
- Remove eager `create_build_step` for resolved steps — the DB entry
is created when the step is actually dispatched
very much corresponds to the above
- Skip dyn-drv integration test (dynamic derivation resolution not
yet implemented in Hydra)
Our passing it was very much a lie before. Our failing it now is more
honest.
- Add unit tests for `resolve_drv_output_chains` with resolved steps
Also, did this general cleanup which should be pulled out of this commit
and landed on master independently, first.
- Refactor `db` crate to use `StorePath` and `OutputName` types instead
of raw `&str` for drv paths, output paths, and output names.
We want to make the core logic all using nice types, and get away from
not-nice types as soon as possible after getting out the database.
This does that.
- Add `store_dir: &StoreDir` parameter to db functions that need to
render `StorePath` to full paths for legacy DB columnsStorePath type safety1 parent d9526df commit f040eaa
10 files changed
Lines changed: 527 additions & 358 deletions
File tree
- subprojects
- crates/db/src
- hydra-queue-runner/src
- state
- hydra-tests/content-addressed
- hydra
- lib/Hydra/Schema/Result
- sql
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
338 | 337 | | |
339 | 338 | | |
340 | 339 | | |
| 340 | + | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | 354 | | |
361 | 355 | | |
362 | 356 | | |
| |||
376 | 370 | | |
377 | 371 | | |
378 | 372 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
404 | 402 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
412 | 416 | | |
| 417 | + | |
413 | 418 | | |
414 | 419 | | |
415 | | - | |
| 420 | + | |
| 421 | + | |
416 | 422 | | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
| 423 | + | |
429 | 424 | | |
430 | | - | |
431 | | - | |
432 | 425 | | |
433 | 426 | | |
434 | 427 | | |
| |||
499 | 492 | | |
500 | 493 | | |
501 | 494 | | |
502 | | - | |
503 | | - | |
504 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
505 | 501 | | |
506 | 502 | | |
| 503 | + | |
507 | 504 | | |
508 | 505 | | |
509 | 506 | | |
| |||
717 | 714 | | |
718 | 715 | | |
719 | 716 | | |
| 717 | + | |
720 | 718 | | |
721 | | - | |
| 719 | + | |
722 | 720 | | |
723 | 721 | | |
724 | 722 | | |
| |||
1560 | 1558 | | |
1561 | 1559 | | |
1562 | 1560 | | |
| 1561 | + | |
1563 | 1562 | | |
1564 | 1563 | | |
1565 | | - | |
| 1564 | + | |
1566 | 1565 | | |
1567 | 1566 | | |
1568 | 1567 | | |
| |||
1578 | 1577 | | |
1579 | 1578 | | |
1580 | 1579 | | |
1581 | | - | |
1582 | | - | |
1583 | | - | |
1584 | | - | |
1585 | | - | |
1586 | | - | |
1587 | 1580 | | |
1588 | 1581 | | |
1589 | 1582 | | |
| |||
1622 | 1615 | | |
1623 | 1616 | | |
1624 | 1617 | | |
1625 | | - | |
| 1618 | + | |
1626 | 1619 | | |
1627 | 1620 | | |
1628 | 1621 | | |
| |||
1698 | 1691 | | |
1699 | 1692 | | |
1700 | 1693 | | |
1701 | | - | |
| 1694 | + | |
1702 | 1695 | | |
1703 | 1696 | | |
1704 | 1697 | | |
| |||
1711 | 1704 | | |
1712 | 1705 | | |
1713 | 1706 | | |
1714 | | - | |
| 1707 | + | |
1715 | 1708 | | |
1716 | 1709 | | |
1717 | 1710 | | |
1718 | | - | |
| 1711 | + | |
| 1712 | + | |
1719 | 1713 | | |
1720 | 1714 | | |
1721 | 1715 | | |
| |||
1728 | 1722 | | |
1729 | 1723 | | |
1730 | 1724 | | |
| 1725 | + | |
1731 | 1726 | | |
1732 | 1727 | | |
1733 | | - | |
| 1728 | + | |
1734 | 1729 | | |
1735 | 1730 | | |
1736 | 1731 | | |
| |||
1739 | 1734 | | |
1740 | 1735 | | |
1741 | 1736 | | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | 1737 | | |
1749 | 1738 | | |
1750 | 1739 | | |
| |||
2155 | 2144 | | |
2156 | 2145 | | |
2157 | 2146 | | |
2158 | | - | |
2159 | | - | |
2160 | | - | |
2161 | | - | |
2162 | | - | |
2163 | | - | |
2164 | | - | |
2165 | | - | |
2166 | | - | |
2167 | | - | |
2168 | | - | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
2169 | 2150 | | |
2170 | 2151 | | |
2171 | 2152 | | |
| |||
2179 | 2160 | | |
2180 | 2161 | | |
2181 | 2162 | | |
| 2163 | + | |
2182 | 2164 | | |
2183 | 2165 | | |
2184 | | - | |
| 2166 | + | |
2185 | 2167 | | |
2186 | 2168 | | |
2187 | 2169 | | |
| |||
2233 | 2215 | | |
2234 | 2216 | | |
2235 | 2217 | | |
2236 | | - | |
| 2218 | + | |
2237 | 2219 | | |
2238 | 2220 | | |
2239 | 2221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
354 | 362 | | |
355 | 363 | | |
356 | 364 | | |
| |||
0 commit comments