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

FIX: Don't try to generate Gargo.lock on empty workspaces. #3092

Merged
merged 1 commit into from
Sep 14, 2016
Merged

FIX: Don't try to generate Gargo.lock on empty workspaces. #3092

merged 1 commit into from
Sep 14, 2016

Conversation

jhbabon
Copy link
Contributor

@jhbabon jhbabon commented Sep 14, 2016

There was a panic! when the command cargo update was executed in a workspace like this:

mkdir ws
cd ws
echo '[workspace]' > Cargo.toml
cargo new p1
cargo new p2
cargo update

The problem is that cargo tries to generate the Cargo.lock file even if there aren't any members on the workspace.

This fix checks the existence of members in the workspace before trying to do anything so at least we report an error instead of throwing a panic!.

Issue related #3080

There was a panic! when the command `cargo update` was
executed in a workspace like this:

    mkdir ws
    cd ws
    echo '[workspace]' > Cargo.toml
    cargo new p1
    cargo new p2
    cargo update

The problem is that cargo tries to generate the Cargo.lock file
even if there aren't any members on the workspace.

This fix checks the existence of members in the workspace before trying
to do anything so at least we report an error instead of throwing a
panic!
@alexcrichton
Copy link
Member

@bors: r+ 015e797

Looks good to me, thanks @jhbabon!

@bors
Copy link
Contributor

bors commented Sep 14, 2016

⌛ Testing commit 015e797 with merge 9399229...

bors added a commit that referenced this pull request Sep 14, 2016
…chton

FIX: Don't try to generate Gargo.lock on empty workspaces.

There was a `panic!` when the command `cargo update` was executed in a workspace like this:

    mkdir ws
    cd ws
    echo '[workspace]' > Cargo.toml
    cargo new p1
    cargo new p2
    cargo update

The problem is that cargo tries to generate the `Cargo.lock` file even if there aren't any members on the workspace.

This fix checks the existence of members in the workspace before trying to do anything so at least we report an error instead of throwing a `panic!`.

Issue related #3080
@bors
Copy link
Contributor

bors commented Sep 14, 2016

☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64
Approved by: alexcrichton
Pushing 9399229 to master...

@bors bors merged commit 015e797 into rust-lang:master Sep 14, 2016
@jhbabon jhbabon deleted the fix/dont-panic-on-workspaces branch September 14, 2016 22:09
@jhbabon
Copy link
Contributor Author

jhbabon commented Sep 14, 2016

Cool, thanks @alexcrichton

I must say that this bors bot it's really cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants