Commit 0eb5526b authored by edef's avatar edef
Browse files

ollama: don't build llama.cpp twice

buildGoModules runs preBuild hooks in the module download fixed-output
derivation, so llama.cpp got built and immediately discarded, to then
immediately be built again for the actual Go build.
parent 8c116c61
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -181,6 +181,14 @@ goBuild (
      # replace inaccurate version number with actual release version
      substituteInPlace version/version.go --replace-fail 0.0.0 '${version}'
    '';

    overrideModAttrs = (
      finalAttrs: prevAttrs: {
        # don't run llama.cpp build in the module fetch phase
        preBuild = "";
      }
    );

    preBuild = ''
      # disable uses of `git`, since nix removes the git directory
      export OLLAMA_SKIP_PATCHING=true