Hi, I'm trying to run pants on NixOS. It seems to ...
# general
e
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
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
Oh hm thoughts on adding
search_path
to https://www.pantsbuild.org/docs/reference-docker?
c
Could be a good idea, yes.
e
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
Oh, wow. Yeah making that configurable is clearly needed 🙂
e
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
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