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

Successful build keeps trying to update from remote repo #3235

Closed
gavinb opened this issue Oct 27, 2016 · 9 comments · Fixed by #3248
Closed

Successful build keeps trying to update from remote repo #3235

gavinb opened this issue Oct 27, 2016 · 9 comments · Fixed by #3248

Comments

@gavinb
Copy link

gavinb commented Oct 27, 2016

Working with rust-rosetta, rev 3b5fd74d.

I performed the following steps:

cargo update
cargo clean
cargo build

This all completes successfully. At this stage, I have all the dependencies required, and have successfully built all the crates and targets.

However each time I run cargo build, it keeps updating the open-ssl repo:

$ cargo build
Updating git repository `https://github.com/sfackler/rust-openssl`
Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs

What this means is that it is not possible to work offline, as the build tries to update the repo, failing with the following:

$ cargo build
    Updating git repository `https://github.com/sfackler/rust-openssl`
warning: spurious network error (2 tries remaining): [12/-1] Failed to resolve address for github.com: nodename nor servname provided, or not known
warning: spurious network error (1 tries remaining): [12/-1] Failed to resolve address for github.com: nodename nor servname provided, or not known
error: failed to load source for a dependency on `openssl-sys`

Caused by:
  Unable to update https://github.com/sfackler/rust-openssl

Caused by:
  failed to fetch into /Users/gavinb/.cargo/git/db/rust-openssl-41da9d20ce19f5aa

To learn more, run the command again with --verbose.

I would expect to be able to work offline once you have successfully completed a build.

This is not the only situation where I have discovered that working offline with cargo can be problematic, but it is an easily described and reproducible example.

@alexcrichton
Copy link
Member

Thanks for the report! Do you have any paths overrides in play that you know of? Also, what version of Cargo are you using?

@gavinb
Copy link
Author

gavinb commented Oct 28, 2016

No path overrides are in effect. Sorry, should have included versions! Running:

cargo 0.13.0-nightly (02fed69 2016-10-18)
rustc 1.14.0-nightly (16eeeac78 2016-10-18)

@alexcrichton
Copy link
Member

Intersting! Could you also gist the build of RUST_LOG=cargo=trace when it erroneously updates?

@gavinb
Copy link
Author

gavinb commented Oct 31, 2016

@alexcrichton
Copy link
Member

Ah so before I dig in too much this may actually be #3220

@gavinb
Copy link
Author

gavinb commented Oct 31, 2016

I just tried building cargo from your alexcrichton/bad branch which includes the patch for #3220. It didn't seem to make a difference. I've saved the trace into another gist: https://gist.github.com/gavinb/8afca1d2335f3c1939cb23c475fe5429

I noticed the following around the place where it says it's updating:

DEBUG:cargo::core::resolver: found an override for openssl-sys = 0.7.17
DEBUG:cargo::core::registry: load/mismatch https://github.com/sfackler/rust-openssl
DEBUG:cargo::sources::config: loading: https://github.com/sfackler/rust-openssl
TRACE:cargo::core::source: loading SourceId; https://github.com/sfackler/rust-openssl
    Updating git repository `https://github.com/sfackler/rust-openssl`
TRACE:cargo::sources::git::source: updating git source `GitRemote { url: "https://github.com/sfackler/rust-openssl" }`

Let me know if there's anything else I can try.

@alexcrichton
Copy link
Member

Hm ok so the problem seems to be related to this line in the [replace] section:

"openssl-sys:0.7.17" = { git = "https://github.com/sfackler/rust-openssl" }

If that's removed then the spurious update doesn't happen. Definitely not related to #3220, still investigating.

@alexcrichton
Copy link
Member

Ok, found the problem! -- #3248

@gavinb
Copy link
Author

gavinb commented Nov 3, 2016

Verified your bad2 branch fixes the problem. Thanks!

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Nov 3, 2016
The intention was to do this, and it mistakenly didn't happen!

Closes rust-lang#3235
bors added a commit that referenced this issue Nov 3, 2016
Default urls in [replace] to crates.io

The intention was to do this, and it mistakenly didn't happen!

Closes #3235
@bors bors closed this as completed in #3248 Nov 3, 2016
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 a pull request may close this issue.

2 participants