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

Add a workspace.default-members config that overrides implied --all #4743

Merged
merged 5 commits into from
Nov 29, 2017

Conversation

SimonSapin
Copy link
Contributor

Fixes #4507.

@rust-highfive
Copy link

r? @matklad

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

@SimonSapin
Copy link
Contributor Author

r? @rust-lang/cargo

Copy link
Member

@matklad matklad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks great to me, let's see what others think!

@@ -46,6 +46,9 @@ pub struct Workspace<'cfg> {
// set above.
members: Vec<PathBuf>,

// The subset of `members` that are “default”.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's expand this comment a bit, to explain when exactly this field is used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote some things.

@@ -370,7 +413,7 @@ impl<'cfg> Workspace<'cfg> {
root_manifest: &Path,
is_path_dep: bool) -> CargoResult<()> {
let manifest_path = paths::normalize_path(manifest_path);
if self.members.iter().any(|p| p == &manifest_path) {
if self.members.contains(&manifest_path) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

-> CargoResult<Self>
{
let all = all || (virtual_ws && package.is_empty());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bikeshedding: this could be match (all, exclude.is_empty(), package.is_empty()) and (false, true, true)...

Copy link
Contributor Author

@SimonSapin SimonSapin Nov 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that at first and found it confusing when it came to writing all the patterns. Both because of boolean overload, and because false felt like "negative" and so "not present".

@matklad
Copy link
Member

matklad commented Nov 28, 2017

@withoutboats ping: could you look at this small addition/nice usability improvement to Cargo.toml format? I'd love to r+ it, but I just want another pair of eyes to look at this feature as a whole :)

@alexcrichton
Copy link
Member

Could this be sure to update the documentation for workspaces as well? I'm not entirely sure what this feature is doing at a first glance and the docs would certainly help me learn!

@SimonSapin
Copy link
Contributor Author

Sure. Are the sources for what will become "the cargo book" still at src/doc in this repo?

@SimonSapin
Copy link
Contributor Author

Pushed a couple more commits.

@SimonSapin
Copy link
Contributor Author

CI had an identical failure on all platforms, but I couldn’t reproduce :/

failures:
---- frozen_flag_preserves_old_lockfile stdout ----
	running `/home/travis/build/SimonSapin/cargo/target/debug/cargo build --locked`
thread 'frozen_flag_preserves_old_lockfile' panicked at '
Expected: execs
    but: exited with exit code: 101
--- stdout
--- stderr
    Updating registry `file:///home/travis/build/SimonSapin/cargo/target/cit/t0/registry`
error: checksum for `foo v0.1.0` changed between lock files
this could be indicative of a few possible errors:
    * the lock file is corrupt
    * a replacement source in use (e.g. a mirror) returned a different checksum
    * the source itself may be corrupt in one way or another
unable to verify that `foo v0.1.0` is the same as when the lockfile was generated
', /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/hamcrest-0.1.1/src/core.rs:31:12
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failures:
    frozen_flag_preserves_old_lockfile

@matklad
Copy link
Member

matklad commented Nov 28, 2017

Wait, this is exactly the issue that @nrc was seeing recently!

@nrc
Copy link
Member

nrc commented Nov 28, 2017

Yeah, I saw this failure on the Rust CI, (after updating RLS and Rustfmt and not touching Cargo). I could repro locally inside Rust, but not in Cargo's own repo. I got nowhere trying to investigate. I would love if we could just disable this test for now so I can land the RLS/Rustfmt update.

@alexcrichton
Copy link
Member

Sounds reasonable to me from a feature perspective!

@matklad
Copy link
Member

matklad commented Nov 29, 2017

@bors r+

The test should now be fixed in master.

Thanks @SimonSapin !

@bors
Copy link
Collaborator

bors commented Nov 29, 2017

📌 Commit 82d563b has been approved by matklad

@bors
Copy link
Collaborator

bors commented Nov 29, 2017

⌛ Testing commit 82d563b with merge 5bb478a...

bors added a commit that referenced this pull request Nov 29, 2017
Add a workspace.default-members config that overrides implied --all

Fixes #4507.
@bors
Copy link
Collaborator

bors commented Nov 29, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: matklad
Pushing 5bb478a to master...

@bors bors merged commit 82d563b into rust-lang:master Nov 29, 2017
@matklad matklad added the relnotes Release-note worthy label Nov 29, 2017
SimonSapin added a commit to SimonSapin/rust that referenced this pull request Nov 30, 2017
kennytm added a commit to kennytm/rust that referenced this pull request Dec 1, 2017
Update Cargo to Wed Nov 29 15:19:05 2017 +0000

rust-lang/cargo@5bb478a

Pick up `workspace.default-members` support: rust-lang/cargo#4743
@@ -520,8 +520,19 @@ crate will be treated as a normal package, as well as a workspace. If the
manifest*.

When working with *virtual manifests*, package-related cargo commands, like
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong - an earlier commit makes default-members work for non-virtual manifests too, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I forgot about that when writing the docs. Submitted #4784, thanks.

SimonSapin added a commit to servo/servo that referenced this pull request Dec 4, 2017
…ild'

… and 'cargo test', etc. Include Servo and its unit tests,
but not Stylo because that would try to compile the style
crate with incompatible feature flags:
rust-lang/cargo#4463

`workspace.default-members` was added in
rust-lang/cargo#4743.
Older Cargo versions ignore it.
SimonSapin added a commit to servo/servo that referenced this pull request Dec 4, 2017
…ild'

… and 'cargo test', etc. Include Servo and its unit tests,
but not Stylo because that would try to compile the style
crate with incompatible feature flags:
rust-lang/cargo#4463

`workspace.default-members` was added in
rust-lang/cargo#4743.
Older Cargo versions ignore it.
SimonSapin added a commit to servo/servo that referenced this pull request Dec 4, 2017
…ild'

… and 'cargo test', etc. Include Servo and its unit tests,
but not Stylo because that would try to compile the style
crate with incompatible feature flags:
rust-lang/cargo#4463

`workspace.default-members` was added in
rust-lang/cargo#4743.
Older Cargo versions ignore it.
@SimonSapin SimonSapin deleted the default-members branch December 4, 2017 11:44
SimonSapin added a commit to servo/servo that referenced this pull request Dec 5, 2017
…ild'

… and 'cargo test', etc. Include Servo and its unit tests,
but not Stylo because that would try to compile the style
crate with incompatible feature flags:
rust-lang/cargo#4463

`workspace.default-members` was added in
rust-lang/cargo#4743.
Older Cargo versions ignore it.
bors-servo pushed a commit to servo/servo that referenced this pull request Dec 5, 2017
 Use workspace.default-members to specify default crates for cargo build

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19476)
<!-- Reviewable:end -->
bors-servo pushed a commit to servo/servo that referenced this pull request Dec 5, 2017
 Use workspace.default-members to specify default crates for cargo build

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19476)
<!-- Reviewable:end -->
SimonSapin added a commit to servo/servo that referenced this pull request Dec 5, 2017
…ild'

… and 'cargo test', etc. Include Servo and its unit tests,
but not Stylo because that would try to compile the style
crate with incompatible feature flags:
rust-lang/cargo#4463

`workspace.default-members` was added in
rust-lang/cargo#4743.
Older Cargo versions ignore it.
SimonSapin added a commit to servo/servo that referenced this pull request Dec 5, 2017
…ild'

… and 'cargo test', etc. Include Servo and its unit tests,
but not Stylo because that would try to compile the style
crate with incompatible feature flags:
rust-lang/cargo#4463

`workspace.default-members` was added in
rust-lang/cargo#4743.
Older Cargo versions ignore it.
SimonSapin added a commit to servo/servo that referenced this pull request Dec 5, 2017
…ild'

… and 'cargo test', etc. Include Servo and its unit tests,
but not Stylo because that would try to compile the style
crate with incompatible feature flags:
rust-lang/cargo#4463

`workspace.default-members` was added in
rust-lang/cargo#4743.
Older Cargo versions ignore it.
SimonSapin added a commit to servo/servo that referenced this pull request Dec 7, 2017
…ild'

… and 'cargo test', etc. Include Servo and its unit tests,
but not Stylo because that would try to compile the style
crate with incompatible feature flags:
rust-lang/cargo#4463

`workspace.default-members` was added in
rust-lang/cargo#4743.
Older Cargo versions ignore it.
bors-servo pushed a commit to servo/servo that referenced this pull request Dec 7, 2017
 Use workspace.default-members to specify default crates for cargo build

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19476)
<!-- Reviewable:end -->
SimonSapin added a commit to servo/servo that referenced this pull request Dec 7, 2017
…ild'

