{"thread":{"id":"52644","subject":"[PATCH] msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x","startedAt":"2020-01-15T22:57:39Z","lastAt":"2020-01-16T21:35:29Z","messageCount":5,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"389830","messageId":"pull.527.git.1579129054234.gitgitgadget@gmail.com","threadId":"52644","inReplyTo":null,"subject":"[PATCH] msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-01-15T22:57:34Z","receivedAt":"2020-01-15T22:57:39Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWith the upgrade, the library names changed from libeay32/ssleay32 to\nlibcrypto/libssl.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x\n    \n    It was reported [https://github.com/git-for-windows/git/issues/2474] \n    that the vcpkg project (which we use for MSVC/Visual Studio builds of\n    Git) upgraded [https://github.com/microsoft/vcpkg/pull/8566] OpenSSL\n    from v1.0.x to v1.1.x, including the change of the library names. We\n    need to adjust for that.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-527%2Fdscho%2Fvcpkg-upgraded-to-openssl-v1.1.x-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-527/dscho/vcpkg-upgraded-to-openssl-v1.1.x-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/527\n\n compat/vcbuild/scripts/clink.pl | 4 ++--\n contrib/buildsystems/engine.pl  | 4 ++--\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl\nindex ec95a3b2d0..d9f71b7cbb 100755\n--- a/compat/vcbuild/scripts/clink.pl\n+++ b/compat/vcbuild/scripts/clink.pl\n@@ -45,9 +45,9 @@\n \t} elsif (\"$arg\" eq \"-liconv\") {\n \t\tpush(@args, \"libiconv.lib\");\n \t} elsif (\"$arg\" eq \"-lcrypto\") {\n-\t\tpush(@args, \"libeay32.lib\");\n+\t\tpush(@args, \"libcrypto.lib\");\n \t} elsif (\"$arg\" eq \"-lssl\") {\n-\t\tpush(@args, \"ssleay32.lib\");\n+\t\tpush(@args, \"libssl.lib\");\n \t} elsif (\"$arg\" eq \"-lcurl\") {\n \t\tmy $lib = \"\";\n \t\t# Newer vcpkg definitions call this libcurl_imp.lib; Do we\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex fba8a3f056..070978506a 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -343,9 +343,9 @@ sub handleLinkLine\n         } elsif (\"$part\" eq \"-lz\") {\n             push(@libs, \"zlib.lib\");\n         } elsif (\"$part\" eq \"-lcrypto\") {\n-            push(@libs, \"libeay32.lib\");\n+            push(@libs, \"libcrypto.lib\");\n         } elsif (\"$part\" eq \"-lssl\") {\n-            push(@libs, \"ssleay32.lib\");\n+            push(@libs, \"libssl.lib\");\n         } elsif (\"$part\" eq \"-lcurl\") {\n             push(@libs, \"libcurl.lib\");\n         } elsif (\"$part\" eq \"-lexpat\") {\n\nbase-commit: d0654dc308b0ba76dd8ed7bbb33c8d8f7aacd783\n-- \ngitgitgadget\n"},{"id":"389831","messageId":"xmqqmuaoia15.fsf@gitster-ct.c.googlers.com","threadId":"52644","inReplyTo":"pull.527.git.1579129054234.gitgitgadget@gmail.com","subject":"Re: [PATCH] msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-15T23:18:14Z","receivedAt":"2020-01-15T23:18:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> With the upgrade, the library names changed from libeay32/ssleay32 to\n> libcrypto/libssl.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>     msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x\n>     \n>     It was reported [https://github.com/git-for-windows/git/issues/2474] \n>     that the vcpkg project (which we use for MSVC/Visual Studio builds of\n>     Git) upgraded [https://github.com/microsoft/vcpkg/pull/8566] OpenSSL\n>     from v1.0.x to v1.1.x, including the change of the library names. We\n>     need to adjust for that.\n\nThe patch text makes me wonder if there needs to be a way to use\neither version that happens to be available, so that the version of\nGit with this change can work with older vcpkg and vice versa, but\nwhat would I know ;-)\n\nShould this patch directly go to 'master' (or even 'maint' for v2.25\nmaintenance track)?  I do not see much point in cooking it in 'next'\nfor an extended period of time.\n\nThanks.\n\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-527%2Fdscho%2Fvcpkg-upgraded-to-openssl-v1.1.x-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-527/dscho/vcpkg-upgraded-to-openssl-v1.1.x-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/527\n>\n>  compat/vcbuild/scripts/clink.pl | 4 ++--\n>  contrib/buildsystems/engine.pl  | 4 ++--\n>  2 files changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl\n> index ec95a3b2d0..d9f71b7cbb 100755\n> --- a/compat/vcbuild/scripts/clink.pl\n> +++ b/compat/vcbuild/scripts/clink.pl\n> @@ -45,9 +45,9 @@\n>  \t} elsif (\"$arg\" eq \"-liconv\") {\n>  \t\tpush(@args, \"libiconv.lib\");\n>  \t} elsif (\"$arg\" eq \"-lcrypto\") {\n> -\t\tpush(@args, \"libeay32.lib\");\n> +\t\tpush(@args, \"libcrypto.lib\");\n>  \t} elsif (\"$arg\" eq \"-lssl\") {\n> -\t\tpush(@args, \"ssleay32.lib\");\n> +\t\tpush(@args, \"libssl.lib\");\n>  \t} elsif (\"$arg\" eq \"-lcurl\") {\n>  \t\tmy $lib = \"\";\n>  \t\t# Newer vcpkg definitions call this libcurl_imp.lib; Do we\n> diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\n> index fba8a3f056..070978506a 100755\n> --- a/contrib/buildsystems/engine.pl\n> +++ b/contrib/buildsystems/engine.pl\n> @@ -343,9 +343,9 @@ sub handleLinkLine\n>          } elsif (\"$part\" eq \"-lz\") {\n>              push(@libs, \"zlib.lib\");\n>          } elsif (\"$part\" eq \"-lcrypto\") {\n> -            push(@libs, \"libeay32.lib\");\n> +            push(@libs, \"libcrypto.lib\");\n>          } elsif (\"$part\" eq \"-lssl\") {\n> -            push(@libs, \"ssleay32.lib\");\n> +            push(@libs, \"libssl.lib\");\n>          } elsif (\"$part\" eq \"-lcurl\") {\n>              push(@libs, \"libcurl.lib\");\n>          } elsif (\"$part\" eq \"-lexpat\") {\n>\n> base-commit: d0654dc308b0ba76dd8ed7bbb33c8d8f7aacd783\n"},{"id":"389885","messageId":"nycvar.QRO.7.76.6.2001161107050.46@tvgsbejvaqbjf.bet","threadId":"52644","inReplyTo":"xmqqmuaoia15.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-01-16T10:24:52Z","receivedAt":"2020-01-16T10:25:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 15 Jan 2020, Junio C Hamano wrote:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > With the upgrade, the library names changed from libeay32/ssleay32 to\n> > libcrypto/libssl.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >     msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x\n> >\n> >     It was reported [https://github.com/git-for-windows/git/issues/2474]\n> >     that the vcpkg project (which we use for MSVC/Visual Studio builds of\n> >     Git) upgraded [https://github.com/microsoft/vcpkg/pull/8566] OpenSSL\n> >     from v1.0.x to v1.1.x, including the change of the library names. We\n> >     need to adjust for that.\n>\n> The patch text makes me wonder if there needs to be a way to use\n> either version that happens to be available, so that the version of\n> Git with this change can work with older vcpkg and vice versa, but\n> what would I know ;-)\n\nI considered this. There are actually _two_ places where this would need\nto be implemented: compat/vcbuild/scripts/clink.pl and\ncontrib/buildsystems/engine.pl\n\nThe former is at the wrong layer, though: it is called for every single\nC file that needs to be compiled to an object file. Therefore it would\nneed some major surgery to handle OpenSSL v1.0.x and v1.1.x gracefully.\n\nFor the latter, it is even worse: the code cannot determine whether\nOpenSSL v1.0.x or v1.1.x is present because it is part of the Pipeline\nthat generates the `vs/master` branch that is intended to be checked out\nby Visual Studio users and to work out of the box.\n\nMeaning: to make this work, we would _also_ have to patch\ncontrib/buildsystems/Generators/Vcxproj.pm to add some conditional\nconfiguration depending which OpenSSL `.dll` file is present.\n\nOf course, this is doable, but at what cost, and at what benefit?\n\n> Should this patch directly go to 'master' (or even 'maint' for v2.25\n> maintenance track)?  I do not see much point in cooking it in 'next'\n> for an extended period of time.\n\nThat would be nice. As long as this patch is not merged, we will be stuck\nwith failing Azure Pipelines.\n\nIt is far from ideal a situation, I grant you that: whenever anything\nbreaks in the Azure Pipeline due to changes outside of our control, the\nbuilds fail.\n\nAs far as the Visual Studio build goes, I fear at some stage we will need\nto implement some sort of tighter integration with `vcpkg` so that we can\ninherit the linker settings from _them_. That should make things more\nrobust in the future. But then, I am not aware that anybody plans on\nrepeating the DLL renaming stunt, not after OpenSSL demonstrated so well\nhow that goes. So maybe that effort would be spent in vain, dunno.\n\nCiao,\nDscho\n"},{"id":"389916","messageId":"xmqqo8v3gnpl.fsf@gitster-ct.c.googlers.com","threadId":"52644","inReplyTo":"nycvar.QRO.7.76.6.2001161107050.46@tvgsbejvaqbjf.bet","subject":"Re: [PATCH] msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-16T20:17:58Z","receivedAt":"2020-01-16T20:18:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Should this patch directly go to 'master' (or even 'maint' for v2.25\n>> maintenance track)?  I do not see much point in cooking it in 'next'\n>> for an extended period of time.\n>\n> That would be nice. As long as this patch is not merged, we will be stuck\n> with failing Azure Pipelines.\n\nOK, so let's take it to 'maint' directly and merge it down to\n'master' (and all the \"more recent\" integration branches).\n\nThanks.\n"},{"id":"389937","messageId":"nycvar.QRO.7.76.6.2001162235080.46@tvgsbejvaqbjf.bet","threadId":"52644","inReplyTo":"xmqqo8v3gnpl.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-01-16T21:35:21Z","receivedAt":"2020-01-16T21:35:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Thu, 16 Jan 2020, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> >> Should this patch directly go to 'master' (or even 'maint' for v2.25\n> >> maintenance track)?  I do not see much point in cooking it in 'next'\n> >> for an extended period of time.\n> >\n> > That would be nice. As long as this patch is not merged, we will be stuck\n> > with failing Azure Pipelines.\n>\n> OK, so let's take it to 'maint' directly and merge it down to\n> 'master' (and all the \"more recent\" integration branches).\n\nThank you!\nDscho\n"}]}