Commit 2c283a9
authored
fix(publish): Move
When `target_dir == build_dir`, ensure `cargo publish` doesn't put
intermediate artifacts in the final artifact location of `cargo
package`.
### What does this PR try to resolve?
In rust-lang#15910, users could identify that `.crate` files from `cargo publish`
are not final artifacts by setting a custom `build-dir`. This extends
that to all users, ie when `build-dir = target-dir` (the default
currently), making it clear that these files are internal.
This also cleans things up by consolidating all of the uplifting logic
and avoids dealing with overlapping `target_dir` and `build_dir`.
### How to test and review this PR?
### Notes
We could optimize this further by doing a `rename` and only doing a copy
if that fails, effectively a `rename_or_copy` as opposed to our
`hardlink_or_copy` we normally use for uplifting. The difference is that
we don't do change tracking for `.crate` files but fully re-generate, so
we don't benefit from keeping the `.crate` around in the original
location..crate out of final artifact location (rust-lang#15915)File tree
3 files changed
+14
-27
lines changed- src/cargo/ops/cargo_package
- tests/testsuite
3 files changed
+14
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 166 | + | |
| 167 | + | |
171 | 168 | | |
172 | 169 | | |
173 | 170 | | |
| |||
179 | 176 | | |
180 | 177 | | |
181 | 178 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | 179 | | |
187 | 180 | | |
188 | 181 | | |
189 | | - | |
| 182 | + | |
190 | 183 | | |
191 | 184 | | |
192 | 185 | | |
| |||
220 | 213 | | |
221 | 214 | | |
222 | 215 | | |
| 216 | + | |
223 | 217 | | |
224 | 218 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
240 | 227 | | |
241 | 228 | | |
242 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
528 | 527 | | |
| 528 | + | |
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
497 | 496 | | |
| 497 | + | |
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| |||
0 commit comments