NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.48k stars 12.97k forks source link

Nix git subcommands reach out to $PATH with great impurity! #28986

Open copumpkin opened 6 years ago

copumpkin commented 6 years ago

On Darwin, if I run nix-env -iA nixpkgs.gitFull, then git is the Nix version, but due to how Git farms out its work to git-* subcommands, it actually uses my host git for most of the work it does.

I noticed this on a brand new Darwin VM, which visually prompts to install the command-line tools if you try to use any of them (like git). To avoid installing the CLT, I installed gitFull and which git shows the one in my Nix profile, but git X still prompts to launch the CLT.

edolstra commented 6 years ago

I can't reproduce this on Linux (with git 2.14.1). It tries to execute subcommands in $out/libexec/git-core first, and only tries $PATH if that fails.

copumpkin commented 6 years ago

Interesting, let me see if I can poke at it a bit more on my macOS VM and get more specific.

peterhoeg commented 6 years ago

@copumpkin - on a very off-topic note, do you have details on getting a darwin VM up and running? I have broken things for Mac a few times to due an unavailability of hardware on which to test things out.

copumpkin commented 6 years ago

@peterhoeg are you on a Mac host or something else? The former is explicitly allowed in the EULA and you should just be able to fire up VMWare Fusion, Parallels, or VirtualBox and install macOS inside it using the normal procedure (pointed at the OS installer app; the process will vary a little depending on the hypervisor). I do it with VMWare Fusion. If instead you're on a different host machine, people have it working under qemu with e.g., https://github.com/kholia/OSX-KVM or https://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/

peterhoeg commented 6 years ago

I'm on NixOS on various hardware - thanks for the pointers.

domenkozar commented 6 years ago

This might be the cause for what I'm seeing on https://travis-ci.org/domenkozar/test-nix-1-11-7/jobs/275799787#L919

copumpkin commented 6 years ago

I think that's actually another issue that I've been noticing recently from Nix git. It might have been a recent update that caused it?

stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.
peterhoeg commented 4 years ago

@copumpkin - is this still an issue?

stale[bot] commented 3 years ago

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