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

generate-lockfiles without updating registry #3479

Closed
brson opened this issue Dec 30, 2016 · 12 comments
Closed

generate-lockfiles without updating registry #3479

brson opened this issue Dec 30, 2016 · 12 comments
Labels
A-dependency-resolution Area: dependency resolution and the resolver C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@brson
Copy link
Contributor

brson commented Dec 30, 2016

Cargobomb has a step where it calls generate-lockfiles 9000 times. Each one of these hits the network to update the registry, which causes a whole lot of latency. I'd like to be able to tell the generate-lockfiles command not to update the registry. Accordingly, I also would need some way to update the registry immediately before generate-lockfiles.

@alexcrichton
Copy link
Member

This may actually be relatively easy to do with Cargo's API-as-a-crate rather than Cargo itself on the command line. I wonder if that'd suffice here? It'd certainly be even faster than spawning 9000 cargos

@brson
Copy link
Contributor Author

brson commented Jan 3, 2017

Thanks for the advice. I'll look into the api.

@brson
Copy link
Contributor Author

brson commented Jan 20, 2017

Here's another request for the feature https://users.rust-lang.org/t/generating-lockfile-without-network-access/9007

@aidanhs
Copy link
Member

aidanhs commented Mar 9, 2017

Related to #1882 - if you can generate a lockfile offline, that's ~equivalent to ignoring registry lookup failures.

@tomprince
Copy link
Member

Because of #4066 to run this in a subprocess, so we can time things out.

@carols10cents carols10cents added A-dependency-resolution Area: dependency resolution and the resolver C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` labels Sep 10, 2017
@Eh2406
Copy link
Contributor

Eh2406 commented Jan 13, 2018

What would be involved in doing this? With some good guidance I myte eavan give this a try.

@alexcrichton
Copy link
Member

@Eh2406 I think nowadays this may be mostly covered by #4686, but it'd be good to kick the tires on that and make sure it works!

@Eh2406
Copy link
Contributor

Eh2406 commented Jan 15, 2018

I am a little confused, #4686 is open, but #4770 is merged. Trying to kick the tyres.

>cargo -V
cargo 0.25.0-nightly (a88fbace4 2017-12-29)
>cargo generate-lockfile --manifest-path Cargo.toml
    Updating git repository `https://github.com/Eh2406/average`
    Updating registry `https://github.com/rust-lang/crates.io-index`
    Updating git repository `https://github.com/Eh2406/preferences-rs`
>cargo generate-lockfile --manifest-path Cargo.toml -Z offline
error: unknown `-Z` flag specified: offline

How is this supposed to be used?

@alexcrichton
Copy link
Member

Ah that's actually because cargo in rust-lang/rust hasn't been updated yet, although hopefully that should happen soon!

@Eh2406
Copy link
Contributor

Eh2406 commented Jan 20, 2018

Yes that apres to work now! I think this can be closed!

@Eh2406
Copy link
Contributor

Eh2406 commented Jan 22, 2018

Well actually, when I went to use this for crater @aidanhs found a problem.
rust-lang/crater#178 (comment)

So Z offline does not work for this issue. The crater team could use advice on how best to proceed.

bors added a commit that referenced this issue Jan 31, 2018
add a -Z no-index-update for crater and benchmarking

This is a fix for #3479
@Eh2406
Copy link
Contributor

Eh2406 commented Feb 1, 2018

-Z no-index-update is merged. Move to close.

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

Successfully merging a pull request may close this issue.

7 participants