… and 'cargo test', etc. Include Servo and its unit tests,
but not Stylo because that would try to compile the style
crate with incompatible feature flags:
rust-lang/cargo#4463

`workspace.default-members` was added in
rust-lang/cargo#4743.
Older Cargo versions ignore it.
bors-servo pushed a commit to servo/servo that referenced this pull request Dec 7, 2017
 Use workspace.default-members to specify default crates for cargo build

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19476)
<!-- Reviewable:end -->
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Dec 8, 2017
…t crates for cargo build (from servo:default-members); r=nox

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

Source-Repo: https://github.com/servo/servo
Source-Revision: df68eea3f21cc3bbf24d5bbb66be42c4e3a9e427

--HG--
rename : servo/tests/unit/stylo/Cargo.toml => servo/ports/geckolib/tests/Cargo.toml
rename : servo/tests/unit/stylo/build.rs => servo/ports/geckolib/tests/build.rs
rename : servo/tests/unit/stylo/lib.rs => servo/ports/geckolib/tests/lib.rs
rename : servo/tests/unit/stylo/servo_function_signatures.rs => servo/ports/geckolib/tests/servo_function_signatures.rs
rename : servo/tests/unit/stylo/size_of.rs => servo/ports/geckolib/tests/size_of.rs
rename : servo/tests/unit/stylo/specified_values.rs => servo/ports/geckolib/tests/specified_values.rs
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 0939a7049dc771e9d1b4f45f6e3ade2866266fa4
xeonchen pushed a commit to xeonchen/gecko-cinnabar that referenced this pull request Dec 8, 2017
…t crates for cargo build (from servo:default-members); r=nox

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

Source-Repo: https://github.com/servo/servo
Source-Revision: df68eea3f21cc3bbf24d5bbb66be42c4e3a9e427
aethanyc pushed a commit to aethanyc/gecko-dev that referenced this pull request Dec 19, 2017
…t crates for cargo build (from servo:default-members); r=nox

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

Source-Repo: https://github.com/servo/servo
Source-Revision: df68eea3f21cc3bbf24d5bbb66be42c4e3a9e427
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 2, 2019
…t crates for cargo build (from servo:default-members); r=nox

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

Source-Repo: https://github.com/servo/servo
Source-Revision: df68eea3f21cc3bbf24d5bbb66be42c4e3a9e427

UltraBlame original commit: d1606d726592e798d5cafba5cbbf0f8326d67243
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 2, 2019
…t crates for cargo build (from servo:default-members); r=nox

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

Source-Repo: https://github.com/servo/servo
Source-Revision: df68eea3f21cc3bbf24d5bbb66be42c4e3a9e427

UltraBlame original commit: d1606d726592e798d5cafba5cbbf0f8326d67243
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 2, 2019
…t crates for cargo build (from servo:default-members); r=nox

… and 'cargo test', etc. Include Servo and its unit tests, but not Stylo because that would try to compile the style crate with incompatible feature flags: rust-lang/cargo#4463

`workspace.default-members` was added in rust-lang/cargo#4743. Older Cargo versions ignore it.

Source-Repo: https://github.com/servo/servo
Source-Revision: df68eea3f21cc3bbf24d5bbb66be42c4e3a9e427

UltraBlame original commit: d1606d726592e798d5cafba5cbbf0f8326d67243
@ehuss ehuss added this to the 1.24.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Release-note worthy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a 'worskpace.default-packages' config to override implied --all?
8 participants