Running intuit/auto on NixOS

Hi all-

I’d like to run Intuit’s auto tool on NixOS. The standard way to run it is to install it as part of a Node project’s dependencies using yarn et al., but their recommended way to run it outside of that context is to download a binary from a GitHub release, make that file executable, and run it (as detailed in the documentation). Needless to say, this does not work out of the box on NixOS–running the executable gives me no such file or directory: ./auto (which I understand to be an error about not being able to find the linker).

Even though it seems to be a missing linker, I still tried a few things. Running ldd on the downloaded auto gives me: (0x00007ffc98a7e000) => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/ (0x00007f3c63856000) => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/ (0x00007f3c6384b000) => not found => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/ (0x00007f3c63708000) => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/ (0x00007f3c636ee000) => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/ (0x00007f3c636cd000) => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/ (0x00007f3c6350a000)
        /lib64/ => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib64/ (0x00007f3c6385d000)

To fill in that not found I thought I’d be sneaky and use LD_LIBRARY_PATH to provide a random to auto, but of course this doesn’t work either. I get the same not found error.

Finally, I used the following shell.nix file to provide libstdc++ the right way:

with import <nixpkgs> {};

stdenv.mkDerivation {
  name = "foobar";
  src = null;

  buildInputs = [

  shellHook = ''
    export LD_LIBRARY_PATH=${lib.makeLibraryPath []}

but this gives me the same not found error.

Can you help me understand how to run this on NixOS properly? Thanks in advance!


if you want to run this on nixos ‘properly’, then it’s always best to make a derivation that builds from source.

Nixos can be made to run bninaries, with patching… is there something stopping you creating a deviation, that builds the software from source, rather than downloading a binary and patching the linker?

If you’re desperate to get the binary working, use the autopatchelf hook: Packaging/Binaries - NixOS Wiki - this will modify the binary, patching it so it links to the correct hard-coded library path.

But otherwise I concur on the front of recommending building from source; you have the source already, why not just build it? :slight_smile:

Thank you both for the suggestions. You are right of course. I had some tunnel vision from the fact that their own documentation says to pull a binary off of GitHub and just run it. If I want to stick to that recommendation, I will use patchelf; otherwise you are right that building from source is the correct thing to do.