Skip to content

Wrong cargo config resolution when using manifest-path #3808

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

Closed
LegNeato opened this issue Mar 8, 2017 · 1 comment
Closed

Wrong cargo config resolution when using manifest-path #3808

LegNeato opened this issue Mar 8, 2017 · 1 comment

Comments

@LegNeato
Copy link

LegNeato commented Mar 8, 2017

When using --manifest-path, cargo appears to be searching for a .cargo/config starting at the directory cargo build was RUN FROM, rather than the manifest-path location.

Directory structure to repro

  • .cargo/
    • config => file containing source config pointing at ./vendor1
  • vendor1/ => does not have serde vendored
  • foo/
    • bar/
      • mycrate/ => the crate I am building
        • .cargo
          • config => file containing source config pointing at ./vendor2
      • Cargo.toml => Standard toml file for mycrate
      • vendor2/ => has serde vendored

Steps to repro

If I run cargo from a different directory and point manifest-path at mycrate/Cargo.toml, it traverses from pwd and finds the top-level .cargo rather than the one in mycrate.

$ cd foo/bar;
$ cargo build --frozen --release --manifest-path ./mycrate/Cargo.toml
error: no matching package named `serde` found (required by `mycrate`)
location searched: registry https://github.com/rust-lang/crates.io-index
version required: = 0.9.11

If I run the same command from mycrate, everything works:

$ cd mycrate
$ cargo build --frozen --release
   Compiling ring v0.6.3
   Compiling winapi v0.2.8
   Compiling language-tags v0.2.2
   Compiling regex-syntax v0.4.0
   Compiling security-framework-sys v0.1.10
   # ....
$
@alexcrichton
Copy link
Member

I believe this is a dupe of #2930, but thanks for the report!

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

No branches or pull requests

2 participants