Skip to content

If rev is added to git url cargo gives no warnings and has unexpected behavior #8241

Closed
rust-lang/rust
#72901
@mjarkk

Description

@mjarkk

Problem
I have 2 git repos in my Cargo.toml:

[dependencies]
juniper-actix = { git = "https://github.com/graphql-rust/juniper#91a33539", package = "juniper_actix" }
juniper = { git = "https://github.com/graphql-rust/juniper#91a33539" }

When cargo downloads / compiles these packages it shows the #91a33539 2 times:

> cargo build
    Updating git repository `https://github.com/graphql-rust/juniper#91a33539`
   Compiling juniper_codegen v0.14.2 (https://github.com/graphql-rust/juniper#91a33539#91a33539)
   Compiling juniper v0.14.2 (https://github.com/graphql-rust/juniper#91a33539#91a33539)
   Compiling juniper_actix v0.1.0 (https://github.com/graphql-rust/juniper#91a33539#91a33539)

Steps

  1. Run cargo init
  2. Add the deps shown above to the dependencies
  3. Run cargo build

Possible Solution(s)
Show an error with a note to add rev = ".." to the dep or support adding a rev to the URL

Notes

Output of rustup show:

> rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/mark/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (directory override for '/home/mark')
rustc 1.45.0-nightly (7ced01a73 2020-04-30)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-gitArea: anything dealing with gitC-bugCategory: bugS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions