nox icon indicating copy to clipboard operation
nox copied to clipboard

Add option to abort if installation requires compilation.

Open vandenoever opened this issue 11 years ago • 8 comments

Nix-env has the option -b which stops an install at the point where code would need to be compiled. This helps to prevent the machine going into a long compile process that is hard to interrupt.

vandenoever avatar Sep 09 '14 08:09 vandenoever

I didn't know about "-b". It seems to be a great way to update the packages that doesn't fail when some can't be build.

Its behavior seems to just ignore what cannot be built, so I'll have to couple it with a call to "nix-env -qsa" (before or after") to know whether the package was actually installed or not.

Anyway, it is indeed something that we want.

madjar avatar Sep 10 '14 08:09 madjar

@vandenoever Correct me if I'm wrong, but "nix-env -b" not only does not compile, but also does not download, meaning it will only install if the derivations already are in the nix store. That's not exactly what we want, is it?

madjar avatar Oct 16 '14 11:10 madjar

@madjar, -b does imply downloading. man nix-env says:

   --prebuild-only / -b
       Use only derivations for which a substitute is registered, i.e.,
       there is a pre-built binary available that can be downloaded in
       lieu of building the derivation. Thus, no packages will be built
       from source.

vandenoever avatar Oct 16 '14 12:10 vandenoever

@vandenoever That is not the behaviour I observe:

> nix-env -i gdb --dry-run
(dry run; not doing anything)
installing `gdb-7.8'
these paths will be fetched (0.00 MiB download, 58.79 MiB unpacked):
  /nix/store/2rv6ya6sdkbfmpsrclzpknyl7myfpkqy-python-2.7.8
  /nix/store/xxw6x4kspjwc2cbjpsjw4maf063mz2q3-gdb-7.8
> nix-env -i gdb -b --dry-run
(dry run; not doing anything)

So it seems the documentation does not match the implementation. Could you confirm this?

madjar avatar Oct 16 '14 13:10 madjar

With --dry-run it will not download anything, but without --dry-run, it will.

vandenoever avatar Oct 16 '14 16:10 vandenoever

nix-env -i gdb -b does absolutely nothing. Could you try to reproduce those results on your side?

madjar avatar Oct 17 '14 09:10 madjar

If it does not do anything, that means that there is no binary available. If you look at your network traffic, you'll see that nix-env tries to contact hydra to get binaries.

vandenoever avatar Oct 17 '14 10:10 vandenoever

@vandenoever my bad, gdb was a bad example. I still don't understand why nix-env -i gdb --dry-run is only about fetching, not building, and and -b won't work.

Anyway, thanks for the answers.

madjar avatar Oct 17 '14 12:10 madjar