Skip to content

-Z offline actively breaks building crate offline #6014

@matthiaskrgr

Description

@matthiaskrgr

cargo 1.30.0-nightly (b917e3524 2018-09-09)
I cargo newed a dummy project with cargo as git rependency

[dependencies]
cargo = { git = "https://github.com/rust-lang/cargo", rev = "9311f6d439e09da3ab918397a425be57da13f04a" }

and built it with a cargo cache starting from scratch:

CARGO_HOME=/tmp/cargohome cargo build

and waited for everything to be downloaded.
I can see that the cargo git repo is cloned and the respective git commit checked out:

$ cd /tmp/cargohome/git
$ fd --max-depth 2

checkouts
checkouts/cargo-e7ff1db891893a9e
db
db/cargo-e7ff1db891893a9e

Next I tried to rebuild the dummy package from scratch without net connections.
Surprisingly that worked without -Z offline but with -Z offline made it fail:

error: no matching package named `core-foundation` found
location searched: registry `https://github.com/rust-lang/crates.io-index`
required by package `cargo v0.30.0 (https://github.com/rust-lang/cargo?rev=9311f6d439e09da3ab918397a425be57da13f04a#9311f6d4)`
    ... which is depended on by `a v0.1.0 (file:///tmp/a)`
As a reminder, you're using offline mode (-Z offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may with to retry without the offline flag.

Everything needed was already stored in the cache though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions