-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename --out-dir to --artifact-dir #13809
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @epage (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Grim news. Perhaps both flags must be briefly supported to deal with the bootstrap problem. |
4149c00
to
6737e08
Compare
Never mind; it seems I was a bit zealous in replacing |
549b724
to
14624e8
Compare
This should be ready for review now. Not sure if this needs to go through any sort of design process since it's renaming a nightly-only API. There does seem to be some consensus in #6790 that |
@epage Just wanted to make sure this hasn't fallen off your radar--it's ready for review now. |
I have about a month backlog of github notifications that I still need to respond to. |
Could you update the commits for how you'd want them presented for review and merging? |
Per discussion in rust-lang#6790. The --out-dir CLI option and out-dir config option are often confused with the OUT_DIR environment variable, when the two serve very different purposes (the former tells Cargo where to copy build artifacts to, whereas the OUT_DIR environment variable is set *by* Cargo to tell build scripts where to place their generated intermediate artifacts). Renaming the option to something less confusing is a prerequisite to stabilizing it.
Ensure that the old options still work and provide the proper deprecation warning.
I've updated the flag-checking code and squashed most of the commits. Should the deprecation messages provide some sort of warning that the old options will eventually be removed, or are they fine currently? |
@@ -304,6 +304,55 @@ For more information, try '--help'. | |||
.run(); | |||
} | |||
|
|||
#[cargo_test] | |||
fn deprecated_out_dir() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: not important enough for this change but in the future, I generally recommend adding the tests as the first commit (with them passing). Then as you change behavior, that is reflected in how the tests are changed to ensure they still pass. This makes it easier for reviewers to see how behavior changed, we can then show those diffs in posts to the community for them to understand changes, and it helps "test the test" (I've made changes where I thought I was testing the right condition and wasn't).
Thanks! @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 8 commits in 34a6a87d8a2330d8c9d578f927489689328a652d..b1feb75d062444e2cee8b3d2aaa95309d65e9ccd 2024-06-04 15:31:01 +0000 to 2024-06-07 20:16:17 +0000 - Keep lints updated (rust-lang/cargo#14030) - test(lints): Ensure unused optional dep fires for shadowed dep (rust-lang/cargo#14028) - Add `cargo update --breaking` (rust-lang/cargo#13979) - Add tooling to document lints (rust-lang/cargo#14025) - Rename --out-dir to --artifact-dir (rust-lang/cargo#13809) - fix(lints): Add unknown_lints to lints list (rust-lang/cargo#14024) - docs(contrib): Suggest atomic commits with separate test commits (rust-lang/cargo#14014) - test(semver): track the behavior of `--precise <prerelease>` (rust-lang/cargo#14013) r? ghost
Update cargo 8 commits in 34a6a87d8a2330d8c9d578f927489689328a652d..b1feb75d062444e2cee8b3d2aaa95309d65e9ccd 2024-06-04 15:31:01 +0000 to 2024-06-07 20:16:17 +0000 - Keep lints updated (rust-lang/cargo#14030) - test(lints): Ensure unused optional dep fires for shadowed dep (rust-lang/cargo#14028) - Add `cargo update --breaking` (rust-lang/cargo#13979) - Add tooling to document lints (rust-lang/cargo#14025) - Rename --out-dir to --artifact-dir (rust-lang/cargo#13809) - fix(lints): Add unknown_lints to lints list (rust-lang/cargo#14024) - docs(contrib): Suggest atomic commits with separate test commits (rust-lang/cargo#14014) - test(semver): track the behavior of `--precise <prerelease>` (rust-lang/cargo#14013) r? ghost
Progress towards unblocking #6790. Renames the experimental
--out-dir
argument to--artifact-dir
, both to reflect that it's where the final build artifacts will be copied to, and to avoid confusion with theOUT_DIR
environment variable which serves an entirely different purpose.For transition purposes,
--out-dir
argument andout-dir
config key will still work with a deprecation message encouraging the use of the new arg and config key.Rationale
A lot of people seem to be confused by the naming of the
--out-dir
argument, and are misled into thinking it serves the same purpose as theOUT_DIR
environment variable: