lorri icon indicating copy to clipboard operation
lorri copied to clipboard

Equivalent of --max-jobs 0?

Open nomeata opened this issue 5 years ago • 1 comments

I noticed that with lorri I am always a bit worried that I do something wrong, or my network goes down, and suddenly lorri will heat my my laptop to build rustc or something like that, instead of fetching it from a cache.

So I am wondering: Is there a supported and reliable way to get lorri into a state where it will never let nix build stuff locally: Either fetch everything needed for the shell from a cache, or fail the build.

Is this somehting that crossed your mind? How would I do that?

nomeata avatar Aug 06 '20 14:08 nomeata

So I am wondering: Is there a supported and reliable way to get lorri into a state where it will never let nix build stuff locally: Either fetch everything needed for the shell from a cache, or fail the build.

This sounds like a good candidate for a specific feature-flag in lorri.

It would pass --builders '' and --max-jobs 0 to the nix build, but we should kind of make sure the error messages that lorri gives are nice.

As far as implementation goes, I’d translate the flag to

https://github.com/target/lorri/blob/0b3d330e423cb376a3b7c2256165bca1cdf0f9f1/src/nix/options.rs#L1-L19

(needs a new struct field for max-jobs).

Maybe even add a provenance thingy to the nix options merge, so that if user sets conflicting flags there is a way to error out (or if there’s redundant flags there is a way to notify). Though I would say that is optional/orthogonal.

Profpatsch avatar Sep 08 '20 13:09 Profpatsch