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 --frozen tries to access the internet despite vendoring #7584

Closed
stevenroose opened this issue Nov 12, 2019 · 1 comment · Fixed by #7654
Closed

cargo install --frozen tries to access the internet despite vendoring #7584

stevenroose opened this issue Nov 12, 2019 · 1 comment · Fixed by #7654
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. C-bug Category: bug

Comments

@stevenroose
Copy link

cargo install --frozen with a vendor directory set in .cargo/config is updating the crates-io index while it shouldn't do that.

This can currently be solved with --offline, but it should not attempt reach out to the internet with --frozen.

Also, --offline doesn't exist before v1.36.0.


Reproducing this:

  • Cargo.toml
[package]
name = "cargo-install-vendor"
version = "0.1.0"

[build-dependencies]
cbindgen = "0.9.1"
  • .cargo/config
[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "[redacted pwd]/vendor"
$ cargo vendor
[...]
$ cargo install --frozen cbindgen
error: attempting to make an HTTP request, but --frozen was specified
@ehuss
Copy link
Contributor

ehuss commented Nov 12, 2019

cargo install --frozen cbindgen

This command is asking Cargo to install cbindgen from crates.io, so it inherently needs to be online.

If you want to install something that is downloaded locally, the --path option can be used. In this example, perhaps something like cargo install --path vendor/cbindgen --offline. The choice of --locked vs --frozen vs --offline is maybe a little subtle, and in this case no flag is also an option if you already have vendoring configured, as it doesn't need the network in that case.

@ehuss ehuss added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Dec 3, 2019
@bors bors closed this as completed in 0bf7aaf Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants