-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support .ssh/config for specifying keys if ssh-agent fails #2078
Comments
Is there a workaround for this for CircleCI? Running into this:
|
@travisofthenorth that specific bug should be fixed on nightly I believe, although it may still not work on nightly when all put together |
Thanks @alexcrichton. The nightly build does fix that issue. |
Hm, that's odd that it hangs! It should either always make progress in one way or another or give an error message. Maybe there's just a slow download or slow network performance? |
Network performance seems average on CircleCI. Downloading and installing rust takes ~15s. How long would you expect a build to take, and what output? This is all I saw after a few minutes:
|
Weird, is it possible to get a stack trace of what Cargo is doing at that time? |
Hmmm, am I doing something wrong here? I'm so puzzled, I'm getting no additional output:
|
Oh I meant moreso attaching a debugger while it's running ( Another option may be to use |
Are there docs on doing this? I'm pretty new to Rust (I'm actually working in a Ruby app and a Rust lib is getting compiled in a gem). FWIW:
|
Probably not, but that looks like it's just a slow clone. So far it doesn't look like it's necessarily a Cargo problem so much as ensuring that a filesystem/network connection is looking good. If you can ssh into the builder (I think circleci allows that?) and attach a debugger to the Cargo process you can find out for sure, but it looks like libgit2's just chugging along cloning the index. |
^ that's what I meant when I was asking "are there docs on doing this". These snippets are actually from my ssh session on a Circle box trying to install manually. I let it sit for 30m-1hr and it never finished, so I'm skeptical that it's just git. |
Ah yeah, to do that you should just need |
@alexcrichton I just ran Edit: I don't know if this is at all helpful, but here's the backtrace before removing the
|
Oh this may be libssh2 going into the weeds which is being redirected via |
It seems like |
Seems like this is actually an issue with Circle. I worked around it with the following:
But the configuration is actually broken. The value assigned to this variable isn't correct which makes anything that gets transformed by it into a broken url, eg. |
Is there a reason this is stalled? The current behaviour ( |
@Diggsey Are you on Windows and using the built in OpenSSH |
@yodaldevoid yes |
I am experiencing this just trying to go through the getting started guide and run Why does it even need an SSH key at all to download this? |
This should only be an issue if specifying dependencies via git with an ssh URL so something seems wrong in your case anyway. |
first, this is very helpful, thank you!
here's what i find working today:
|
We already test the build implicitly when running the test, no need for a separate build that takes 6 minutes. We already run clippy in the Linux environment. It's not worth another 6 minutes on each build to run it again in Windows. There was a hack in the Clippy installer to get cargo git checkouts working in CircleCI. Since that's removed, we revisited the hack, and the cleaner workaround of using .cargo/config was put in place. For more, see: rust-lang/cargo#2078
We already test the build implicitly when running the test, no need for a separate build that takes 6 minutes. We already run clippy in the Linux environment. It's not worth another 6 minutes on each build to run it again in Windows. There was a hack in the Clippy installer to get cargo git checkouts working in CircleCI. Since that's removed, we revisited the hack, and the cleaner workaround of using .cargo/config was put in place. For more, see: rust-lang/cargo#2078
We already test the build implicitly when running the test, no need for a separate build that takes 6 minutes. We already run clippy in the Linux environment. It's not worth another 6 minutes on each build to run it again in Windows. There was a hack in the Clippy installer to get cargo git checkouts working in CircleCI. Since that's removed, we revisited the hack, and the cleaner workaround of using .cargo/config was put in place. For more, see: rust-lang/cargo#2078
We already test the build implicitly when running the test, no need for a separate build that takes 6 minutes. We already run clippy in the Linux environment. It's not worth another 6 minutes on each build to run it again in Windows. There was a hack in the Clippy installer to get cargo git checkouts working in CircleCI. Since that's removed, we revisited the hack, and the cleaner workaround of using .cargo/config was put in place. For more, see: rust-lang/cargo#2078
Please also support custom SSH agents. I use my password manager to handle my SSH keys and as such my SSH config looks like this:
What's more, I use https to ssh rewriting to support private repos in go projects, and my global git config is:
This setup absolutely doesn't work with cargo. |
export CARGO_NET_GIT_FETCH_WITH_CLI=true |
Using |
Update (2018-10-30)
There's a workaround below for those interested:
Original description
When cloning an SSH repository the only currently supported method of authenticating is picking up a key through ssh-agent. This can fail, however, for example if it's just not running! Cargo should support parsing
.ssh/config
and/or otherwise having a reasonable fallback in trying to find public/private keys on the filesystem. Currently libssh2 does not support this, so an external library will be required.As to the rationale for this issue, apparently when using CircleCI with a deploy key it will add this to
~/.gitconfig
:Which means that clones of the index will be rewritten to
[email protected]
(SSH) instead of HTTPS. The ssh-agent apparently also isn't running, so it relies on~/.ssh/config
to point SSH at the right keys, which Cargo isn't itself looking at.The text was updated successfully, but these errors were encountered: