Commit d3e84f0
committed
Auto merge of #14325 - epage:14321-master, r=weihanglo
fix(publish): Don't strip non-dev features
### What does this PR try to resolve?
First, we added support for stripping of local-only dev-dependencies.
This was dual-implemented for `Cargo.toml` and `Summary`.
This left off stripping of `dep/feature` that reference dev-dependencies
(enabling features within dev-dependencies).
When we fixed this, we again dual-implemented it.
The `Cargo.toml` version was correct but the `Summary` version was
instead stripping too many features,
particularly features that reference renamed dependencies.
We didn't have tests for this case and it wasn't caught earlier because
crates.io re-generates the `Summary` from `Cargo.toml`, ignoring what we
post.
That makes this only show up with custom registries that trust what
Cargo posts.
Rather than fixing the `Summary` generation, I remove the
dual-implementation and instead generate the `Summary` from the
published `Cargo.toml`.
Fixes #14321
### How should we test and review this PR?
### Additional information
Unfortunately, we don't have access directly to the packaged
`Cargo.toml`.
It could be passed around and I originally did so, hoping to remove use
of the local `Package`.
However, the local `Package` is needed for things like reading the
`README`.
So I scaled back and isolate the change to only what needs it.
This also makes it easier for `prepare_transmit` callers.
Fully open to someone exploring removing this extra `prepare_for_publish` in the future.File tree
5 files changed
+134
-165
lines changed- src/cargo
- ops
- registry
- util/toml
- tests/testsuite
5 files changed
+134
-165
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| |||
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
896 | | - | |
| 896 | + | |
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
| |||
1299 | 1299 | | |
1300 | 1300 | | |
1301 | 1301 | | |
1302 | | - | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
1303 | 1308 | | |
1304 | 1309 | | |
1305 | 1310 | | |
| |||
1317 | 1322 | | |
1318 | 1323 | | |
1319 | 1324 | | |
1320 | | - | |
| 1325 | + | |
1321 | 1326 | | |
1322 | 1327 | | |
1323 | 1328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
| |||
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | | - | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
185 | 183 | | |
186 | 184 | | |
187 | 185 | | |
| 186 | + | |
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
| |||
324 | 323 | | |
325 | 324 | | |
326 | 325 | | |
327 | | - | |
| 326 | + | |
| 327 | + | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
331 | 334 | | |
332 | 335 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | 336 | | |
338 | 337 | | |
339 | 338 | | |
| |||
378 | 377 | | |
379 | 378 | | |
380 | 379 | | |
381 | | - | |
| 380 | + | |
382 | 381 | | |
383 | 382 | | |
384 | 383 | | |
| |||
395 | 394 | | |
396 | 395 | | |
397 | 396 | | |
398 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
399 | 401 | | |
400 | 402 | | |
401 | | - | |
402 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
403 | 406 | | |
404 | 407 | | |
405 | | - | |
406 | | - | |
| 408 | + | |
| 409 | + | |
407 | 410 | | |
408 | 411 | | |
409 | 412 | | |
410 | 413 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | 414 | | |
417 | 415 | | |
418 | 416 | | |
419 | 417 | | |
420 | 418 | | |
421 | 419 | | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
| 420 | + | |
436 | 421 | | |
437 | 422 | | |
438 | 423 | | |
439 | 424 | | |
440 | 425 | | |
441 | 426 | | |
442 | 427 | | |
443 | | - | |
444 | | - | |
| 428 | + | |
| 429 | + | |
445 | 430 | | |
446 | 431 | | |
447 | 432 | | |
| |||
463 | 448 | | |
464 | 449 | | |
465 | 450 | | |
| 451 | + | |
466 | 452 | | |
467 | 453 | | |
468 | 454 | | |
469 | 455 | | |
470 | 456 | | |
471 | 457 | | |
472 | | - | |
| 458 | + | |
473 | 459 | | |
474 | 460 | | |
475 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2551 | 2551 | | |
2552 | 2552 | | |
2553 | 2553 | | |
| 2554 | + | |
2554 | 2555 | | |
2555 | 2556 | | |
2556 | 2557 | | |
2557 | | - | |
| 2558 | + | |
2558 | 2559 | | |
2559 | 2560 | | |
2560 | 2561 | | |
2561 | 2562 | | |
2562 | | - | |
| 2563 | + | |
2563 | 2564 | | |
2564 | 2565 | | |
2565 | 2566 | | |
| |||
2591 | 2592 | | |
2592 | 2593 | | |
2593 | 2594 | | |
2594 | | - | |
| 2595 | + | |
2595 | 2596 | | |
2596 | 2597 | | |
2597 | 2598 | | |
| |||
2608 | 2609 | | |
2609 | 2610 | | |
2610 | 2611 | | |
2611 | | - | |
| 2612 | + | |
| 2613 | + | |
2612 | 2614 | | |
2613 | 2615 | | |
2614 | 2616 | | |
| |||
2712 | 2714 | | |
2713 | 2715 | | |
2714 | 2716 | | |
2715 | | - | |
| 2717 | + | |
2716 | 2718 | | |
2717 | 2719 | | |
2718 | 2720 | | |
2719 | | - | |
2720 | | - | |
2721 | | - | |
2722 | | - | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
2723 | 2727 | | |
2724 | 2728 | | |
2725 | 2729 | | |
| |||
2877 | 2881 | | |
2878 | 2882 | | |
2879 | 2883 | | |
2880 | | - | |
| 2884 | + | |
2881 | 2885 | | |
2882 | 2886 | | |
2883 | 2887 | | |
| |||
2887 | 2891 | | |
2888 | 2892 | | |
2889 | 2893 | | |
2890 | | - | |
| 2894 | + | |
| 2895 | + | |
2891 | 2896 | | |
2892 | 2897 | | |
2893 | 2898 | | |
| |||
2902 | 2907 | | |
2903 | 2908 | | |
2904 | 2909 | | |
2905 | | - | |
| 2910 | + | |
2906 | 2911 | | |
2907 | 2912 | | |
2908 | 2913 | | |
2909 | 2914 | | |
2910 | 2915 | | |
2911 | | - | |
2912 | | - | |
2913 | | - | |
2914 | | - | |
2915 | | - | |
2916 | | - | |
2917 | | - | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
2918 | 2925 | | |
2919 | 2926 | | |
2920 | 2927 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
755 | | - | |
| 755 | + | |
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | | - | |
| 759 | + | |
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
| |||
0 commit comments