Giter VIP home page Giter VIP logo

Comments (10)

peti avatar peti commented on June 16, 2024

Could you please be more specific? Under which circumstances would nix-build assume git to be installed and ready to use? Could you please provide a command that you'd expect to succeed but that fails?

from docker.

thufschmitt avatar thufschmitt commented on June 16, 2024

Under which circumstances would nix-build assume git to be installed and ready to use?

builtins.fetchGit (as well as git flake inputs) calls the “ambiant” git binary

$ 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)

from docker.

Jackbennett avatar Jackbennett commented on June 16, 2024
{ stdenv, cmake, gcc, gcc-arm-embedded-8, which, git }:

stdenv.mkDerivation rec 
{
 
  src = ./.;

  cmakefiles = builtins.fetchGit {
    url = "http://.../libs/cmakefiles";
    ref = "master";

  };

We have pkg.nix like this and they need git around to work.

from docker.

Fuuzetsu avatar Fuuzetsu commented on June 16, 2024

I made #37 that adds git. I think it's reasonable. A work-around is to use apk to install git manually.

I was also surprised by lack of bash which is kind of inconvenient but if we have git and sh, we can at least use nix to get bash.

from docker.

peti avatar peti commented on June 16, 2024

I am not particularly fond of catering to undeclared, implicit dependencies. Also, adding git increases the size of the image for everyone, and I'm not sure whether many people need it in the boot image. I reckon that those who need it will simply install it via nix inside of the image. I dunno, I think it would be better to use fetchgit from Nixpkgs instead of the impure builtin.

from docker.

Fuuzetsu avatar Fuuzetsu commented on June 16, 2024

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 apk myself at start but it's going to waste more time (machine and human) to keep updated than it will probably ever save...

from docker.

thufschmitt avatar thufschmitt commented on June 16, 2024

adding git increases the size of the image for everyone, and I'm not sure whether many people need it in the boot image. I reckon that those who need it will simply install it via nix inside of the image

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)

from docker.

peti avatar peti commented on June 16, 2024

You can't use fetchgit from nixpkgs if you don't have nixpkgs.

You have nixpkgs, though. It's in the docker image.

from docker.

Fuuzetsu avatar Fuuzetsu commented on June 16, 2024

You have nixpkgs, though. It's in the docker image.

I already mentioned this:

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".

62a906fe6539:/# time nix-env -iA nixpkgs.gitMinimal
installing 'git-minimal-2.30.1'
these paths will be fetched (37.36 MiB download, 199.74 MiB unpacked):
  <snip>
created 51 symlinks in user environment
real	0m 27.06s
user	0m 5.68s
sys	0m 1.02s

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.

from docker.

ocharles avatar ocharles commented on June 16, 2024

I am not particularly fond of catering to undeclared, implicit dependencies.

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.

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.