-
-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
relevant ssh-agent variables not passable to _run.sh, causing difficulty with private repository authentication #11790
Comments
The cherrypick has landed in the
@vputz : If you have time to submit an edit to the 2.4 version of the site here: https://www.pantsbuild.org/v2.4/docs/python-third-party-dependencies#using-custom-repositories (click "Suggest Edits" at the top right), that would be really awesome.
All pants options can be specified in three different places: see Setting options. In this case you'd put it in [subprocess-environment]
env_vars = [
"SSH_AUTH_SOCK",
] |
@vputz : The fix to enable passing these environment variables is now in |
@vputz : I've updated the v2.4 docs to make the version controlled section more prominent, and include a tip for SSH: https://www.pantsbuild.org/v2.4/docs/python-third-party-dependencies#version-control-or-local-requirements Thanks again! |
Using a private repository in a
requirements.txt
file of the form documented in the pants documentation, iethe
.pants
commands fail to build requirements, because the SSH authentication is not being passed to the shell. This results in an inability to proceed; running the command with-ldebug
gives the log messagesRunning the generated
_run.sh
script within an existing user shell worked correctly.Via conversations on slack, the problem could be due to the
SSH_AUTH_SOCK
environment variable (or possibly theSSH_AGENT_PID
variable) not being passed to the chrooted_run.sh
script. @stuhood noted that the--subprocess-environment-env-vars
flag should pass the variable, but that this flag had hard-coded limits which were recently removed. Indeed, running the command asresulted in the exception
This particular issue has been fixed, and the command can be run with
The command then completes.
So the process of accessing private repos can work by managing the SSH_AUTH_SOCK environment variable on future releases; this should perhaps be noted in the documentation on third-party requirements from source (https://www.pantsbuild.org/docs/python-third-party-dependencies#using-custom-repositories, under "Installing from Version Control and Local Files"), and it would be nice if there was a way to set this permanently in
pants.toml
so that the flag did not need to be passed every time.The text was updated successfully, but these errors were encountered: