Skip to content

.cargo/config equivalent for --frozen #6769

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
jrvanwhy opened this issue Mar 20, 2019 · 5 comments
Closed

.cargo/config equivalent for --frozen #6769

jrvanwhy opened this issue Mar 20, 2019 · 5 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@jrvanwhy
Copy link

Describe the problem you are trying to solve
We would like to vendor all of our dependencies and transitive dependencies, such that cargo does not make network requests when running in our project.

We can currently do this by issuing the --frozen argument to cargo, but that is a manual process. It would be better if we could make this the default in our repository-wide .cargo/config file.

Describe the solution you'd like
We'd like an option added to .cargo/config to make --frozen the default cargo behavior. The new option may belong under [net].

Notes
We are currently using the following workaround:

[http]
proxy = "socks://proxy.invalid/"

This produces less-than-ideal error messages, and is of course not a very clean solution.

@jrvanwhy jrvanwhy added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Mar 20, 2019
@jrvanwhy
Copy link
Author

Actually, it turns out --frozen isn't quite what I needed: I needed a way to prevent network requests. --frozen additionally requires Cargo.lock to be up to date.

This feature request is for a way to prevent network requests (as the proxy hack does), not a .cargo/config clone of --frozen.

@ehuss
Copy link
Contributor

ehuss commented Mar 21, 2019

There is an unstable flag to force offline behavior (https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#offline-mode). Its status is tracked at #5655. It would be good to know if that can cover your use case.

@jrvanwhy
Copy link
Author

I believe that's exactly the functionality I'm looking for! I'm requesting that it be added as an option in .cargo/config, so that we can confirm that cargo runs without network requests.

If you think this request belongs in #5655 instead, let me know and I'll comment there and mark this as a duplicate.

@ehuss
Copy link
Contributor

ehuss commented Mar 22, 2019

Yea, just add a comment over there. It sounds like a reasonable request to me.

@jrvanwhy
Copy link
Author

I added a comment on #5655, closing this as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants