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

cargo install fails from local git checkout #5495

Closed
kjeremy opened this issue May 7, 2018 · 4 comments · Fixed by #7768
Closed

cargo install fails from local git checkout #5495

kjeremy opened this issue May 7, 2018 · 4 comments · Fixed by #7768
Labels
A-git Area: anything dealing with git Command-install

Comments

@kjeremy
Copy link

kjeremy commented May 7, 2018

If I clone diesel from https://github.com/diesel-rs/diesel and enter the diesel_cli directory and attempt to cargo install --path . from there it fails to pick up a local dependency from the repo and fails to install. See: diesel-rs/diesel#1683 for more information.

@alexcrichton
Copy link
Member

Thanks for the report! This is currently because cargo install doesn't respect workspace information. Right now it looks like the diesel crates require workspace information to work as they're relying on [replace] (I think?)

@sgrif would it be possible to switch diesel's internal dependencies to path dependencies? That way this would naturally work as well as depending on git verisons of diesel

@dwijnand
Copy link
Member

dwijnand commented Oct 3, 2018

Is it desired that cargo install respects workspace information?

@alexcrichton
Copy link
Member

I think it makes sense for git and path deps yeah, but not for crates.io

@nixpulvis
Copy link

We just refactored our project to make use of workspaces, but now we don't seem to have a replacement for our install from git instructions: cargo install --git https://github.com/jwilm/alacritty. Original issue in alacritty/alacritty#2378.

Making matters a bit worse, is that the error message isn't very clear:

Caused by:
  multiple packages link to native library `freetype`, but a native library can be linked only once

...

I could see cargo install --git https://github.com/jwilm/alacritty --package alacritty being a solution for our use case anyway. This also follow from #3691, unless I'm missing something.

@ehuss ehuss added A-git Area: anything dealing with git Command-install labels Jan 25, 2020
bors added a commit that referenced this issue Jan 27, 2020
Search for root manifest with ephemeral workspaces

Fixes #5495.

This seems like it's too simple to just work like this, but after trying a few different things, this was the only solution which worked reliably for me.

I've verified that no `/target` is present in the actual checkout location, the target directory used is actually the one created in `/tmp`.

I've also verified that both workspaces and "normal" packages still install through git and that a normal `cargo install --path` works too (though that doesn't use ephemeral workspaces anyways).
@bors bors closed this as completed in 29ef271 Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: anything dealing with git Command-install
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants