Commit 93ac6e1
authored
fix(script): Tweak cargo script build-dir / target-dir (#16086)
### What does this PR try to resolve?
This is meant to unblock efforts for allowing cargo scripts to use
artifact names like `deps` without being sanitized or erroring. This is
done by making the default `target-dir` exclude all `build-dir` content
by putting the default cargo script `target-dir` under `build-dir`.
Cargo script target-dir precedence
| before | after|
|-|-|
| explicit `target-dir`| explicit `target-dir`|
| `"{cargo-cache-home}/target/{workspace-path-hash}"` |
**`"{build-dir}/target"`** |
Cargo script build-dir precedence
| before | after|
|-|-|
| explicit `build-dir`| explicit `build-dir`|
| explicit `target-dir`| explicit `target-dir`|
| `"{cargo-cache-home}/target/{workspace-path-hash}"` |
`"{cargo-cache-home}/target/{workspace-path-hash}"` |
In doing this split, it highlighted the fact that we still had
`Cargo.lock` for cargo scripts in `target-dir` despite being an
intermediate build artifact, so this also moves that into `build-dir`.
This does mean that if someone has a shared `build-dir` between their
projects, their scripts will get a bit confusing. I plan to highlight
that in the tracking issue / stabilization report.
### How to test and review this PR?
## Notes
Work left to do for artifact names
- Stop creating `examples/` when its not used
- Move the conflict check from parse time to build time
- Make the conflict check dependent on if `target_dir == build_dir`2 files changed
+66
-55
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
443 | 446 | | |
444 | 447 | | |
445 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
446 | 457 | | |
447 | 458 | | |
448 | | - | |
| 459 | + | |
449 | 460 | | |
450 | 461 | | |
451 | 462 | | |
452 | 463 | | |
453 | 464 | | |
454 | 465 | | |
455 | 466 | | |
456 | | - | |
| 467 | + | |
457 | 468 | | |
458 | 469 | | |
459 | 470 | | |
| |||
0 commit comments