{"thread":{"id":"38254","subject":"Missing inversion in Makefile (ee9be06)","startedAt":"2014-12-27T17:56:04Z","lastAt":"2015-02-10T22:36:10Z","messageCount":4,"participants":["Philip Oakley","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"254112","messageId":"E3DB9AD2A8914C379FB3371494B0B816@PhilipOakley","threadId":"38254","inReplyTo":null,"subject":"Missing inversion in Makefile (ee9be06)","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2014-12-27T17:56:04Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi,\n\nIn ee9be06 (perl: detect new files in MakeMaker builds, 2012-07-27) \nthere is a step to detect if there has been an update to the PM.* files, \nhowever it appears that the logic is inverted in the comparison.\n\nI need some extra eye's on this to be sure I have it right (I'm trying \nto debug an old Windows breakage...).\n\nThe resultant output of a make dry run included (on my m/c)..:\n\n  find perl -type f -name '*.pm' | sort >perl/PM.stamp+ && \\\n   { cmp perl/PM.stamp+ perl/PM.stamp >/dev/null 2>/dev/null || mv \nperl/PM.stamp+ perl/PM.stamp; } && \\\n   rm -f perl/PM.stamp+\n  make -C perl  PERL_PATH='/usr/bin/perl' prefix='/c/Documents and \nSettings/Philip' perl.mak\n\nShouldn't it be `{ ! cmp ` so that when the files are not identical, the \nmove is performed?\n\nhttps://github.com/git/git/blob/ee9be06770223238c6a22430eb874754dd22dfb0/Makefile#L2097\n\nthe code is now at https://github.com/git/git/blob/master/Makefile#L1697\n\nI'd guess that this was something that was tricky to test as once it \nworks it stays working.\n\nOn a clean Msysgit development install the PM.stamp file does not exist \nand the cmp exits with error code 2, while identical files return 0.\n\nMsysgit list also copied should someone there have seen this before.\n--\nPhilip \n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"254113","messageId":"549F0355.5020805@kdbg.org","threadId":"38254","inReplyTo":"E3DB9AD2A8914C379FB3371494B0B816@PhilipOakley","subject":"Re: Missing inversion in Makefile (ee9be06)","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2014-12-27T19:07:01Z","receivedAt":"2014-12-27T19:07:01Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 27.12.2014 um 19:49 schrieb Philip Oakley:\n> Hi,\n> \n> In ee9be06 (perl: detect new files in MakeMaker builds, 2012-07-27)\n> there is a step to detect if there has been an update to the PM.* files,\n> however it appears that the logic is inverted in the comparison.\n> \n> I need some extra eye's on this to be sure I have it right (I'm trying\n> to debug an old Windows breakage...).\n> \n> The resultant output of a make dry run included (on my m/c)..:\n> \n>  find perl -type f -name '*.pm' | sort >perl/PM.stamp+ && \\\n>   { cmp perl/PM.stamp+ perl/PM.stamp >/dev/null 2>/dev/null || mv\n> perl/PM.stamp+ perl/PM.stamp; } && \\\n>   rm -f perl/PM.stamp+\n>  make -C perl  PERL_PATH='/usr/bin/perl' prefix='/c/Documents and\n> Settings/Philip' perl.mak\n> \n> Shouldn't it be `{ ! cmp ` so that when the files are not identical, the\n> move is performed?\n> \n> https://github.com/git/git/blob/ee9be06770223238c6a22430eb874754dd22dfb0/Makefile#L2097\n\nThe existing code looks correct to me. cmp succeeds when the files are\nidentical and fails when they are different: When it succeeds (files are\nequal), the mv is not executed. When it fails, either because a file\ndoes not exist or they are different, the mv is executed.\n\n-- Hannes\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"254114","messageId":"4C7BB65E9EE445F08645582230EA9782@PhilipOakley","threadId":"38254","inReplyTo":"549F0355.5020805@kdbg.org","subject":"Re: Missing inversion in Makefile (ee9be06)","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2014-12-27T19:07:01Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Johannes Sixt\" <j6t@kdbg.org>\n> Am 27.12.2014 um 19:49 schrieb Philip Oakley:\n>> Hi,\n>>\n>> In ee9be06 (perl: detect new files in MakeMaker builds, 2012-07-27)\n>> there is a step to detect if there has been an update to the PM.* \n>> files,\n>> however it appears that the logic is inverted in the comparison.\n>>\n>> I need some extra eye's on this to be sure I have it right (I'm \n>> trying\n>> to debug an old Windows breakage...).\n>>\n>> The resultant output of a make dry run included (on my m/c)..:\n>>\n>>  find perl -type f -name '*.pm' | sort >perl/PM.stamp+ && \\\n>>   { cmp perl/PM.stamp+ perl/PM.stamp >/dev/null 2>/dev/null || mv\n>> perl/PM.stamp+ perl/PM.stamp; } && \\\n>>   rm -f perl/PM.stamp+\n>>  make -C perl  PERL_PATH='/usr/bin/perl' prefix='/c/Documents and\n>> Settings/Philip' perl.mak\n>>\n>> Shouldn't it be `{ ! cmp ` so that when the files are not identical, \n>> the\n>> move is performed?\n>>\n>> https://github.com/git/git/blob/ee9be06770223238c6a22430eb874754dd22dfb0/Makefile#L2097\n>\n> The existing code looks correct to me. cmp succeeds when the files are\n> identical and fails when they are different: When it succeeds (files \n> are\n> equal), the mv is not executed. When it fails, either because a file\n> does not exist or they are different, the mv is executed.\n>\nThanks. The inverse logic had me confused.\nIt's like 7400's again, for those that remember;-)\n\nI was getting errors from\n`cd $git_dir && make -n MSVC=1 V=1 2>MakeDryErrs.txt 1>MakeDry.txt` \n(borrowed from 'msvc-build') which reported the PM.stamp as a problem, \nwith the quoted code being the last part of the MakeDry.txt (and no \nPM.stamp seen).\n\nNow that I've been poking and investigating the error's stopped! It's \nall getting rather frustrating. Time to go again on a clean and \nrebuild..\n\nPhilip \n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"255908","messageId":"C928DF3E5D7D423588EF2C2BA09D8A73@PhilipOakley","threadId":"38254","inReplyTo":"4C7BB65E9EE445F08645582230EA9782@PhilipOakley","subject":"Re: [msysGit] Missing inversion in Makefile (ee9be06)","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2015-02-10T22:36:10Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Another go at this XY-Problem...\n\n\nFrom: \"Philip Oakley\" <philipoakley@iee.org>\nSent: Saturday, December 27, 2014 8:17 PM\n> From: \"Johannes Sixt\" <j6t@kdbg.org>\n>> Am 27.12.2014 um 19:49 schrieb Philip Oakley:\n>>> Hi,\n>>>\n>>> In ee9be06 (perl: detect new files in MakeMaker builds, 2012-07-27)\n>>> there is a step to detect if there has been an update to the PM.* \n>>> files,\n>>> however it appears that the logic is inverted in the comparison.\n>>>\n>>> I need some extra eye's on this to be sure I have it right (I'm \n>>> trying\n>>> to debug an old Windows breakage...).\n>>>\n>>> The resultant output of a make dry run included (on my m/c)..:\n>>>\n>>>  find perl -type f -name '*.pm' | sort >perl/PM.stamp+ && \\\n>>>   { cmp perl/PM.stamp+ perl/PM.stamp >/dev/null 2>/dev/null || mv\n>>> perl/PM.stamp+ perl/PM.stamp; } && \\\n>>>   rm -f perl/PM.stamp+\n>>>  make -C perl  PERL_PATH='/usr/bin/perl' prefix='/c/Documents and\n>>> Settings/Philip' perl.mak\n>>>\n>>> Shouldn't it be `{ ! cmp ` so that when the files are not identical, \n>>> the\n>>> move is performed?\n>>>\n>>> https://github.com/git/git/blob/ee9be06770223238c6a22430eb874754dd22dfb0/Makefile#L2097\n>>\n>> The existing code looks correct to me. cmp succeeds when the files \n>> are\n>> identical and fails when they are different: When it succeeds (files \n>> are\n>> equal), the mv is not executed. When it fails, either because a file\n>> does not exist or they are different, the mv is executed.\n>>\n> Thanks. The inverse logic had me confused.\n> It's like 7400's again, for those that remember;-)\n>\n\nHere's where the real problem starts...\n\n> I was getting errors from\n> `cd $git_dir && make -n MSVC=1 V=1 2>MakeDryErrs.txt 1>MakeDry.txt` \n> (borrowed from 'msvc-build') which reported the PM.stamp as a problem, \n> with the quoted code being the last part of the MakeDry.txt (and no \n> PM.stamp seen).\n>\n> Now that I've been poking and investigating the error's stopped! It's \n> all getting rather frustrating. Time to go again on a clean and \n> rebuild..\n\nI'm trying to get the msysgit msvc-build script[1], which essentially \nimplements the Git 'compat/vcbuild/README', to work again in terms of \ncreating a Visual Studio [2008] project file (.sln).\n\nIf I run the code (find perl -type f -name '*.pm' ...) manually then the \nPM.stamp file is created allowing future dry-runs to succeed - hence \nsome of my confusion.\n\nThe script uses git's 'contrib/buildsystems/engine.pl' to parse the \noutput of:\n `make -n MSVC=1 V=1 2>\\dev\\null` [2]\n\nThis appears to no longer work because the -n (dry-run) option fails to \nrun the required 'perl/PM.stamp' during the dry-run. At least that's now \nmy understanding.\n\nThe \nhttps://www.gnu.org/software/make/manual/html_node/Instead-of-Execution.html \npage indicates that adding a + to the right rule would be needed to also \nrun the PM.stamp process during dry-run.\n\nAt the moment I'm getting (on my old WinXP machine, using Msysgit 1.9.5 \nas a basis)\n\n$ make -n MSVC=1 V=1 1>makedry.txt\nmake[1]: *** No rule to make target `PM.stamp', needed by `perl.mak'. \nStop.\nmake: *** [perl/perl.mak] Error 2\n\ni.e. PM.stamp was not created so can't be the target of the dry-run make \nrule.\n\nThe makedry.txt file generated ends with the\n\nfind perl -type f -name '*.pm' | sort >perl/PM.stamp+ && \\\n { cmp perl/PM.stamp+ perl/PM.stamp >/dev/null 2>/dev/null || mv \nperl/PM.stamp+ perl/PM.stamp; } && \\\n rm -f perl/PM.stamp+\nmake -C perl  PERL_PATH='/usr/bin/perl' prefix='/c/Documents and \nSettings/Philip' perl.mak\nmake[1]: Entering directory `/c/msysgit195/git/perl'\nmake -C .. GIT-CFLAGS\nmake[2]: Entering directory `/c/msysgit195/git'\nFLAGS='compat/vcbuild/scripts/clink.pl:  -Imsvcgit/32bits/include [...]\n     if test x\"$FLAGS\" != x\"`cat GIT-CFLAGS 2>/dev/null`\" ; then \\\n  echo >&2 \"    * new build flags\"; \\\n  echo \"$FLAGS\" >GIT-CFLAGS; \\\n            fi\nmake[2]: Leaving directory `/c/msysgit195/git'\nmake[1]: Leaving directory `/c/msysgit195/git/perl'\n\ni.e. the commands for the PM.stamp process are listed, rather than \nexecuted as may have been hoped.\n\nI've tried hacking the plus(+) prefix onto the \"perl/PM.stamp: FORCE\" \nrule, but it gave the same error.\n\n\nWhat would be the right way of making a dry-run produce a suitable \ncomplete output? Make files are not something I normally delve into.\n\n--\nPhilip\n\n[1] https://github.com/msysgit/msysgit/blob/master/bin/msvc-build\n[2] \nhttps://github.com/git/git/blob/master/contrib/buildsystems/engine.pl#L75\n"}]}