Skip to content
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 --all to --workspace #7241

Merged
merged 2 commits into from
Sep 4, 2019
Merged

Rename --all to --workspace #7241

merged 2 commits into from
Sep 4, 2019

Conversation

k-nasa
Copy link
Contributor

@k-nasa k-nasa commented Aug 12, 2019

Background

close: #6977

Description

  • Warn when using the 'all' option
  • Changed help text

@rust-highfive
Copy link

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 12, 2019
@ehuss
Copy link
Contributor

ehuss commented Aug 12, 2019

Thanks! I think I'd like to avoid the warning for now. We can add it later on, and then people will be able to switch to the new flag (to avoid the warning), and still use older versions of Cargo.

Also, can you update the documentation in src/doc?

@k-nasa
Copy link
Contributor Author

k-nasa commented Aug 13, 2019

Ok! I'll change src/doc, but I probably don't have time. May make you wait...

@k-nasa
Copy link
Contributor Author

k-nasa commented Aug 13, 2019

@ehuss I changed src/doc and delete warnning! How about?

@bors
Copy link
Collaborator

bors commented Aug 19, 2019

☔ The latest upstream changes (presumably #7270) made this pull request unmergeable. Please resolve the merge conflicts.

@k-nasa
Copy link
Contributor Author

k-nasa commented Aug 22, 2019

I fixed conflict

@k-nasa
Copy link
Contributor Author

k-nasa commented Aug 23, 2019

@ehuss ?

@ehuss
Copy link
Contributor

ehuss commented Aug 23, 2019

I will follow up once I've had a chance to discuss it with the team, I want to consider @est31's concern about the length of the option.

- man pages
- Slightly reword deprecation notice.
- Include --all in man pages.
- Update some additional usages in code and docs.
@ehuss
Copy link
Contributor

ehuss commented Sep 4, 2019

I added some updates. There were some parts that were missing updates (like the man pages). I also slightly reworded the help text. I also rebased on the latest master.

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 4, 2019

📌 Commit ecf824f has been approved by ehuss

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 4, 2019
bors added a commit that referenced this pull request Sep 4, 2019
Rename `--all` to `--workspace`

## Background

close: #6977

## Description
- Warn when using the 'all' option
- Changed help text
@bors
Copy link
Collaborator

bors commented Sep 4, 2019

⌛ Testing commit ecf824f with merge fe0e5a4...

@est31
Copy link
Member

est31 commented Sep 4, 2019

@ehuss what happened to my suggestion?

@bors
Copy link
Collaborator

bors commented Sep 4, 2019

☀️ Test successful - checks-azure
Approved by: ehuss
Pushing fe0e5a4 to master...

@bors bors merged commit ecf824f into rust-lang:master Sep 4, 2019
@ehuss
Copy link
Contributor

ehuss commented Sep 4, 2019

@ehuss what happened to my suggestion?

I'd like to avoid using short flags unless it is an option that is heavily used. There are some options to reduce the burden of longer flags (shell completion, aliases, etc.). The --all flag will also stay forever, so if you really want to, you can continue to use it. We'd also like to better understand all the scenarios where this flag is even needed, and see if it can be avoided altogether in more situations. We can also always add a short flag at any time in the future.

@est31
Copy link
Member

est31 commented Sep 4, 2019

In one of my multi-crate projects, cargo test only tests the default crate. I didn't realize this so one of my tests regressed. I only noticed much later. Then I switched to always doing cargo test --all manually after each commit. I'm not sure but I think I also need to do cargo check --all to be able to also check some binary targets that the default crate is using as library. Aliases are cool but personally I try to avoid customizing my computer as little as possible. But thanks for giving an explanation at least.

@k-nasa k-nasa deleted the all_to_workspace branch September 4, 2019 02:52
bors added a commit to rust-lang/rust that referenced this pull request Sep 4, 2019
Update cargo, books

## cargo

8 commits in 22f7dd0495cd72ce2082d318d5a9b4dccb9c5b8c..fe0e5a48b75da2b405c8ce1ba2674e174ae11d5d
2019-08-27 16:10:51 +0000 to 2019-09-04 00:51:27 +0000
- Rename `--all` to `--workspace` (rust-lang/cargo#7241)
- Basic standard library support. (rust-lang/cargo#7216)
- Allow using 'config.toml' instead of just 'config' files. (rust-lang/cargo#7295)
- Retry on SSL Connect Error. (rust-lang/cargo#7318)
- minimal-copy `deserialize` for `InternedString` (rust-lang/cargo#7310)
- Fix typo in cargo vendor examples (rust-lang/cargo#7320)
- Fixes around multiple `[patch]` per crate (rust-lang/cargo#7303)
- Improve error messages on mkdir failure (rust-lang/cargo#7306)

## reference

7 commits in d191a0c..090c015
2019-08-15 08:42:23 +0200 to 2019-09-03 13:59:28 -0700
- Fix rust-lang/reference#664: Review Oxford comma usage. (rust-lang/reference#668)
- Fix some links. (rust-lang/reference#667)
- Remove trait object warning. (rust-lang/reference#666)
- Specify pattern types in `let` statements and `for` expressions (rust-lang/reference#663)
- Fix loop expression link. (rust-lang/reference#662)
- async-await initial reference material (rust-lang/reference#635)
- Correct errors in the reference of extern functions definitions and declarations (rust-lang/reference#652)

## rust-by-example

1 commits in 580839d90aacd537f0293697096fa8355bc4e673..e76be6b2dc84c6a992e186157efe29d625e29b94
2019-08-17 23:17:50 -0300 to 2019-09-03 07:42:26 -0300
- Change link to russian translation repository (rust-lang/rust-by-example#1245)

## embedded-book

1 commits in 432ca26686c11d396eed6a59499f93ce1bf2433c..5ca585c4a7552efb546e7681c3de0712f4ae4fdc
2019-08-09 23:20:22 +0000 to 2019-08-27 13:39:14 +0000
- Fixup book CI  (rust-embedded/book#205)
@sharksforarms
Copy link

I also use --all on most of all my cargo commands since the project I work on is a workspace of over 5 modules/crates

Mainly these:
cargo build --all
cargo test --all
cargo fmt --all

Glad --all is staying, it's also shorter to type.

@lnicola
Copy link
Member

lnicola commented Nov 7, 2019

Is it intentional that cargo fmt --workspace doesn't work while cargo fmt --all does?

@ehuss
Copy link
Contributor

ehuss commented Nov 7, 2019

@lnicola Are you sure you have 1.39 (just released today) or newer? It seems to work for me.

@lnicola
Copy link
Member

lnicola commented Nov 7, 2019

$ cargo --version      
cargo 1.40.0-nightly (5da4b4d47 2019-10-28)
$ cargo fmt --all      
$ cargo fmt --workspace
error: Found argument '--workspace' which wasn't expected, or isn't valid in this context

USAGE:
    cargo fmt [FLAGS] [OPTIONS] [-- <rustfmt-options>...]

For more information try --help

@ehuss
Copy link
Contributor

ehuss commented Nov 7, 2019

Oh, sorry, I misread fmt as fix. cargo fmt is an external command with its own arguments. You may file an issue at https://github.com/rust-lang/rustfmt/issues to follow up.

@lnicola
Copy link
Member

lnicola commented Nov 7, 2019

D'oh, I should have realized that. Sorry for spamming.

yvt added a commit to yvt/Stella2 that referenced this pull request Nov 8, 2019
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Nov 11, 2019
Pkgsrc changes:
 * Remove patch which no longer applies (but what about RPATH?)
 * Adapt a few patches to changed files upstream.

Upstream changes:

Version 1.39.0 (2019-11-07)
===========================

Language
--------
- [You can now create `async` functions and blocks with `async fn`,
  `async move {}`, and `async {}` respectively, and you can now call
  `.await` on async expressions.][63209]
- [You can now use certain attributes on function, closure, and function
  pointer parameters.][64010] These attributes include `cfg`, `cfg_attr`,
  `allow`, `warn`, `deny`, `forbid` as well as inert helper attributes used
  by procedural macro attributes applied to items. e.g.
  ```rust
  fn len(
      #[cfg(windows)] slice: &[u16],
      #[cfg(not(windows))] slice: &[u8],
  ) -> usize {
      slice.len()
  }
  ```
- [You can now take shared references to bind-by-move patterns in the
  `if` guards of `match` arms.][63118] e.g.
  ```rust
  fn main() {
      let array: Box<[u8; 4]> = Box::new([1, 2, 3, 4]);

      match array {
          nums
  //      ---- `nums` is bound by move.
              if nums.iter().sum::<u8>() == 10
  //                 ^------ `.iter()` implicitly takes a reference to `nums`.
          => {
              drop(nums);
  //          ----------- Legal as `nums` was bound by move and so we have ownership.
          }
          _ => unreachable!(),
      }
  }
  ```

Compiler
--------
- [Added tier 3\* support for the `i686-unknown-uefi` target.][64334]
- [Added tier 3 support for the `sparc64-unknown-openbsd` target.][63595]
- [rustc will now trim code snippets in diagnostics to fit in your terminal.]
  [63402] **Note** Cargo currently doesn't use this feature. Refer to
  [cargo#7315][cargo/7315] to track this feature's progress.
- [You can now pass `--show-output` argument to test binaries to print the
  output of successful tests.][62600]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
---------
- [`Vec::new` and `String::new` are now `const` functions.][64028]
- [`LinkedList::new` is now a `const` function.][63684]
- [`str::len`, `[T]::len` and `str::as_bytes` are now `const` functions.][63770]
- [The `abs`, `wrapping_abs`, and `overflowing_abs` numeric functions are
  now `const`.][63786]

Stabilized APIs
---------------
- [`Pin::into_inner`]
- [`Instant::checked_duration_since`]
- [`Instant::saturating_duration_since`]

Cargo
-----
- [You can now publish git dependencies if supplied with a `version`.]
  [cargo/7237]
- [The `--all` flag has been renamed to `--workspace`.][cargo/7241] Using
  `--all` is now deprecated.

Misc
----
- [You can now pass `-Clinker` to rustdoc to control the linker used
  for compiling doctests.][63834]

Compatibility Notes
-------------------
- [Code that was previously accepted by the old borrow checker, but rejected by
  the NLL borrow checker is now a hard error in Rust 2018.][63565] This was
  previously a warning, and will also become a hard error in the Rust 2015
  edition in the 1.40.0 release.
- [`rustdoc` now requires `rustc` to be installed and in the same directory to
  run tests.][63827] This should improve performance when running a large
  amount of doctests.
- [The `try!` macro will now issue a deprecation warning.][62672] It is
  recommended to use the `?` operator instead.
- [`asinh(-0.0)` now correctly returns `-0.0`.][63698] Previously this
  returned `0.0`.

[62600]: rust-lang/rust#62600
[62672]: rust-lang/rust#62672
[63118]: rust-lang/rust#63118
[63209]: rust-lang/rust#63209
[63402]: rust-lang/rust#63402
[63565]: rust-lang/rust#63565
[63595]: rust-lang/rust#63595
[63684]: rust-lang/rust#63684
[63698]: rust-lang/rust#63698
[63770]: rust-lang/rust#63770
[63786]: rust-lang/rust#63786
[63827]: rust-lang/rust#63827
[63834]: rust-lang/rust#63834
[63927]: rust-lang/rust#63927
[63933]: rust-lang/rust#63933
[63934]: rust-lang/rust#63934
[63938]: rust-lang/rust#63938
[63940]: rust-lang/rust#63940
[63941]: rust-lang/rust#63941
[63945]: rust-lang/rust#63945
[64010]: rust-lang/rust#64010
[64028]: rust-lang/rust#64028
[64334]: rust-lang/rust#64334
[cargo/7237]: rust-lang/cargo#7237
[cargo/7241]: rust-lang/cargo#7241
[cargo/7315]: rust-lang/cargo#7315
[`Pin::into_inner`]: https://doc.rust-lang.org/std/pin/struct.Pin.html#method.into_inner
[`Instant::checked_duration_since`]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.checked_duration_since
[`Instant::saturating_duration_since`]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.saturating_duration_since
dkim added a commit to dkim/chip8 that referenced this pull request Jan 12, 2020
The `--all` flag in `cargo check/clippy/test` has been deprecated in
favor of `--workspace`: rust-lang/cargo#7241.

`--all` in `cargo fmt` is retained because it has a little different
meaning. From rust-lang/rustfmt#3911:

> For example, when running `cargo fmt` in the root directory of a
> workspace, `cargo fmt` already formats all of the workspace members.
> Running `cargo fmt --all` formats the workspace *plus* any local/path
> based dependencies of the packages in that workspace, regardless of
> whether those local deps are explicit workspace members.
dkim added a commit to dkim/chip8 that referenced this pull request Jan 13, 2020
The `--all` flag in `cargo check/clippy/test` has been deprecated in
favor of `--workspace`: rust-lang/cargo#7241.

`--all` in `cargo fmt` is retained because it has a little different
meaning. From rust-lang/rustfmt#3911:

> For example, when running `cargo fmt` in the root directory of a
> workspace, `cargo fmt` already formats all of the workspace members.
> Running `cargo fmt --all` formats the workspace *plus* any local/path
> based dependencies of the packages in that workspace, regardless of
> whether those local deps are explicit workspace members.
@CAD97
Copy link
Contributor

CAD97 commented Mar 10, 2020

To perfectly mirror the behavior of cargo, the behavior should be

  • cargo fmt: format the default members of the workspace (and workspace-local path dependencies)
  • cargo fmt --workspace: format all of the members of the workspace (and workspace-local path dependencies)

Even if rustfmt decides that --all is the canonical flag for rustfmt, cargo fmt should probably allow both --all and --workspace so that people who are using cargo check --workspace can then also use cargo fmt --workspace without having to learn that, actually, cargo fmt uses --all even though that's a deprecated flag for cargo check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename --all to --workspace
9 participants