{"thread":{"id":"51899","subject":"[PATCH 0/1] contrib/buildsystems: fix Visual Studio Debug configuration","startedAt":"2019-09-23T08:28:38Z","lastAt":"2019-12-01T23:41:56Z","messageCount":12,"participants":["Alexandr Miloslavskiy via GitGitGadget","Alexandr Miloslavskiy","Johannes Schindelin","Philip Oakley"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"382748","messageId":"pull.348.git.gitgitgadget@gmail.com","threadId":"51899","inReplyTo":null,"subject":"[PATCH 0/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Alexandr Miloslavskiy via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-09-23T08:28:34Z","receivedAt":"2019-09-23T08:28:38Z","isPatch":true,"sender":{"key":"alexandr.miloslavskiy@syntevo.com","avatar":null},"body":"Even though Debug configuration builds, the resulting build is incorrect in\na subtle way: it mixes up Debug and Release binaries, which in turn causes\nhard-to-predict bugs.\n\nIn my case, when git calls iconv library, iconv sets 'errno' and git then\ntests it, but in Debug and Release CRT those 'errno' are different memory\nlocations.\n\nThis patch addresses 3 connected bugs: 1) Typo in '(Configuration)'. As a\nresult, Debug configuration condition is always false and Release path is\ntaken instead. 2) Regexp that replaced 'zlib.lib' with 'zlibd.lib' was only\naffecting the first occurrence. However, some projects have it listed twice.\nPreviously this bug was hidden, because Debug path was never taken. I\ndecided that avoiding double -lz in makefile is fragile and I'd better\nreplace all occurrences instead. 3) In Debug, 'libcurl-d.lib' should be used\ninstead of 'libcurl.lib'. Previously this bug was hidden, because Debug path\nwas never taken.\n\nSigned-off-by: Alexandr Miloslavskiy alexandr.miloslavskiy@syntevo.com\n[alexandr.miloslavskiy@syntevo.com]\n\nAlexandr Miloslavskiy (1):\n  contrib/buildsystems: fix Visual Studio Debug configuration\n\n contrib/buildsystems/Generators/Vcxproj.pm | 15 ++++++++-------\n 1 file changed, 8 insertions(+), 7 deletions(-)\n\n\nbase-commit: 4c86140027f4a0d2caaa3ab4bd8bfc5ce3c11c8a\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-348%2FSyntevoAlex%2F%230188_VisualStudio_Debug_build_fixes-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-348/SyntevoAlex/#0188_VisualStudio_Debug_build_fixes-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/348\n-- \ngitgitgadget\n"},{"id":"382749","messageId":"525669b3b38ed57d6d4f188dfe0bb8fe10b63749.1569227313.git.gitgitgadget@gmail.com","threadId":"51899","inReplyTo":"pull.348.git.gitgitgadget@gmail.com","subject":"[PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Alexandr Miloslavskiy via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-09-23T08:28:35Z","receivedAt":"2019-09-23T08:28:39Z","isPatch":true,"sender":{"key":"alexandr.miloslavskiy@syntevo.com","avatar":null},"body":"From: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>\n\nEven though Debug configuration builds, the resulting build is incorrect\nin a subtle way: it mixes up Debug and Release binaries, which in turn\ncauses hard-to-predict bugs.\n\nIn my case, when git calls iconv library, iconv sets 'errno' and git\nthen tests it, but in Debug and Release CRT those 'errno' are different\nmemory locations.\n\nThis patch addresses 3 connected bugs:\n1) Typo in '\\(Configuration)'. As a result, Debug configuration\n   condition is always false and Release path is taken instead.\n2) Regexp that replaced 'zlib.lib' with 'zlibd.lib' was only affecting\n   the first occurrence. However, some projects have it listed twice.\n   Previously this bug was hidden, because Debug path was never taken.\n   I decided that avoiding double -lz in makefile is fragile and I'd\n   better replace all occurrences instead.\n3) In Debug, 'libcurl-d.lib' should be used instead of 'libcurl.lib'.\n   Previously this bug was hidden, because Debug path was never taken.\n\nSigned-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>\n---\n contrib/buildsystems/Generators/Vcxproj.pm | 15 ++++++++-------\n 1 file changed, 8 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm\nindex 576ccabe1d..7b1e277eca 100644\n--- a/contrib/buildsystems/Generators/Vcxproj.pm\n+++ b/contrib/buildsystems/Generators/Vcxproj.pm\n@@ -79,7 +79,8 @@ sub createProject {\n     if (!$static_library) {\n       $libs_release = join(\";\", sort(grep /^(?!libgit\\.lib|xdiff\\/lib\\.lib|vcs-svn\\/lib\\.lib)/, @{$$build_structure{\"$prefix${name}_LIBS\"}}));\n       $libs_debug = $libs_release;\n-      $libs_debug =~ s/zlib\\.lib/zlibd\\.lib/;\n+      $libs_debug =~ s/zlib\\.lib/zlibd\\.lib/g;\n+      $libs_debug =~ s/libcurl\\.lib/libcurl-d\\.lib/g;\n     }\n \n     $defines =~ s/-D//g;\n@@ -119,13 +120,13 @@ sub createProject {\n     <VCPKGArch Condition=\"'\\$(Platform)'=='Win32'\">x86-windows</VCPKGArch>\n     <VCPKGArch Condition=\"'\\$(Platform)'!='Win32'\">x64-windows</VCPKGArch>\n     <VCPKGArchDirectory>$cdup\\\\compat\\\\vcbuild\\\\vcpkg\\\\installed\\\\\\$(VCPKGArch)</VCPKGArchDirectory>\n-    <VCPKGBinDirectory Condition=\"'\\(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\bin</VCPKGBinDirectory>\n-    <VCPKGLibDirectory Condition=\"'\\(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\lib</VCPKGLibDirectory>\n-    <VCPKGBinDirectory Condition=\"'\\(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\bin</VCPKGBinDirectory>\n-    <VCPKGLibDirectory Condition=\"'\\(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\lib</VCPKGLibDirectory>\n+    <VCPKGBinDirectory Condition=\"'\\$(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\bin</VCPKGBinDirectory>\n+    <VCPKGLibDirectory Condition=\"'\\$(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\lib</VCPKGLibDirectory>\n+    <VCPKGBinDirectory Condition=\"'\\$(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\bin</VCPKGBinDirectory>\n+    <VCPKGLibDirectory Condition=\"'\\$(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\lib</VCPKGLibDirectory>\n     <VCPKGIncludeDirectory>\\$(VCPKGArchDirectory)\\\\include</VCPKGIncludeDirectory>\n-    <VCPKGLibs Condition=\"'\\(Configuration)'=='Debug'\">$libs_debug</VCPKGLibs>\n-    <VCPKGLibs Condition=\"'\\(Configuration)'!='Debug'\">$libs_release</VCPKGLibs>\n+    <VCPKGLibs Condition=\"'\\$(Configuration)'=='Debug'\">$libs_debug</VCPKGLibs>\n+    <VCPKGLibs Condition=\"'\\$(Configuration)'!='Debug'\">$libs_release</VCPKGLibs>\n   </PropertyGroup>\n   <Import Project=\"\\$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />\n   <PropertyGroup Condition=\"'\\$(Configuration)'=='Debug'\" Label=\"Configuration\">\n-- \ngitgitgadget\n"},{"id":"382852","messageId":"7957548f-1c6f-e038-0e97-8d31773c063d@syntevo.com","threadId":"51899","inReplyTo":"525669b3b38ed57d6d4f188dfe0bb8fe10b63749.1569227313.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Alexandr Miloslavskiy","fromEmail":"alexandr.miloslavskiy@syntevo.com","sentAt":"2019-09-24T14:17:06Z","receivedAt":"2019-09-24T14:17:12Z","isPatch":true,"sender":{"key":"alexandr.miloslavskiy@syntevo.com","avatar":null},"body":"Johannes, would you please review?\n"},{"id":"382931","messageId":"nycvar.QRO.7.76.6.1909251720290.15067@tvgsbejvaqbjf.bet","threadId":"51899","inReplyTo":"525669b3b38ed57d6d4f188dfe0bb8fe10b63749.1569227313.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-09-25T15:20:44Z","receivedAt":"2019-09-25T15:21:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Alexandr,\n\nOn Mon, 23 Sep 2019, Alexandr Miloslavskiy via GitGitGadget wrote:\n\n> From: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>\n>\n> Even though Debug configuration builds, the resulting build is incorrect\n> in a subtle way: it mixes up Debug and Release binaries, which in turn\n> causes hard-to-predict bugs.\n>\n> In my case, when git calls iconv library, iconv sets 'errno' and git\n> then tests it, but in Debug and Release CRT those 'errno' are different\n> memory locations.\n>\n> This patch addresses 3 connected bugs:\n> 1) Typo in '\\(Configuration)'. As a result, Debug configuration\n>    condition is always false and Release path is taken instead.\n> 2) Regexp that replaced 'zlib.lib' with 'zlibd.lib' was only affecting\n>    the first occurrence. However, some projects have it listed twice.\n>    Previously this bug was hidden, because Debug path was never taken.\n>    I decided that avoiding double -lz in makefile is fragile and I'd\n>    better replace all occurrences instead.\n> 3) In Debug, 'libcurl-d.lib' should be used instead of 'libcurl.lib'.\n>    Previously this bug was hidden, because Debug path was never taken.\n>\n> Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>\n\nACK!\nJohannes\n\n> ---\n>  contrib/buildsystems/Generators/Vcxproj.pm | 15 ++++++++-------\n>  1 file changed, 8 insertions(+), 7 deletions(-)\n>\n> diff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm\n> index 576ccabe1d..7b1e277eca 100644\n> --- a/contrib/buildsystems/Generators/Vcxproj.pm\n> +++ b/contrib/buildsystems/Generators/Vcxproj.pm\n> @@ -79,7 +79,8 @@ sub createProject {\n>      if (!$static_library) {\n>        $libs_release = join(\";\", sort(grep /^(?!libgit\\.lib|xdiff\\/lib\\.lib|vcs-svn\\/lib\\.lib)/, @{$$build_structure{\"$prefix${name}_LIBS\"}}));\n>        $libs_debug = $libs_release;\n> -      $libs_debug =~ s/zlib\\.lib/zlibd\\.lib/;\n> +      $libs_debug =~ s/zlib\\.lib/zlibd\\.lib/g;\n> +      $libs_debug =~ s/libcurl\\.lib/libcurl-d\\.lib/g;\n>      }\n>\n>      $defines =~ s/-D//g;\n> @@ -119,13 +120,13 @@ sub createProject {\n>      <VCPKGArch Condition=\"'\\$(Platform)'=='Win32'\">x86-windows</VCPKGArch>\n>      <VCPKGArch Condition=\"'\\$(Platform)'!='Win32'\">x64-windows</VCPKGArch>\n>      <VCPKGArchDirectory>$cdup\\\\compat\\\\vcbuild\\\\vcpkg\\\\installed\\\\\\$(VCPKGArch)</VCPKGArchDirectory>\n> -    <VCPKGBinDirectory Condition=\"'\\(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\bin</VCPKGBinDirectory>\n> -    <VCPKGLibDirectory Condition=\"'\\(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\lib</VCPKGLibDirectory>\n> -    <VCPKGBinDirectory Condition=\"'\\(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\bin</VCPKGBinDirectory>\n> -    <VCPKGLibDirectory Condition=\"'\\(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\lib</VCPKGLibDirectory>\n> +    <VCPKGBinDirectory Condition=\"'\\$(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\bin</VCPKGBinDirectory>\n> +    <VCPKGLibDirectory Condition=\"'\\$(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\lib</VCPKGLibDirectory>\n> +    <VCPKGBinDirectory Condition=\"'\\$(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\bin</VCPKGBinDirectory>\n> +    <VCPKGLibDirectory Condition=\"'\\$(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\lib</VCPKGLibDirectory>\n>      <VCPKGIncludeDirectory>\\$(VCPKGArchDirectory)\\\\include</VCPKGIncludeDirectory>\n> -    <VCPKGLibs Condition=\"'\\(Configuration)'=='Debug'\">$libs_debug</VCPKGLibs>\n> -    <VCPKGLibs Condition=\"'\\(Configuration)'!='Debug'\">$libs_release</VCPKGLibs>\n> +    <VCPKGLibs Condition=\"'\\$(Configuration)'=='Debug'\">$libs_debug</VCPKGLibs>\n> +    <VCPKGLibs Condition=\"'\\$(Configuration)'!='Debug'\">$libs_release</VCPKGLibs>\n>    </PropertyGroup>\n>    <Import Project=\"\\$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />\n>    <PropertyGroup Condition=\"'\\$(Configuration)'=='Debug'\" Label=\"Configuration\">\n> --\n> gitgitgadget\n>\n"},{"id":"387191","messageId":"c89cc506-b515-b913-bb0a-353b04fe4210@iee.email","threadId":"51899","inReplyTo":"525669b3b38ed57d6d4f188dfe0bb8fe10b63749.1569227313.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-11-27T17:56:55Z","receivedAt":"2019-11-27T17:56:59Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 23/09/2019 09:28, Alexandr Miloslavskiy via GitGitGadget wrote:\n> From: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>\n>\n> Even though Debug configuration builds, the resulting build is incorrect\n> in a subtle way: it mixes up Debug and Release binaries, which in turn\n> causes hard-to-predict bugs.\n>\n> In my case, when git calls iconv library, iconv sets 'errno' and git\n> then tests it, but in Debug and Release CRT those 'errno' are different\n> memory locations.\n>\n> This patch addresses 3 connected bugs:\n> 1) Typo in '\\(Configuration)'. As a result, Debug configuration\n>     condition is always false and Release path is taken instead.\n> 2) Regexp that replaced 'zlib.lib' with 'zlibd.lib' was only affecting\n>     the first occurrence. However, some projects have it listed twice.\n>     Previously this bug was hidden, because Debug path was never taken.\n>     I decided that avoiding double -lz in makefile is fragile and I'd\n>     better replace all occurrences instead.\n> 3) In Debug, 'libcurl-d.lib' should be used instead of 'libcurl.lib'.\n>     Previously this bug was hidden, because Debug path was never taken.\nI just bumped against a potential issue like this. I was test compiling \n[1a,b] the `vs/master` branch from Git-For-Windows and got the LINK \nerror that the 'libcurl-d.lib' was not found (4 places).\n\nError    LNK1104    cannot open file 'libcurl-d.lib' git-imap-send    \nC:\\git-sdk-64\\usr\\src\\git\\git-imap-send\\ LINK    1\n\nHaving just located this email, I changed the build type to 'Release' \nand the errors disappeared.\n\nDo we also need to identify where the libcurl-d.lib will be found? i.e. \nis it something that needs including via the sdk pacman list (I think \nI'm up to date but maybe not..)\n\nA quick web search didn't show any hits for `libcurl-d.lib` (with the \ndash `-`), though did find a few for `libcurld.lib`.\n\nPhilip\n\nWhy compiling:\n[1a] https://www.sourcetrail.com is a cross-platform source explorer \nthat helps you get productive on unfamiliar source code.\n[1b] Sourcetrail is now free and open-source \nhttps://www.sourcetrail.com/blog/open_source/\n>\n> Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>\n> ---\n>   contrib/buildsystems/Generators/Vcxproj.pm | 15 ++++++++-------\n>   1 file changed, 8 insertions(+), 7 deletions(-)\n>\n> diff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm\n> index 576ccabe1d..7b1e277eca 100644\n> --- a/contrib/buildsystems/Generators/Vcxproj.pm\n> +++ b/contrib/buildsystems/Generators/Vcxproj.pm\n> @@ -79,7 +79,8 @@ sub createProject {\n>       if (!$static_library) {\n>         $libs_release = join(\";\", sort(grep /^(?!libgit\\.lib|xdiff\\/lib\\.lib|vcs-svn\\/lib\\.lib)/, @{$$build_structure{\"$prefix${name}_LIBS\"}}));\n>         $libs_debug = $libs_release;\n> -      $libs_debug =~ s/zlib\\.lib/zlibd\\.lib/;\n> +      $libs_debug =~ s/zlib\\.lib/zlibd\\.lib/g;\n> +      $libs_debug =~ s/libcurl\\.lib/libcurl-d\\.lib/g;\n>       }\n>   \n>       $defines =~ s/-D//g;\n> @@ -119,13 +120,13 @@ sub createProject {\n>       <VCPKGArch Condition=\"'\\$(Platform)'=='Win32'\">x86-windows</VCPKGArch>\n>       <VCPKGArch Condition=\"'\\$(Platform)'!='Win32'\">x64-windows</VCPKGArch>\n>       <VCPKGArchDirectory>$cdup\\\\compat\\\\vcbuild\\\\vcpkg\\\\installed\\\\\\$(VCPKGArch)</VCPKGArchDirectory>\n> -    <VCPKGBinDirectory Condition=\"'\\(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\bin</VCPKGBinDirectory>\n> -    <VCPKGLibDirectory Condition=\"'\\(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\lib</VCPKGLibDirectory>\n> -    <VCPKGBinDirectory Condition=\"'\\(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\bin</VCPKGBinDirectory>\n> -    <VCPKGLibDirectory Condition=\"'\\(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\lib</VCPKGLibDirectory>\n> +    <VCPKGBinDirectory Condition=\"'\\$(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\bin</VCPKGBinDirectory>\n> +    <VCPKGLibDirectory Condition=\"'\\$(Configuration)'=='Debug'\">\\$(VCPKGArchDirectory)\\\\debug\\\\lib</VCPKGLibDirectory>\n> +    <VCPKGBinDirectory Condition=\"'\\$(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\bin</VCPKGBinDirectory>\n> +    <VCPKGLibDirectory Condition=\"'\\$(Configuration)'!='Debug'\">\\$(VCPKGArchDirectory)\\\\lib</VCPKGLibDirectory>\n>       <VCPKGIncludeDirectory>\\$(VCPKGArchDirectory)\\\\include</VCPKGIncludeDirectory>\n> -    <VCPKGLibs Condition=\"'\\(Configuration)'=='Debug'\">$libs_debug</VCPKGLibs>\n> -    <VCPKGLibs Condition=\"'\\(Configuration)'!='Debug'\">$libs_release</VCPKGLibs>\n> +    <VCPKGLibs Condition=\"'\\$(Configuration)'=='Debug'\">$libs_debug</VCPKGLibs>\n> +    <VCPKGLibs Condition=\"'\\$(Configuration)'!='Debug'\">$libs_release</VCPKGLibs>\n>     </PropertyGroup>\n>     <Import Project=\"\\$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />\n>     <PropertyGroup Condition=\"'\\$(Configuration)'=='Debug'\" Label=\"Configuration\">\n\n"},{"id":"387202","messageId":"8e7ff0b2-9f62-8ec6-5316-eb9cee25024e@syntevo.com","threadId":"51899","inReplyTo":"c89cc506-b515-b913-bb0a-353b04fe4210@iee.email","subject":"Re: [PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Alexandr Miloslavskiy","fromEmail":"alexandr.miloslavskiy@syntevo.com","sentAt":"2019-11-27T18:59:06Z","receivedAt":"2019-11-27T18:59:12Z","isPatch":true,"sender":{"key":"alexandr.miloslavskiy@syntevo.com","avatar":null},"body":"On 27.11.2019 18:56, Philip Oakley wrote:\n> I just bumped against a potential issue like this. I was test compiling \n> [1a,b] the `vs/master` branch from Git-For-Windows and got the LINK \n> error that the 'libcurl-d.lib' was not found (4 places).\n> \n> Error    LNK1104    cannot open file 'libcurl-d.lib' git-imap-send \n> C:\\git-sdk-64\\usr\\src\\git\\git-imap-send\\ LINK    1\n> \n> Having just located this email, I changed the build type to 'Release' \n> and the errors disappeared.\n> \n> Do we also need to identify where the libcurl-d.lib will be found? i.e. \n> is it something that needs including via the sdk pacman list (I think \n> I'm up to date but maybe not..)\n> \n> A quick web search didn't show any hits for `libcurl-d.lib` (with the \n> dash `-`), though did find a few for `libcurld.lib`.\n\nIf you clone `git-for-windows` and build in VS using `git.sln`, it will \nautomatically clone `git-for-windows\\compat\\vcbuild\\vcpkg` and build \nvarious things there, resulting in\n\n`git-for-windows\\compat\\vcbuild\\vcpkg\\buildtrees\\curl\\x64-windows-dbg\\lib\\libcurl-d.dll`\n\n`git-for-windows\\compat\\vcbuild\\vcpkg\\installed\\x64-windows\\debug\\bin\\libcurl-d.dll`\n\n`git-for-windows\\compat\\vcbuild\\vcpkg\\packages\\curl_x64-windows\\debug\\bin\\libcurl-d.dll`\n\nWhich will be picked up by solution to build git.\n\nI have built Debug many times now and didn't have any issues. If you do, \nI would suggest to clone a new copy and build it.\n"},{"id":"387248","messageId":"e011e16d-7832-9f3c-78c2-004d3ffbe64d@iee.email","threadId":"51899","inReplyTo":"8e7ff0b2-9f62-8ec6-5316-eb9cee25024e@syntevo.com","subject":"Re: [PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-11-27T21:42:23Z","receivedAt":"2019-11-27T21:42:28Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Alexandr,\n\nOn 27/11/2019 18:59, Alexandr Miloslavskiy wrote:\n> On 27.11.2019 18:56, Philip Oakley wrote:\n>> I just bumped against a potential issue like this. I was test \n>> compiling [1a,b] the `vs/master` branch from Git-For-Windows and got \n>> the LINK error that the 'libcurl-d.lib' was not found (4 places).\n>>\n>> Error    LNK1104    cannot open file 'libcurl-d.lib' git-imap-send \n>> C:\\git-sdk-64\\usr\\src\\git\\git-imap-send\\ LINK    1\n>>\n>> Having just located this email, I changed the build type to 'Release' \n>> and the errors disappeared.\n>>\n>> Do we also need to identify where the libcurl-d.lib will be found? \n>> i.e. is it something that needs including via the sdk pacman list (I \n>> think I'm up to date but maybe not..)\n>>\n>> A quick web search didn't show any hits for `libcurl-d.lib` (with the \n>> dash `-`), though did find a few for `libcurld.lib`.\n>\n> If you clone `git-for-windows` and build in VS using `git.sln`, it \n> will automatically clone `git-for-windows\\compat\\vcbuild\\vcpkg` and \n> build various things there, resulting in\n>\n> `git-for-windows\\compat\\vcbuild\\vcpkg\\buildtrees\\curl\\x64-windows-dbg\\lib\\libcurl-d.dll` \n>\n>\n> `git-for-windows\\compat\\vcbuild\\vcpkg\\installed\\x64-windows\\debug\\bin\\libcurl-d.dll` \n>\n>\n> `git-for-windows\\compat\\vcbuild\\vcpkg\\packages\\curl_x64-windows\\debug\\bin\\libcurl-d.dll` \n>\n>\n> Which will be picked up by solution to build git.\n>\n> I have built Debug many times now and didn't have any issues. If you \n> do, I would suggest to clone a new copy and build it.\n\nI already have the clone of vcpkg from 30/03/2019 with those three files \nalready present. Have they been updated since then?\n\nThe error report is specifically that the .lib file is missing (which I \ncan't find..)\n\nHowever the plain `libcurl.lib` is present with matching dll's. It just \nfeels a little unusual.\n\nOn a side note there's a few (not many) Stackoverflow questions about \nbuilding libcurl-d.lib, but they feel almost tangential\nhttps://stackoverflow.com/questions/51418238/libcurl-a-debug-lib-libcurl-a-lib-are-generated-instead-of-libcurld-lib-libcur\nhttps://stackoverflow.com/questions/37126943/libcurld-dll-is-missing-from-your-computer-adding-libcurl-to-visual-studio-pr\n\nquick look..\nnot sure if the assertion about choosing \"ONE\" (of debug/release) in \nhttps://github.com/git-for-windows/git/blob/master/compat/vcbuild/README#L26-L30 \nis part of the issue.\nThat README doesn't really cover the update method for the vcpkg \nrepository. It presumes you start from a fresh clone, which can be slow.\nI fetched/pulled the vcpkg repoo but no sign of an update.\n\nPhilip\n\n\n\n"},{"id":"387255","messageId":"70bc64f6-3513-2924-9ba0-0e38e0e9d308@iee.email","threadId":"51899","inReplyTo":"8e7ff0b2-9f62-8ec6-5316-eb9cee25024e@syntevo.com","subject":"Re: [PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-11-28T00:34:00Z","receivedAt":"2019-11-28T00:34:03Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"\n\nOn 27/11/2019 18:59, Alexandr Miloslavskiy wrote:\n> On 27.11.2019 18:56, Philip Oakley wrote:\n>> I just bumped against a potential issue like this. I was test \n>> compiling [1a,b] the `vs/master` branch from Git-For-Windows and got \n>> the LINK error that the 'libcurl-d.lib' was not found (4 places).\n>>\n>> Error    LNK1104    cannot open file 'libcurl-d.lib' git-imap-send \n>> C:\\git-sdk-64\\usr\\src\\git\\git-imap-send\\ LINK    1\n>>\n>> Having just located this email, I changed the build type to 'Release' \n>> and the errors disappeared.\n>>\n>> Do we also need to identify where the libcurl-d.lib will be found? \n>> i.e. is it something that needs including via the sdk pacman list (I \n>> think I'm up to date but maybe not..)\n>>\n>> A quick web search didn't show any hits for `libcurl-d.lib` (with the \n>> dash `-`), though did find a few for `libcurld.lib`.\n>\n> If you clone `git-for-windows` and build in VS using `git.sln`, it \n> will automatically clone `git-for-windows\\compat\\vcbuild\\vcpkg` and \n> build various things there, resulting in\n>\n> `git-for-windows\\compat\\vcbuild\\vcpkg\\buildtrees\\curl\\x64-windows-dbg\\lib\\libcurl-d.dll` \n>\n>\n> `git-for-windows\\compat\\vcbuild\\vcpkg\\installed\\x64-windows\\debug\\bin\\libcurl-d.dll` \n>\n>\n> `git-for-windows\\compat\\vcbuild\\vcpkg\\packages\\curl_x64-windows\\debug\\bin\\libcurl-d.dll` \n>\n>\n> Which will be picked up by solution to build git.\n>\n> I have built Debug many times now and didn't have any issues. If you \n> do, I would suggest to clone a new copy and build it.\n\nHmm, 45 minutes of cloning and rebuild, but finally it compiled clean \n(both Release and Debug)\n"},{"id":"387271","messageId":"0b2124b5-6d40-08bb-6cc5-a8cef2b7a9b1@syntevo.com","threadId":"51899","inReplyTo":"70bc64f6-3513-2924-9ba0-0e38e0e9d308@iee.email","subject":"Re: [PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Alexandr Miloslavskiy","fromEmail":"alexandr.miloslavskiy@syntevo.com","sentAt":"2019-11-28T10:07:49Z","receivedAt":"2019-11-28T10:07:58Z","isPatch":true,"sender":{"key":"alexandr.miloslavskiy@syntevo.com","avatar":null},"body":"On 28.11.2019 1:34, Philip Oakley wrote:\n\n> Hmm, 45 minutes of cloning and rebuild, but finally it compiled clean \n> (both Release and Debug)\n\nI understand that the issue is resolved now.\n\nProbably your old repo was missing the libraries for whatever reason \n(like antivirus deleting them, etc), but build script thought that \ndependencies are properly built, so didn't attempt to rebuild them.\n"},{"id":"387303","messageId":"365668d0-ebb8-6b5c-99bd-29f0c8cec132@iee.email","threadId":"51899","inReplyTo":"0b2124b5-6d40-08bb-6cc5-a8cef2b7a9b1@syntevo.com","subject":"Re: [PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-11-29T11:53:21Z","receivedAt":"2019-11-29T11:53:25Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 28/11/2019 10:07, Alexandr Miloslavskiy wrote:\n> On 28.11.2019 1:34, Philip Oakley wrote:\n>\n>> Hmm, 45 minutes of cloning and rebuild, but finally it compiled clean \n>> (both Release and Debug)\n>\n> I understand that the issue is resolved now.\n>\n> Probably your old repo was missing the libraries for whatever reason \n> (like antivirus deleting them, etc), but build script thought that \n> dependencies are properly built, so didn't attempt to rebuild them.\nI think I'll report that as an issue to the \nhttps://github.com/microsoft/vcpkg folks so that there's better \ndetection for 'out of date' / updated vcpkg issues.\n\nThe vcpkg_install.bat in /compat/vcbuild may need updating to do a \n'pull' if there is an existing directory. At the moment it's a rather \nsimplistic 'all or nothing' for getting all those extra packages.\n\nPhilip\n"},{"id":"387304","messageId":"9c5157df-adb0-0a84-2ff2-852ad7536874@iee.email","threadId":"51899","inReplyTo":"365668d0-ebb8-6b5c-99bd-29f0c8cec132@iee.email","subject":"Re: [PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-11-29T13:19:41Z","receivedAt":"2019-11-29T13:19:46Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 29/11/2019 11:53, Philip Oakley wrote:\n> On 28/11/2019 10:07, Alexandr Miloslavskiy wrote:\n>> On 28.11.2019 1:34, Philip Oakley wrote:\n>>\n>>> Hmm, 45 minutes of cloning and rebuild, but finally it compiled \n>>> clean (both Release and Debug)\n>>\n>> I understand that the issue is resolved now.\n>>\n>> Probably your old repo was missing the libraries for whatever reason \n>> (like antivirus deleting them, etc), but build script thought that \n>> dependencies are properly built, so didn't attempt to rebuild them.\n> I think I'll report that as an issue to the \n> https://github.com/microsoft/vcpkg folks so that there's better \n> detection for 'out of date' / updated vcpkg issues.\n>\n> The vcpkg_install.bat in /compat/vcbuild may need updating to do a \n> 'pull' if there is an existing directory. At the moment it's a rather \n> simplistic 'all or nothing' for getting all those extra packages.\n\nIssue submitted as https://github.com/microsoft/vcpkg/issues/9148\n--\nPhilip\n"},{"id":"387383","messageId":"021de37a-5317-6c96-eae3-d0228a193d8b@iee.email","threadId":"51899","inReplyTo":"0b2124b5-6d40-08bb-6cc5-a8cef2b7a9b1@syntevo.com","subject":"Re: [PATCH 1/1] contrib/buildsystems: fix Visual Studio Debug configuration","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-12-01T23:41:52Z","receivedAt":"2019-12-01T23:41:56Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 28/11/2019 10:07, Alexandr Miloslavskiy wrote:\n> On 28.11.2019 1:34, Philip Oakley wrote:\n>\n>> Hmm, 45 minutes of cloning and rebuild, but finally it compiled clean \n>> (both Release and Debug)\n>\n> I understand that the issue is resolved now.\n>\n> Probably your old repo was missing the libraries for whatever reason \n> (like antivirus deleting them, etc), but build script thought that \n> dependencies are properly built, so didn't attempt to rebuild them.\n\nI was searching for how Visual Studio managed to decide if the vcpkg \nneeded installing. I think I've found it in 384a61bc6a \n(\"contrib/buildsystems: add a backend for modern Visual Studio \nversions\", 2019-07-29) where dscho says:\n\n    we initialize the `vcpkg` conditionally, in the `libgit` project's\n    `PreBuildEvent`. To allow for parallel building of the projects, we\n    therefore put `libgit` at the bottom of the project hierarchy.\n\n\nWhat's not clear is if the conditional pre-build can have an if-else \noption so that we can have an 'update' check if already installed. \nAdding the vcpkg update to the vcpkg_install.bat didn't work :-(\n\nPhilip\n\nPS. the https://github.com/CoatiSoftware/Sourcetrail visualiser is \nlooking nice.\n\n\n"}]}