-
-
Notifications
You must be signed in to change notification settings - Fork 13k
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
fetchGit
requires git
as runtime dependency
#46603
Comments
This is intentional. |
If we define correctness as "will the program work in more cases", then the existing situation is worse than the new situation w.r.t. correctness. As such, this can be classified as an optimization. Performance optimizations (especially if they do not come with data and are breaking correctness) should be options that organizations can adopt on a case by case basis. |
does it? |
I think we should then at least ship the NixOS installer with git installed. This would hide the impurity. Users shouldn't have failing builds because of missing dependencies. |
We are not using |
Users might use |
This line of argument seems to throw the entire purpose and practicality of nix into question... Personally, I don't buy it, though. In my opinion, if Edit: To be clear, I'm sure you know that. I'm just trying to push back with a bit of idealism because there definitely is a way forward that is not a total compromise, it's "just" more work. |
there seems to be a hidden dependency on `git` in `builtins.fetchGit`: <NixOS/nixpkgs#46603> <NixOS/nixpkgs#46603 (comment)>: > > This is intentional. git is not a hard dependency since it's only needed if you use fetchGit. Since Git is a sizeable dependency, we don't want to pull it in unconditionally. (Likewise for Mercurial). > This line of argument seems to throw the entire purpose and practicality of nix into question... I completely agree.
there seems to be a hidden dependency on `git` in `builtins.fetchGit`: <NixOS/nixpkgs#46603> <NixOS/nixpkgs#46603 (comment)>: > > This is intentional. git is not a hard dependency since it's only needed if you use fetchGit. Since Git is a sizeable dependency, we don't want to pull it in unconditionally. (Likewise for Mercurial). > This line of argument seems to throw the entire purpose and practicality of nix into question... I completely agree.
there seems to be a hidden dependency on `git` in `builtins.fetchGit`: <NixOS/nixpkgs#46603> <NixOS/nixpkgs#46603 (comment)>: > > This is intentional. git is not a hard dependency since it's only needed if you use fetchGit. Since Git is a sizeable dependency, we don't want to pull it in unconditionally. (Likewise for Mercurial). > This line of argument seems to throw the entire purpose and practicality of nix into question... I completely agree.
This wasn intentional so closing. |
I ran into this issue several times when executing my nix expressions in different environments. Strange feeling since the whole purpose of using nix was to get rid of dependency issues. Now nix brings one in by itself. If fetchGit cannot be assumed working, why do the docs recommend it for pinning nixpkgs? Wouldn't it be better to avoid using it as much as possible? |
Sorry for the naive question, but what is the workaround? At the moment I'm installing git first and then I add the package that uses |
Installing git first seems to be the workaround. You could also install it globally on your system, in the nixos config. |
The other alternative would be |
Tanks for the solutions. Unfortunately |
Depending on what you are doing you can run this build inside a nix-shell that makes git available, it doesn't have to be globally installed first. |
I'm building a nodejs server as a systemd service. This is what I import in my
|
@vidyu You could use |
Thank you @Mic92 ! I had some problems finding the right |
Well then... you have a bultins fetchGit that's not work?? great... |
there seems to be a hidden dependency on `git` in `builtins.fetchGit`: <NixOS/nixpkgs#46603> <NixOS/nixpkgs#46603 (comment)>: > > This is intentional. git is not a hard dependency since it's only needed if you use fetchGit. Since Git is a sizeable dependency, we don't want to pull it in unconditionally. (Likewise for Mercurial). > This line of argument seems to throw the entire purpose and practicality of nix into question... I completely agree.
Issue description
NixOS/nix#2419
nix already requires git to build, but it fails to evaluate anything fetchGit without git installed. Maybe git should be a runtime dependency?
Steps to reproduce
Install nix but not git, use
fetchGit
The text was updated successfully, but these errors were encountered: