cool-easter-32542
06/21/2024, 5:28 PM[docker]
tools = ["docker-credential-ecr-login"]
However, docker-credential-ecr-login shells out to additional operating system dependent binaries:
• MacOS `sw_vers`
• Linux `getent`
We currently handle this with instruction to setup a short ~/.pants.rc file like:
$ cat ~/.pants.rc
[docker]
tools.add = ["sw_vers"]
But this this manual out-of-repo step is a source of papercuts. docker.tools requires the binaries to exist to we can't list the super set of all needed ones:
13:22:52.49 [ERROR] 1 Exception encountered:
Engine traceback:
in `publish` goal
BinaryNotFoundError: Cannot find `sw_vers` on `['/bin', '/home/ecsb/.cargo/bin', '/home/ecsb/.local/bin', '/home/ecsb/bin/', '/opt/bin', '/sbin', '/usr/bin', '/usr/lib/llvm/14/bin', '/usr/lib/llvm/15/bin', '/usr/lib/llvm/16/bin', '/usr/lib64/julia-1.9.4/bin', '/usr/local/bin', '/usr/local/sbin', '/usr/sbin']`. Please ensure that it is installed so that Pants can use docker.
Describe the solution you'd like
docker.optional_tools or another way of listing tools that should be used if present, but do not throw an error when absent.
Describe alternatives you've considered
Some sort of way to specify per OS docker.tools I think this would eventually turn into a mini-langauge for (OS,arch,libc) and be quite complex.
Additional context
I thought this had been discussed in a prior issue, but I have failed to find it.
pantsbuild/pants