Commit 78a5531
authored
fix(publish): Don't generate final artifacts (#15910)
### What does this PR try to resolve?
When splitting `build-dir` out of `target-dir` (see #14125), we kept
`.crate` files as final artifacts of `cargo package`. However, that also
made them final artifacts of `cargo publish` when the side effect of
that should be the publish operation.
This changes things so that we instead package within `build-dir` and
`cargo package` then uplifts these to `target-dir`.
Behavior change: when running `cargo publish` without `build-dir` set,
`target/package/*.crate` will be moved to
`target/package/tmp-crate/*.crate`. This should be fine as its an
intermediate artifact but there is a risk that this can break someone
who did not realize that. Part of the reason for making the `build-dir`
/ `target-dir` split is to make our intermediate/final artifact intent
clearer. We did intend to be a transition period before changing things,
like with #15010. I'm assuming its fine that we don't have a transition
period here.
### How to test and review this PR?
### Notes
This was discussed at [#t-cargo > `-Zbuild-dir` and `cargo
publish` / `cargo package` @
💬](https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/.60-Zbuild-dir.60.20and.20.60cargo.20publish.60.20.2F.20.60cargo.20package.60/near/537336819)File tree
3 files changed
+56
-6
lines changed- src
- cargo/ops/cargo_package
- doc/src/reference
- tests/testsuite
3 files changed
+56
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
224 | 241 | | |
225 | 242 | | |
226 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
362 | 395 | | |
363 | 396 | | |
364 | 397 | | |
| |||
0 commit comments