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

Comments

Projects
None yet
7 participants
@brson
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

This comment has been minimized.

Member

alexcrichton commented Dec 31, 2016

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

This comment has been minimized.

Contributor

brson commented Jan 3, 2017

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

@brson

This comment has been minimized.

Contributor

brson commented Jan 20, 2017

@aidanhs

This comment has been minimized.

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

This comment has been minimized.

Member

tomprince commented Jun 8, 2017

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

@Eh2406

This comment has been minimized.

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

This comment has been minimized.

Member

alexcrichton commented Jan 14, 2018

@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

This comment has been minimized.

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

This comment has been minimized.

Member

alexcrichton commented Jan 15, 2018

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

@Eh2406

This comment has been minimized.

Contributor

Eh2406 commented Jan 20, 2018

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

@Eh2406

This comment has been minimized.

Contributor

Eh2406 commented Jan 22, 2018

Well actually, when I went to use this for crater @aidanhs found a problem.
rust-lang-nursery/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

Auto merge of #4990 - Eh2406:Zno-index-update, r=alexcrichton
add a -Z no-index-update for crater and benchmarking

This is a fix for #3479
@Eh2406

This comment has been minimized.

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