{"thread":{"id":"50697","subject":"[PATCH 0/1] mingw: fix uname -r test","startedAt":"2019-03-08T15:51:22Z","lastAt":"2019-03-11T16:32:59Z","messageCount":4,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"370994","messageId":"pull.160.git.gitgitgadget@gmail.com","threadId":"50697","inReplyTo":null,"subject":"[PATCH 0/1] mingw: fix uname -r test","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-03-08T15:51:18Z","receivedAt":"2019-03-08T15:51:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"In df5218b4c30b (config.mak.uname: support MSys2, 2016-01-13), I obviously\nmade the assumption that calling uname -r in MSYS2 would always yield a\nversion number starting with \"2\".\n\nThat is incorrect, though, as uname -r reports the version of the Cygwin\nruntime on which the current MSYS2 runtime is based.\n\nThis sadly breaks our build as soon as we upgrade to an MSYS2 runtime that\nis based on Cygwin v3.0.2.\n\nHappily, this patch fixes that.\n\nJohannes Schindelin (1):\n  mingw: allow building with an MSYS2 runtime v3.x\n\n config.mak.uname | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\n\nbase-commit: 6e0cc6776106079ed4efa0cc9abace4107657abf\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-160%2Fdscho%2Fmsys2-3.x-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-160/dscho/msys2-3.x-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/160\n-- \ngitgitgadget\n"},{"id":"370995","messageId":"ba1a87e845919804c86a7859abb85ec50125628f.1552060278.git.gitgitgadget@gmail.com","threadId":"50697","inReplyTo":"pull.160.git.gitgitgadget@gmail.com","subject":"[PATCH 1/1] mingw: allow building with an MSYS2 runtime v3.x","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-03-08T15:51:19Z","receivedAt":"2019-03-08T15:51:22Z","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\nRecently the Git for Windows project started the upgrade process to\na MSYS2 runtime version based on Cygwin v3.x.\n\nThis has the very notable consequence that `$(uname -r)` no longer\nreports a version starting with \"2\", but a version with \"3\".\n\nThat breaks our build, as df5218b4c30b (config.mak.uname: support MSys2,\n2016-01-13) simply did not expect the version reported by `uname -r` to\ndepend on the underlying Cygwin version: it expected the reported\nversion to match the \"2\" in \"MSYS2\".\n\nSo let's invert that test case to test for *anything else* than a\nversion starting with \"1\" (for MSys). That should safeguard us for the\nfuture, even if Cygwin ends up releasing versionsl like 314.272.65536.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n config.mak.uname | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex c8b0e34c31..0207e895a4 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -569,7 +569,7 @@ ifneq (,$(wildcard ../THIS_IS_MSYSGIT))\n \tNO_GETTEXT = YesPlease\n \tCOMPAT_CLFAGS += -D__USE_MINGW_ACCESS\n else\n-\tifeq ($(shell expr \"$(uname_R)\" : '2\\.'),2)\n+\tifneq ($(shell expr \"$(uname_R)\" : '1\\.'),2)\n \t\t# MSys2\n \t\tprefix = /usr/\n \t\tifeq (MINGW32,$(MSYSTEM))\n-- \ngitgitgadget\n"},{"id":"371054","messageId":"xmqqr2bfmt5z.fsf@gitster-ct.c.googlers.com","threadId":"50697","inReplyTo":"ba1a87e845919804c86a7859abb85ec50125628f.1552060278.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] mingw: allow building with an MSYS2 runtime v3.x","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-03-10T01:09:44Z","receivedAt":"2019-03-10T01:17:03Z","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> So let's invert that test case to test for *anything else* than a\n> version starting with \"1\" (for MSys). That should safeguard us for the\n> future, even if Cygwin ends up releasing versionsl like 314.272.65536.\n\nAn obvious alternative is to do \"2\" -> \"[23]\" *and* update the else\nto an explicit check for \"1\", *and* add an else that fails the build\nwhen it sees \"4\" and other unknown ones.\n\nI do not know how compatible MSYS2 runtime v4.x will be with the\nsettings the part inside the ifneq() we see here protects, but you\nprobably do, so I think this would be good enough.  The only case\nthat makes any difference is when v4.x _mostly_ satisifies but\nslightly differs, affecting the built binary in a subtle way that is\nnot discovered right away.  But in such a case, the more cautious\n\"fail on '4' that we do not recognize\" will not help much, as the\nfirst reaction after seeing the error would be to copy the settings\nthat used to be OK with v2.x and v3.x anyway (which is what is being\ndone here---we start with the assumption that the support needed for\nv3.x is largely the same as v2.x).\n\nWill queue directly on top of... 'maint'?  'master'?\n\nLet's say 'maint' and merge that up to 'master'.\n\nThanks.\n\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  config.mak.uname | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/config.mak.uname b/config.mak.uname\n> index c8b0e34c31..0207e895a4 100644\n> --- a/config.mak.uname\n> +++ b/config.mak.uname\n> @@ -569,7 +569,7 @@ ifneq (,$(wildcard ../THIS_IS_MSYSGIT))\n>  \tNO_GETTEXT = YesPlease\n>  \tCOMPAT_CLFAGS += -D__USE_MINGW_ACCESS\n>  else\n> -\tifeq ($(shell expr \"$(uname_R)\" : '2\\.'),2)\n> +\tifneq ($(shell expr \"$(uname_R)\" : '1\\.'),2)\n>  \t\t# MSys2\n>  \t\tprefix = /usr/\n>  \t\tifeq (MINGW32,$(MSYSTEM))\n"},{"id":"371162","messageId":"nycvar.QRO.7.76.6.1903111727510.41@tvgsbejvaqbjf.bet","threadId":"50697","inReplyTo":"xmqqr2bfmt5z.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/1] mingw: allow building with an MSYS2 runtime v3.x","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-03-11T16:32:37Z","receivedAt":"2019-03-11T16:32:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Sun, 10 Mar 2019, Junio C Hamano wrote:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n> \n> > So let's invert that test case to test for *anything else* than a\n> > version starting with \"1\" (for MSys). That should safeguard us for the\n> > future, even if Cygwin ends up releasing versionsl like 314.272.65536.\n> \n> An obvious alternative is to do \"2\" -> \"[23]\" *and* update the else to\n> an explicit check for \"1\", *and* add an else that fails the build when\n> it sees \"4\" and other unknown ones.\n\nRight.\n\n> I do not know how compatible MSYS2 runtime v4.x will be with the\n> settings the part inside the ifneq() we see here protects, but you\n> probably do, so I think this would be good enough.\n\nI would expect Cygwin v4.x (which will be the basis for MSYS2 runtime\nv4.x) to be as diligent as Cygwin v3.x in maintaining as much backwards\ncompatibility as possible.\n\nRead: I trust \"2 or higher\" to be the answer.\n\n> The only case that makes any difference is when v4.x _mostly_ satisifies\n> but slightly differs, affecting the built binary in a subtle way that is\n> not discovered right away.  But in such a case, the more cautious \"fail\n> on '4' that we do not recognize\" will not help much, as the first\n> reaction after seeing the error would be to copy the settings that used\n> to be OK with v2.x and v3.x anyway (which is what is being done\n> here---we start with the assumption that the support needed for v3.x is\n> largely the same as v2.x).\n> \n> Will queue directly on top of... 'maint'?  'master'?\n> \n> Let's say 'maint' and merge that up to 'master'.\n\nThank you.\n\nFor the record, the really super ugly hack I plan on implementing to make\nWindows builds pass in our Azure Pipeline is to build the\ngit-sdk-64-minimal artifact (which contains all of the stuff needed to\ncompile Git for Windows, such as `make`, `gcc`, etc) is to \"install\" a\ndifferent `uname`: as the MINGW binaries live in `/mingw64/bin/` (unlike\nthe MSYS binaries, which live in `/usr/bin/`, like `uname.exe`), I can\nwrite the following script into `/mingw64/bin/uname`:\n\n\t#!/bin/sh\n\n\tcase \"$*\" in -r) echo 2.bogus;; *) /usr/bin/uname \"$*\";; esac\n\nThis will be the stop-gap solution for branches that are based on commits\n*without* this here patch.\n\nIt's ugly alright, but the only hack I could think of that actually will\nwork.\n\nCiao,\nDscho\n\n> \n> Thanks.\n> \n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >  config.mak.uname | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/config.mak.uname b/config.mak.uname\n> > index c8b0e34c31..0207e895a4 100644\n> > --- a/config.mak.uname\n> > +++ b/config.mak.uname\n> > @@ -569,7 +569,7 @@ ifneq (,$(wildcard ../THIS_IS_MSYSGIT))\n> >  \tNO_GETTEXT = YesPlease\n> >  \tCOMPAT_CLFAGS += -D__USE_MINGW_ACCESS\n> >  else\n> > -\tifeq ($(shell expr \"$(uname_R)\" : '2\\.'),2)\n> > +\tifneq ($(shell expr \"$(uname_R)\" : '1\\.'),2)\n> >  \t\t# MSys2\n> >  \t\tprefix = /usr/\n> >  \t\tifeq (MINGW32,$(MSYSTEM))\n> \n"}]}