`--artifact-dir` (nee `--out-dir`) Tracking Issue
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
Note: this was renamed from --out-dir to --artifact-dir in #13809
Original issue: #4875
Implementation PR: #5203
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#artifact-dir
Issues: https://github.com/rust-lang/cargo/labels/Z-out-dir
Summary
Adds --artifact-dir=PATH flag to cargo build to specify a directory to place final artifacts.
Tasks:
- #5203
- #13809
- Remove
--out-dir - Switch
--artifact-dirto being the directory we uplift directly into with a fallback to the current location (done across all commands includingcargo package) - Evaluate recording requested uplifts and performing them at the end
- Evaluate only creating
examples/if needed (helps if we know a priori what is uplifted) - Detect conflicts in uplifts due to platform-tuple not being included
- (design needed) explore templating of artifact-dir
- Rework to better match https://github.com/rust-lang/cargo/issues/14125#issuecomment-2258708917
Unresolved questions
- Multi-target builds (
--target <one> --target <two>) - #7493
- #6100 — concern about similarity with
--target-dir, proliferation of flags - #6313 — concern about name collisions in workspaces or with examples
- What exactly is the use case for this? In what scenario would it be used where you don't already have an outer build system or script that can copy the files into the correct location?
- Confusion with rustc's
--out-dir(#13809) - Discrepancy or confusion with
build.rssOUT_DIR(depends on ifbuild.rsis generating intermediate or final artifacts) (#13809)
Future possibilities
- Deprecate
--target-dir, hiding it from the CLI help
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the implementation PR #5203, the rename in #13809, and the unstable artifact-dir documentation. Then review the unchecked tasks and unresolved questions, especially the discussion in #14125. The issue does not define one bounded change or a clear completion test; scope would need to be agreed before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100