Hi, I'm trying to run pants on NixOS. It seems to ...
# general
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:
. Is there any way to tell pants explicitly where to find my docker executable?
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)
Oh hm thoughts on adding
to https://www.pantsbuild.org/docs/reference-docker?
Could be a good idea, yes.
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
Oh, wow. Yeah making that configurable is clearly needed 🙂
I made a symlink to
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
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
every time you run Pants, as it's infrequent those change Glad it's working. Sounds good on adding a new option