I tried installing libssh2 automatically
<https://github.com/eschnett/julia/tree/eschnett/libssh2>, but failed
due to "use of undeclared identifier 'LIBSSH2_KNOWNHOST_KEY_UNKNOWN'".
Apparently, the build process picks up a system include directory that
has another, older libssh2 installed, while detecting where my OpenSSL
library is installed. This looks messy, so I gave up for the time
being. Maybe the solution is to distribute OpenSSL as well. Or to
disable OpenSSL, and use MbedTLS instead (that we also distribute).

If you are using a key chain, then the ssh agent should start
automatically when you log in. This works out of the box for me on OS
X, presumably using the OS X keychain.

Thanks for the pointers.

-erik


On Wed, Mar 30, 2016 at 9:54 AM, Isaiah Norton <isaiah.nor...@gmail.com> wrote:
> I'm not sure if this is supposed to be officially supported yet, but I was
> able to get ssh:// to work on OS X:
>
> 1. `brew install libssh2`
> 2. from julia root dir: `cd deps && make configure-libgit2 VERBOSE=1`
> 3. copy the cmake command printed by above, and re-run it manually. For some
> reason PKG_CONFIG_MODULE didn't detect libgit2 the first time (discovered by
> trial-and-error, verified by `make distclean-libgit2` and doing the process
> again).
>
>   it should look something like:
>
>      `cmake {HOME}/git/jl71/deps/srccache/libgit2/
> -DCMAKE_INSTALL_PREFIX:PATH={HOME}/git/jl71/usr -DCMAKE_VERBOSE_MAKEFILE=ON
> -DCMAKE_C_COMPILER="clang" -DCMAKE_C_COMPILER_ARG1="-m64 "
> -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_CXX_COMPILER_ARG1="-m64 "
> -DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release`
>
>
> 4. in julia root directory: `make clean && make`
> 5. start ssh-agent. in bash: "$ eval `ssh-agent`"
> 6. run something that causes ssh-agent to unlock the key, for example
> regular command line git clone'ing a repository via ssh.
>
> After those steps, the following works:
>
> julia> Pkg.clone("ssh://g...@github.com/johnmyleswhite/ASCIIPlots.jl.git")
>
> If I neglect step 6, then the callback ("credentials_cb") gets called
> indefinitely (noted via print debugging), so it seems that we are missing
> some step to make ssh-agent unlock the key pair (which happens via system
> prompt on OS X).
>
> So: it looks like this is almost-supported, but we need to fix build issues
> and teach the libgit2 wrapper to set up ssh-agent credentials correctly on
> its own (at least on OS X). Presumably the situation is the same or better
> on Linux. On Windows, building against libssh2 is explicitly disabled by our
> Makefile.
>
>
> On Mon, Mar 28, 2016 at 4:01 PM, Blake Johnson <blakejohnso...@gmail.com>
> wrote:
>>
>> Is there a way to still support git protocol (as opposed to https)
>> packages with the new libgit2 based package system? I have a fair number of
>> private packages on a local server, and it sure would be nice to be able to
>> fetch those with SSH key authentication.
>
>



-- 
Erik Schnetter <schnet...@gmail.com>
http://www.perimeterinstitute.ca/personal/eschnetter/

Reply via email to