Skip to content
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

builtins.fetchGit requires git #3533

Open
zoranbosnjak opened this issue Apr 24, 2020 · 10 comments
Open

builtins.fetchGit requires git #3533

zoranbosnjak opened this issue Apr 24, 2020 · 10 comments

Comments

@zoranbosnjak
Copy link

When using builtins.fetchGit, the nix-build command won't work if:

  • git program is not installed on the system
  • or is installed but is too old (flag -C <path> is not supported)

I am testing on non-nix linux distributions.

This does not look right. The builtins.fetchGit obviously depends on the correct version of the git program. I would expect that nix would build/download git automatically when required and the correct version is used, even if some other version is installed on the system.

@worldofpeace
Copy link
Contributor

What really should be done, if git isn't found, it should bail out with a helpful error.
Same with fetchTarball.

@LnL7
Copy link
Member

LnL7 commented May 1, 2020

Pretty outdated now, but I tried to improve the errors in #2498

@mkenigs
Copy link
Contributor

mkenigs commented Jun 16, 2020

Fixing could be done with something similar to #3565

@mkenigs
Copy link
Contributor

mkenigs commented Oct 19, 2020

@edolstra was taking a look at this, any suggestion on how to make InstallableFlake accessible in libfetcher like you mentioned in #3565 (comment)?

@stale
Copy link

stale bot commented Jun 3, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Jun 3, 2021
@balsoft
Copy link
Member

balsoft commented Jun 18, 2021

Shouldn't this be fixed by just wrapping Nix itself with git, tar and other tools needed at runtime?

@stale stale bot removed the stale label Jun 18, 2021
@rnhmjoj
Copy link

rnhmjoj commented Jun 18, 2021

I agree. Is Nix a special case? Generally if something needs to call a binary, it should be wrapped or patched to call the binary from a nix store path.

@stale
Copy link

stale bot commented Jan 3, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Jan 3, 2022
@hectorj
Copy link

hectorj commented Jul 24, 2022

Hi!

I have the same problem today: I can't use builtins.fetchGit on my NixOS VM because it does not find git.

My workaround is running nix shell nixpkgs#git -c nixos-rebuild build instead of just nixos-rebuild build.

It works but it is does not seem ideal.

@olivia-fl
Copy link

There's a similar issue when trying to use nix build to build a flake in a git repository. I've been using nix shell to work around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants