Skip to content

Provide option to embed libssh2 #2428

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

Closed
wants to merge 1 commit into from
Closed

Conversation

carlosmn
Copy link
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
Member Author

/cc @nulltoken @Therzok

@carlosmn
Copy link
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
Copy link
Member

Therzok commented Jun 17, 2014

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

@carlosmn
Copy link
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
Member

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

@carlosmn
Copy link
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
Copy link
Member

Therzok commented Oct 5, 2014

Any movement on this?

@carlosmn
Copy link
Member Author

carlosmn commented Oct 5, 2014

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
Copy link
Member

Therzok commented Oct 5, 2014

@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
Copy link
Member Author

carlosmn commented Oct 5, 2014

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
Copy link
Contributor

jacquesg commented Oct 5, 2014

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

@carlosmn
Copy link
Member Author

carlosmn commented Oct 5, 2014

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
Copy link
Member

Therzok commented Oct 5, 2014

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

@carlosmn
Copy link
Member Author

carlosmn commented Oct 7, 2014

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