Commit eddf7b7
committed
fix(publish): Don't strip non-dev features
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`.
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.
Fixes #143211 parent dc9014d commit eddf7b7
File tree
4 files changed
+30
-39
lines changed- src/cargo/ops
- registry
- tests/testsuite
4 files changed
+30
-39
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 | | |
| |||
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 | | |
| 326 | + | |
327 | 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 | 403 | | |
402 | 404 | | |
403 | 405 | | |
404 | 406 | | |
405 | 407 | | |
406 | | - | |
| 408 | + | |
407 | 409 | | |
408 | 410 | | |
409 | 411 | | |
410 | 412 | | |
411 | 413 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | 414 | | |
418 | 415 | | |
419 | 416 | | |
420 | 417 | | |
421 | 418 | | |
422 | 419 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
| 420 | + | |
437 | 421 | | |
438 | 422 | | |
439 | 423 | | |
440 | 424 | | |
441 | 425 | | |
442 | 426 | | |
443 | 427 | | |
444 | | - | |
445 | | - | |
| 428 | + | |
| 429 | + | |
446 | 430 | | |
447 | 431 | | |
448 | 432 | | |
| |||
464 | 448 | | |
465 | 449 | | |
466 | 450 | | |
| 451 | + | |
467 | 452 | | |
468 | 453 | | |
469 | 454 | | |
470 | 455 | | |
471 | 456 | | |
472 | 457 | | |
473 | | - | |
| 458 | + | |
474 | 459 | | |
475 | 460 | | |
476 | 461 | | |
| |||
| 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 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1865 | 1865 | | |
1866 | 1866 | | |
1867 | 1867 | | |
1868 | | - | |
| 1868 | + | |
| 1869 | + | |
1869 | 1870 | | |
1870 | 1871 | | |
1871 | 1872 | | |
| |||
0 commit comments