-
-
Notifications
You must be signed in to change notification settings - Fork 47
nix-build expects git to be around, it's not in the image #33
Comments
Could you please be more specific? Under which circumstances would |
$ env -u PATH $(which nix-instantiate) --eval -E 'builtins.fetchGit "https://github.com/nixos/nixpkgs"'
error: error: executing 'git': No such file or directory
error: program 'git' failed with exit code 1
(use '--show-trace' to show detailed location information) |
We have |
This is a pre-requisite for builtins.fetchGit to work. This is especially painful to deal with if we're using flakes and flake-compat: we have this nice self-contained set of inputs but to use them in presence of any git dependencies, we have to first install git separately. Fixes NixOS#33
I made #37 that adds git. I think it's reasonable. A work-around is to use I was also surprised by lack of |
I am not particularly fond of catering to undeclared, implicit dependencies. Also, adding |
You can't use fetchgit from nixpkgs if you don't have nixpkgs. If you get your pinned nixpkgs via git such as in a flake, you're stuck in a catch 22. If you tried to install git via nix in the image itself, you'll notice how much time and space it takes to do so. It's also not any better to use "git from whatever version of nixpkgs the container happens to point at" vs "git at whatever version the container has". Making the image a pain to use in name of few compressed MBs just seems anti-user: any start-up time you may save is going to be ruined by having to install git yourself. It's all outweighed by any trivial eval anyway. It's an impure dependency of commonly used built-in function commonly used to bootstrap nixpkgs itself: it doesn't seem that reasonable to include. I'll keep using forked image from #37 or invoke |
I think it would be fair to consider git as a dependency of Nix (as indeed some Nix features rely on it). In which case having it in the image is totally warranted (regardless the ~10MB that it adds) |
You have nixpkgs, though. It's in the docker image. |
I already mentioned this:
30 seconds extra for every run in CI is pretty annoying. If you want to save space, why not delete nixpkgs from the image? nix-unstable images do this. Anyway if we're not going to put git in the image, please close as won't fix along with the MR and I'll just use a fork. |
I'm not sure it is - it's a hard runtime dependency of Nix. Unless you build Nix without Git support (I'm not sure it's possible), this is just an incomplete image imo. |
2.3.10 doesn't include git in the image, seem odd given the nix-build might assume it's ready to use.
The text was updated successfully, but these errors were encountered: