{"action":"created","issue":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/2414","labels_url":"https://api.github.com/repos/libgit2/libgit2/issues/2414/labels{/name}","comments_url":"https://api.github.com/repos/libgit2/libgit2/issues/2414/comments","events_url":"https://api.github.com/repos/libgit2/libgit2/issues/2414/events","html_url":"https://github.com/libgit2/libgit2/pull/2414","id":35291526,"number":2414,"title":"Win32: Enable WinHTTP for MinGW","user":{"login":"phkelley","id":1985886,"avatar_url":"https://avatars.githubusercontent.com/u/1985886?v=3","gravatar_id":"","url":"https://api.github.com/users/phkelley","html_url":"https://github.com/phkelley","followers_url":"https://api.github.com/users/phkelley/followers","following_url":"https://api.github.com/users/phkelley/following{/other_user}","gists_url":"https://api.github.com/users/phkelley/gists{/gist_id}","starred_url":"https://api.github.com/users/phkelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phkelley/subscriptions","organizations_url":"https://api.github.com/users/phkelley/orgs","repos_url":"https://api.github.com/users/phkelley/repos","events_url":"https://api.github.com/users/phkelley/events{/privacy}","received_events_url":"https://api.github.com/users/phkelley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2014-06-09T14:58:14Z","updated_at":"2015-03-16T21:15:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/libgit2/libgit2/pulls/2414","html_url":"https://github.com/libgit2/libgit2/pull/2414","diff_url":"https://github.com/libgit2/libgit2/pull/2414.diff","patch_url":"https://github.com/libgit2/libgit2/pull/2414.patch"},"body":"This change enables the use of WinHTTP in the MinGW Win32 build. We were previously not doing this because MinGW does not come with a header file for WinHTTP (`winhttp.h`) or an import library (`libwinhttp.a`).\r\n\r\nTo work around this, I have grabbed the LGPL copy of winhttp.h from the Wine project, and added logic to the build to generate the import library (`libwinhttp.a`) from a hand-made .def file. This import library generation is done using dlltool, which is a standard part of the MinGW distribution. I also created a minimal `urlmon.h`, needed for us to call `MapUrlToZone` and find out whether to use the user's 'default credentials' when authenticating to a Windows-based Git HTTP server.\r\n\r\nThis change creates greater alignment between the MSVC and MinGW builds. They now both are able to pass the \"online\" test suite in their default configuration, without having to set up OpenSSL, etc.\r\n\r\nI also modified how our CI build performs the MinGW build on Linux. We now use a custom toolchain file. This has the following advantages:\r\n* Far fewer warnings emitted by the build. The previous iteration was very noisy.\r\n* The CI build creates actual PE binaries (libgit2.dll and libgit2_clar.exe) instead of ELF.\r\n* The build no longer skips the creation of the test suite binary, so we have expanded compile-time coverage on Win32."},"comment":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/comments/81944894","html_url":"https://github.com/libgit2/libgit2/pull/2414#issuecomment-81944894","issue_url":"https://api.github.com/repos/libgit2/libgit2/issues/2414","id":81944894,"user":{"login":"tkelman","id":5934628,"avatar_url":"https://avatars.githubusercontent.com/u/5934628?v=3","gravatar_id":"","url":"https://api.github.com/users/tkelman","html_url":"https://github.com/tkelman","followers_url":"https://api.github.com/users/tkelman/followers","following_url":"https://api.github.com/users/tkelman/following{/other_user}","gists_url":"https://api.github.com/users/tkelman/gists{/gist_id}","starred_url":"https://api.github.com/users/tkelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkelman/subscriptions","organizations_url":"https://api.github.com/users/tkelman/orgs","repos_url":"https://api.github.com/users/tkelman/repos","events_url":"https://api.github.com/users/tkelman/events{/privacy}","received_events_url":"https://api.github.com/users/tkelman/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T21:15:26Z","updated_at":"2015-03-16T21:15:26Z","body":"> There's a bunch of different patches in the PR so it works across the mingw systems. Could someone who's using this post a patch to apply on top of this PR? Or create their own PR with both sets of changes?\r\n\r\nSee #2986 - everyone here whose patches I've adapted, please check that I didn't mess something up."}}