echoing-farmer-15630
03/24/2021, 5:14 PMmytarget@ <git+ssh://git>@github.com:/myorg/myrepo.git@myhash
line in a requirements.txt
file, but doing ./pants test ...
results in a
ERROR: Command errored out with exit status 128: git clone -q 'ssh://****@github.com:/myorg/myrepo.git' /tmp/process-executionkhgvsl/.tmp/pip-download-1qlw9fjv/mytarget Check the logs for full command output.
...but copying/pasting the git clone
command works just fine in the same shell (with ssh-agent); it's just not being passed to pants. Indeed the log report is
Complete output (5 lines):
<mailto:git@github.com|git@github.com>: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
----------------------------------------
...so that seems to be the problem, but I'm flummoxed. I apologize if this is an obvious question; I looked under "Installing from version control or local files" to get the basic format, but searching for "private repository", "ssh", "publickey" etc didn't help on the docs site.
What am I missing?hundreds-father-404
03/24/2021, 5:21 PMechoing-farmer-15630
03/24/2021, 5:25 PMhundreds-father-404
03/24/2021, 5:44 PMpip install mytarget@ <git+ssh://git>@github.com:/myorg/myrepo.git@myhash
without Pants? It can be helpful to remove the variable of Pants, e.g. so that we see if it's because, for example, Pants strips most env varsechoing-farmer-15630
03/24/2021, 5:51 PM****
it prints in place of the username) and it works fine in my current shell, which has ssh-agent running and populated with my keys. If I understand it right, pants runs in a sort of chroot so it's clean and reproducible (as you say, stripping environment vars and everything), which it should do. One way I've had to deal with this in docker containers is by either passing the agent through (not sure if pants has such a capability) or by executing a script which rewrites ~/.ssh/config
, but that can go a little awry with github (and probably wouldn't work if pants is isolating itself correctly).hundreds-father-404
03/24/2021, 5:53 PM__run.sh
script? In particular, you may need to tweak the env vars. Don't worry about breaking that bash script, it's safe to mess around withechoing-farmer-15630
03/24/2021, 5:57 PMechoing-farmer-15630
03/24/2021, 6:24 PM./__run.sh
from a new user shell... works fine, with one warning from the install about compatible distributions (but not including the ssh authentications problem).
How is the __run.sh
executed to isolate itself?echoing-farmer-15630
03/24/2021, 6:25 PMkeychain
running in the background which generally passes authentication requests just fine; I'm not entirely sure how to get a perfectly clean user shell yet but I'll poke about)happy-kitchen-89482
03/24/2021, 6:36 PMhappy-kitchen-89482
03/24/2021, 6:36 PMwitty-crayon-22786
03/24/2021, 6:36 PM__run.sh
sets only relevant the environment variables for the process, so it should be fairly isolated.happy-kitchen-89482
03/24/2021, 6:36 PMwitty-crayon-22786
03/24/2021, 6:36 PMssh-agent
requires a terminal to do its work?echoing-farmer-15630
03/24/2021, 6:37 PMwitty-crayon-22786
03/24/2021, 6:38 PMSSH_AUTH_SOCK
?echoing-farmer-15630
03/24/2021, 6:39 PMSSH_AUTH_SOCK
for the agent.echoing-farmer-15630
03/24/2021, 6:39 PMSSH_AGENT_PID
although I'm not sure if that's as relevant.witty-crayon-22786
03/24/2021, 6:40 PMwitty-crayon-22786
03/24/2021, 6:41 PMechoing-farmer-15630
03/24/2021, 6:41 PMwitty-crayon-22786
03/24/2021, 6:42 PMechoing-farmer-15630
03/24/2021, 6:42 PMmain
branch easily?witty-crayon-22786
03/24/2021, 6:44 PMwitty-crayon-22786
03/24/2021, 6:44 PMwitty-crayon-22786
03/24/2021, 6:45 PMwitty-crayon-22786
03/24/2021, 6:45 PMwitty-crayon-22786
03/24/2021, 6:46 PMPANTS_SHA=${sha}
to run with any recent main build using prebuilt wheelswitty-crayon-22786
03/24/2021, 6:46 PMechoing-farmer-15630
03/24/2021, 6:48 PMechoing-farmer-15630
03/24/2021, 6:48 PM⯠./pants --version
/home/vputz/.cache/pants/setup/bootstrap-Linux-x86_64/2.3.0_py38
2.3.0
witty-crayon-22786
03/24/2021, 6:50 PMwitty-crayon-22786
03/24/2021, 6:53 PMwitty-crayon-22786
03/24/2021, 6:54 PMPANTS_SHA=d46197d033958ffda7d434aaf9b95148c96138d7 ./pants ...
echoing-farmer-15630
03/24/2021, 6:54 PMechoing-farmer-15630
03/24/2021, 6:56 PMechoing-farmer-15630
03/24/2021, 6:58 PMpants.toml
for example)?witty-crayon-22786
03/24/2021, 7:05 PMwitty-crayon-22786
03/24/2021, 7:05 PMand is there a way to do it without passing the flag on every call, withinĀyes, all pants options can be set in all three locations: see https://www.pantsbuild.org/docs/options#setting-optionsĀ for examplepants.toml
witty-crayon-22786
03/24/2021, 7:06 PMechoing-farmer-15630
03/24/2021, 7:07 PMechoing-farmer-15630
03/24/2021, 7:08 PMechoing-farmer-15630
03/24/2021, 7:08 PMwitty-crayon-22786
03/24/2021, 7:08 PMechoing-farmer-15630
03/24/2021, 7:09 PMwitty-crayon-22786
03/24/2021, 7:15 PMand maybe documentation update for the custom repositories section to note that forwarding that variable may work?once we get this all resolved, if you have time to make the doc edit it would be super appreciated!
echoing-farmer-15630
03/24/2021, 7:15 PMwitty-crayon-22786
03/24/2021, 7:16 PM