Skip to content

Provide option to embed libssh2 - #2428

Closed
carlosmn wants to merge 1 commit into
developmentfrom
cmn/embed-libssh2
Closed

carlosmn wants to merge 1 commit into
developmentfrom
cmn/embed-libssh2

Conversation

@carlosmn

Copy link
Copy Markdown
Member

For those who need to build on Windows, provide a way to embed the libssh2 code into our own so we can have it without worrying about calling convention or building the external library with a name that doesn't conflict with some random dll someone built with a different convention.

This gives us a ton of warnings, but we should be able to add a bunch of #pragmas. I haven't tested it that much, but it does successfully fail to log into GitHub with a nonsensical auth combination.

This needs libssh2 from its master branch.

@carlosmn

Copy link
Copy Markdown
Member Author

/cc @nulltoken @Therzok

@carlosmn

Copy link
Copy Markdown
Member Author

BTW, what you do in its current state is clone libssh2 and put it somewhere, and call CMake with -DEMBED_SSH_PATH=<that path>.

@Therzok

Therzok commented Jun 17, 2014

Copy link
Copy Markdown
Member

That means we could submodule libssh2 in libgit2sharp. That's a win-win.

@carlosmn

Copy link
Copy Markdown
Member Author

Yeah, I wouldn't like to submodule it in libgit2 directly, as it's not integral to libgit2 working and it's only needed on this one OS. Putting it into libgit2sharp would probably cover 80% of the uses.

@nulltoken

Copy link
Copy Markdown
Member

I ❤️ this! How about you @ethomson @martinwoodward?

@carlosmn

Copy link
Copy Markdown
Member Author

Since you mention Martin (sorry Martin, I associate you with lawyers), we (libgit2) don't really need to do anything, but if you redistribute the compiled version (which libgit2sharp would), you need to include a bit of text with the license and copyright statement.

@Therzok

Therzok commented Oct 5, 2014

Copy link
Copy Markdown
Member

Any movement on this?

@carlosmn

carlosmn commented Oct 5, 2014

Copy link
Copy Markdown
Member Author

This was partly a PoC, since I don't use Windows and MS are going to take a long time to review this, so I need feedback from someone actually using it and finding it useful.

@Therzok

Therzok commented Oct 5, 2014

Copy link
Copy Markdown
Member

@carlosmn The binaries at [1] use this option, and I have mild support for SSH written in libgit2sharp which proves it just works™. One way to test this actually works is checkout this branch, build libgit2sharp and modify it to work with this change make the Unit Tests check if SSH is enabled.

[1] - https://github.com/mono/libgit-binary/tree/master/windows

@carlosmn

carlosmn commented Oct 5, 2014

Copy link
Copy Markdown
Member Author

Checking for enabled alone isn't necessarily enough; we'd have to test that fetching and pushing works, but if you've managed to get it to work, then I don't see any reason to delay merging this.

@jacquesg

jacquesg commented Oct 5, 2014

Copy link
Copy Markdown
Contributor

I can also vouch that libssh2 works as expected on Windows (together with OpenSSL, haven't tested it against Microsoft's Crypto API).

@carlosmn

carlosmn commented Oct 5, 2014

Copy link
Copy Markdown
Member Author

If you build everything with cdecl or under one of the fake unix runtimes on Windows, it should probably work, but it won't work when trying to use it against the CLR, and it requires shipping external crypto.

@Therzok

Therzok commented Oct 5, 2014

Copy link
Copy Markdown
Member

this one uses crypto API. I used libssh2 master at the time.

@carlosmn

carlosmn commented Oct 7, 2014

Copy link
Copy Markdown
Member Author

Closing in favour of #2600

@carlosmn carlosmn closed this Oct 7, 2014
@carlosmn
carlosmn deleted the cmn/embed-libssh2 branch October 10, 2014 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants