Commit 0746d33
authored
Rollup merge of rust-lang#144303 - Kobzol:bootstrap-tool-cleanup, r=jieyouxu
Consolidate staging for `rustc_private` tools
This PR continues bootstrap refactoring, this time by consolidating staging for `Mode::ToolRustc` tools. This refactoring was in the critical path of refactoring `test`/`dist`/`clippy`/`doc` steps, and getting rid of the rmeta/rlib sysroot copy, because tools are pervasive and they are being used for a lot of things in bootstrap.
The main idea is to explicitly model the fact that a stage N `Mode::ToolRustc` tool always works with two different compilers:
- Stage N-1 rustc (`build_compiler`) builds stage N rustc (`target_compiler`)
- Rlib artifacts from stage N rustc are copied to the sysroot of stage N-1 rustc
- Stage N-1 rustc builds the (stage N) tool itself, the tool links to the rlib artifacts of the stage N rustc
Before, the code often used `compiler`, which meant sometimes the build compiler, sometimes the target compiler, and sometimes neither (looking at you, `download-rustc`). This is especially annoying when you get to a situation where you have an install step that invokes a dist step that invokes a tool build step, where *some* compiler is being propagated through, without it being clear what does that compiler represent. This refactoring hopefully makes that clearer and more explicit. It also gets rid of a few `builder.ensure(Rustc(...))` calls within bootstrap, which is always nice.
`Rustdoc` needs to be handled a bit specially, because it acts as a compiler itself, I documented that in the changes.
It wasn't practical to do these refactorings in multiple PRs, so I did it all in one PR. The meat of the change is 9ee6d1c.
I tested manually that `x build rustdoc` and `x build miri` still works even with `download-rustc`, although I cannot promise any extra support for `download-rustc`, IMO we will just have to reimplement it from scratch in a different way.
As usually, I did some drive-by refactorings to bootstrap, trying to document and clarify things, add more step metadata and tests.
Best reviewed commit-by-commit (note that I renamed `link_compiler` to `target_compiler`, in accordance to the rest of bootstrap, in the last commit).
r? `@jieyouxu`12 files changed
+585
-406
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
1128 | 1128 | | |
1129 | 1129 | | |
1130 | 1130 | | |
1131 | | - | |
| 1131 | + | |
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
| |||
1541 | 1541 | | |
1542 | 1542 | | |
1543 | 1543 | | |
1544 | | - | |
1545 | | - | |
1546 | | - | |
| 1544 | + | |
| 1545 | + | |
1547 | 1546 | | |
1548 | 1547 | | |
1549 | 1548 | | |
| |||
1607 | 1606 | | |
1608 | 1607 | | |
1609 | 1608 | | |
1610 | | - | |
1611 | | - | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
1612 | 1614 | | |
1613 | 1615 | | |
1614 | 1616 | | |
| |||
1621 | 1623 | | |
1622 | 1624 | | |
1623 | 1625 | | |
1624 | | - | |
1625 | | - | |
1626 | | - | |
| 1626 | + | |
| 1627 | + | |
1627 | 1628 | | |
1628 | 1629 | | |
1629 | 1630 | | |
1630 | 1631 | | |
1631 | | - | |
1632 | | - | |
1633 | 1632 | | |
| 1633 | + | |
| 1634 | + | |
1634 | 1635 | | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
| 1636 | + | |
1638 | 1637 | | |
1639 | 1638 | | |
1640 | 1639 | | |
| |||
1645 | 1644 | | |
1646 | 1645 | | |
1647 | 1646 | | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
1651 | | - | |
1652 | | - | |
1653 | | - | |
1654 | | - | |
| 1647 | + | |
1655 | 1648 | | |
1656 | 1649 | | |
1657 | 1650 | | |
1658 | | - | |
| 1651 | + | |
1659 | 1652 | | |
1660 | 1653 | | |
1661 | 1654 | | |
| |||
1676 | 1669 | | |
1677 | 1670 | | |
1678 | 1671 | | |
1679 | | - | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
1680 | 1679 | | |
1681 | 1680 | | |
1682 | 1681 | | |
| |||
1696 | 1695 | | |
1697 | 1696 | | |
1698 | 1697 | | |
1699 | | - | |
| 1698 | + | |
1700 | 1699 | | |
1701 | 1700 | | |
1702 | 1701 | | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
1703 | 1712 | | |
1704 | 1713 | | |
1705 | 1714 | | |
| |||
2186 | 2195 | | |
2187 | 2196 | | |
2188 | 2197 | | |
2189 | | - | |
2190 | | - | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
2191 | 2202 | | |
2192 | 2203 | | |
2193 | 2204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
| 428 | + | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
435 | 439 | | |
436 | 440 | | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
| 441 | + | |
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
| |||
1228 | 1229 | | |
1229 | 1230 | | |
1230 | 1231 | | |
1231 | | - | |
| 1232 | + | |
1232 | 1233 | | |
1233 | 1234 | | |
1234 | 1235 | | |
| |||
1244 | 1245 | | |
1245 | 1246 | | |
1246 | 1247 | | |
1247 | | - | |
| 1248 | + | |
1248 | 1249 | | |
1249 | 1250 | | |
1250 | 1251 | | |
| |||
1254 | 1255 | | |
1255 | 1256 | | |
1256 | 1257 | | |
1257 | | - | |
1258 | 1258 | | |
| 1259 | + | |
| 1260 | + | |
1259 | 1261 | | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
| 1262 | + | |
1263 | 1263 | | |
1264 | 1264 | | |
1265 | 1265 | | |
| |||
1270 | 1270 | | |
1271 | 1271 | | |
1272 | 1272 | | |
1273 | | - | |
| 1273 | + | |
1274 | 1274 | | |
1275 | | - | |
| 1275 | + | |
1276 | 1276 | | |
1277 | 1277 | | |
1278 | 1278 | | |
| |||
1288 | 1288 | | |
1289 | 1289 | | |
1290 | 1290 | | |
1291 | | - | |
| 1291 | + | |
1292 | 1292 | | |
1293 | 1293 | | |
1294 | 1294 | | |
| |||
1298 | 1298 | | |
1299 | 1299 | | |
1300 | 1300 | | |
1301 | | - | |
1302 | 1301 | | |
1303 | | - | |
1304 | | - | |
| 1302 | + | |
| 1303 | + | |
1305 | 1304 | | |
1306 | 1305 | | |
1307 | 1306 | | |
1308 | 1307 | | |
1309 | | - | |
1310 | | - | |
| 1308 | + | |
| 1309 | + | |
1311 | 1310 | | |
1312 | 1311 | | |
1313 | 1312 | | |
| |||
1319 | 1318 | | |
1320 | 1319 | | |
1321 | 1320 | | |
1322 | | - | |
| 1321 | + | |
1323 | 1322 | | |
1324 | | - | |
| 1323 | + | |
1325 | 1324 | | |
1326 | 1325 | | |
1327 | 1326 | | |
| |||
1337 | 1336 | | |
1338 | 1337 | | |
1339 | 1338 | | |
1340 | | - | |
| 1339 | + | |
1341 | 1340 | | |
1342 | 1341 | | |
1343 | 1342 | | |
| |||
1354 | 1353 | | |
1355 | 1354 | | |
1356 | 1355 | | |
1357 | | - | |
1358 | | - | |
1359 | | - | |
1360 | | - | |
1361 | | - | |
1362 | | - | |
1363 | | - | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
1364 | 1360 | | |
1365 | | - | |
| 1361 | + | |
1366 | 1362 | | |
1367 | 1363 | | |
1368 | 1364 | | |
| |||
1464 | 1460 | | |
1465 | 1461 | | |
1466 | 1462 | | |
1467 | | - | |
| 1463 | + | |
1468 | 1464 | | |
1469 | | - | |
| 1465 | + | |
1470 | 1466 | | |
1471 | 1467 | | |
1472 | 1468 | | |
| |||
1482 | 1478 | | |
1483 | 1479 | | |
1484 | 1480 | | |
1485 | | - | |
| 1481 | + | |
1486 | 1482 | | |
1487 | 1483 | | |
1488 | 1484 | | |
| |||
1492 | 1488 | | |
1493 | 1489 | | |
1494 | 1490 | | |
1495 | | - | |
1496 | | - | |
| 1491 | + | |
| 1492 | + | |
1497 | 1493 | | |
1498 | | - | |
| 1494 | + | |
| 1495 | + | |
1499 | 1496 | | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
| 1497 | + | |
1503 | 1498 | | |
1504 | 1499 | | |
1505 | 1500 | | |
| |||
1546 | 1541 | | |
1547 | 1542 | | |
1548 | 1543 | | |
1549 | | - | |
| 1544 | + | |
1550 | 1545 | | |
1551 | 1546 | | |
1552 | 1547 | | |
| |||
1567 | 1562 | | |
1568 | 1563 | | |
1569 | 1564 | | |
1570 | | - | |
1571 | | - | |
| 1565 | + | |
| 1566 | + | |
1572 | 1567 | | |
1573 | | - | |
1574 | | - | |
| 1568 | + | |
| 1569 | + | |
1575 | 1570 | | |
1576 | 1571 | | |
1577 | 1572 | | |
| |||
0 commit comments