https://pantsbuild.org/ logo
e

eager-lamp-68986

01/31/2022, 2:24 PM
Hi, I'm trying to run pants on NixOS. It seems to have problems locating docker. When I try to package a docker image I get:
BinaryNotFoundError
. Is there any way to tell pants explicitly where to find my docker executable?
c

curved-television-6568

01/31/2022, 2:30 PM
Hi Tzanko! The search path used is
Copy code
DEFAULT_SEARCH_PATH = SearchPath(("/usr/bin", "/bin", "/usr/local/bin"))
Where is it located on your system? (as a possible workaround, symlinking it to one of those paths should work)
h

hundreds-father-404

01/31/2022, 2:40 PM
Oh hm thoughts on adding
search_path
to https://www.pantsbuild.org/docs/reference-docker?
c

curved-television-6568

01/31/2022, 2:57 PM
Could be a good idea, yes.
e

eager-lamp-68986

01/31/2022, 4:12 PM
I think it will be nice to be able to configure search_path using an environment variable. This way configurations which are needed locally by only one developer don't have to be committed to the repository. As for my case, NixOS puts all packages in a content-addressable store and creates the user environment using the $PATH variable. My docker is located at
/nix/store/krhks5l8pdi8zj20f6gbchk2f63ghihg-system-path/bin/docker
c

curved-television-6568

01/31/2022, 4:13 PM
Oh, wow. Yeah making that configurable is clearly needed 🙂
e

eager-lamp-68986

01/31/2022, 4:15 PM
I made a symlink to
/usr/local/bin
but I still get the same error. This is strange, since when I extract and run the script https://github.com/pantsbuild/pants/blob/706e3844ac22b32fbb506c4c2f4a8121c04dd5dd/src/python/pants/engine/process.py#L599 and I set PATH=/usr/local/bin, the binary is discovered correctly. I'll continue to investigate
It was a caching issue, now docker works. Thanks for the help
👍 1
h

hundreds-father-404

01/31/2022, 4:24 PM
Ah yeah, so for discovering binaries on the machine we memoize it with Pantsd, but don't cache it on-disk. That's so that we don't waste performance continually refinding things like
bash
every time you run Pants, as it's infrequent those change Glad it's working. Sounds good on adding a new option
1
c

curved-television-6568

02/04/2022, 1:33 PM
5 Views