{"thread":{"id":"13551","subject":"[PATCH] perl/Makefile.PL: teach makefiles about possible old Error.pm files","startedAt":"2008-05-17T01:16:14Z","lastAt":"2008-05-23T19:22:31Z","messageCount":11,"participants":["Chris Frey","Junio C Hamano","Johannes Schindelin","Sverre Rabbelier"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"77170","messageId":"20080517011614.GA11029@foursquare.net","threadId":"13551","inReplyTo":null,"subject":"[PATCH] perl/Makefile.PL: teach makefiles about possible old Error.pm files","fromName":"Chris Frey","fromEmail":"cdfrey@foursquare.net","sentAt":"2008-05-17T01:16:14Z","receivedAt":"2008-05-17T01:16:14Z","isPatch":true,"sender":{"key":"cdfrey@foursquare.net","avatar":null},"body":"If a previous version of git was installed on a system without a\nproper Error.pm, git will install its own.  But the next time\ngit is compiled on that system, that Error.pm will prevent git from\ninstalling its own copy the second time.  This causes a broken\ngit install on such systems.\n\nThis patch fixes this bug by tagging git's Error.pm with an\nINSTALLED_BY flag, and checking for it during the compile.\n\nSigned-off-by: Chris Frey <cdfrey@foursquare.net>\n---\n\n\tI use 'stow' to handle multiple versions of git installations.\n\tSo when I uninstall a version of git, all those files are\n\ttruly gone.  Including Error.pm.\n\n\tI think it is wise to mark our own copy of Error.pm in some way\n\tanyhow, just so people can tell the difference between\n\tversions on their systems.\n\n\tThe drawback to this patch is that once git installs its own\n\tcopy, it will always install its own copy, unless the user\n\tuninstalls the old git first.  Usually this is the desired\n\tbehaviour, but my perl-fu isn't strong enough to make this\n\tcheck even smarter.  Ideally, if a newer version is on the\n\tsystem already, git shouldn't have to install its own.\n\n\tAnd on the last hand, this whole automated, secondary Error.pm\n\tinstallation method is rather suspect when it comes to creating\n\tbinary packages.  Hopefully distro maintainers never build git\n\tpackages on systems with a git-Error.pm, while also blindly trusting\n\tgit's make install.\n\n\tI'd love to see this in the official git tree soon, so I don't\n\trun into these issues myself. :-)  Tips on how to make this\n\tsmarter are welcome.\n\n\t- Chris\n\n\n perl/Makefile.PL      |   14 ++++++++++++--\n perl/private-Error.pm |    1 +\n 2 files changed, 13 insertions(+), 2 deletions(-)\n\ndiff --git a/perl/Makefile.PL b/perl/Makefile.PL\nindex 320253e..26f7a8c 100644\n--- a/perl/Makefile.PL\n+++ b/perl/Makefile.PL\n@@ -11,9 +11,19 @@ MAKE_FRAG\n my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');\n \n # We come with our own bundled Error.pm. It's not in the set of default\n-# Perl modules so install it if it's not available on the system yet.\n+# Perl modules.  So, unless it was a copy we installed, install it\n+# if it's not available on the system yet.\n eval { require Error };\n-if ($@ || $Error::VERSION < 0.15009) {\n+if ($@ || $Error::VERSION < 0.15009 || $Error::INSTALLED_BY eq 'git') {\n+\tif ($Error::INSTALLED_BY eq 'git') {\n+\t\tprint \"**************************************************\\n\";\n+\t\tprint \"WARNING: detected an Error.pm from a previous git\\n\";\n+\t\tprint \"         install, so assuming that you wish to\\n\";\n+\t\tprint \"         continue using git's version.  If this is\\n\";\n+\t\tprint \"         not the case, uninstall your old version\\n\";\n+\t\tprint \"         of git before compiling the new.\\n\";\n+\t\tprint \"**************************************************\\n\";\n+\t}\n \t$pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';\n }\n \ndiff --git a/perl/private-Error.pm b/perl/private-Error.pm\nindex 11e9cd9..a399983 100644\n--- a/perl/private-Error.pm\n+++ b/perl/private-Error.pm\n@@ -16,6 +16,7 @@ use vars qw($VERSION);\n use 5.004;\n \n $VERSION = \"0.15009\";\n+$Error::INSTALLED_BY = \"git\";\n \n use overload (\n \t'\"\"'\t   =>\t'stringify',\n-- \n1.5.4.4\n"},{"id":"77171","messageId":"20080517012528.GA15137@foursquare.net","threadId":"13551","inReplyTo":"20080517011614.GA11029@foursquare.net","subject":"Re: [PATCH] perl/Makefile.PL: teach makefiles about possible old Error.pm files","fromName":"Chris Frey","fromEmail":"cdfrey@foursquare.net","sentAt":"2008-05-17T01:25:28Z","receivedAt":"2008-05-17T01:25:28Z","isPatch":true,"sender":{"key":"cdfrey@foursquare.net","avatar":null},"body":"On Fri, May 16, 2008 at 09:16:14PM -0400, Chris Frey wrote:\n> \tThe drawback to this patch is that once git installs its own\n> \tcopy, it will always install its own copy, unless the user\n> \tuninstalls the old git first.  Usually this is the desired\n> \tbehaviour, but my perl-fu isn't strong enough to make this\n> \tcheck even smarter.  Ideally, if a newer version is on the\n> \tsystem already, git shouldn't have to install its own.\n\nThe other way to deal with this is to put the check in ./configure,\nand don't let the user build unless the dependencies are solved.\n\nHow important is that private-Error.pm?\n\n- Chris\n"},{"id":"77426","messageId":"20080521222150.GA29696@foursquare.net","threadId":"13551","inReplyTo":"20080517011614.GA11029@foursquare.net","subject":"[PATCH resend] perl/Makefile.PL: teach makefiles about possible old Error.pm files","fromName":"Chris Frey","fromEmail":"cdfrey@foursquare.net","sentAt":"2008-05-21T22:21:50Z","receivedAt":"2008-05-21T22:21:50Z","isPatch":true,"sender":{"key":"cdfrey@foursquare.net","avatar":null},"body":"If a previous version of git was installed on a system without a\nproper Error.pm, git will install its own.  But the next time\ngit is compiled on that system, that Error.pm will prevent git from\ninstalling its own copy the second time.  This causes a broken\ngit install on such systems.\n\nThis patch fixes this bug by tagging git's Error.pm with an\nINSTALLED_BY flag, and checking for it during the compile.\n\nSigned-off-by: Chris Frey <cdfrey@foursquare.net>\n---\n\n\tResending patch from last week, as I saw no comments.\n\tPlease apply.  Thanks!\n\n\n\tThoughts on the patch:\n\n\tI use 'stow' to handle multiple versions of git installations.\n\tSo when I uninstall a version of git, all those files are\n\ttruly gone.  Including Error.pm.  But if a new version was\n\tcompiled while the old was still there, the new stow\n\tinstall will be missing Error.pm.\n\n\tThis bug was hit in April by \"carbonated beverage\":\n\t\thttp://marc.info/?l=git&m=120805594920430&w=2\n\n\tI think it is wise to mark our own copy of Error.pm in some way,\n\tjust so people can tell the difference between versions on\n\ttheir systems.\n\n\tThe drawback to this patch is that once git installs its own\n\tcopy, it will always install its own copy, unless the user\n\tuninstalls the old git first.  Usually this is the desired\n\tbehaviour, but my perl-fu isn't strong enough to make this\n\tcheck even smarter.  Ideally, if a newer version is on the\n\tsystem already, git shouldn't have to install its own.\n\n\t- Chris\n\n perl/Makefile.PL      |   14 ++++++++++++--\n perl/private-Error.pm |    1 +\n 2 files changed, 13 insertions(+), 2 deletions(-)\n\ndiff --git a/perl/Makefile.PL b/perl/Makefile.PL\nindex 320253e..26f7a8c 100644\n--- a/perl/Makefile.PL\n+++ b/perl/Makefile.PL\n@@ -11,9 +11,19 @@ MAKE_FRAG\n my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');\n \n # We come with our own bundled Error.pm. It's not in the set of default\n-# Perl modules so install it if it's not available on the system yet.\n+# Perl modules.  So, unless it was a copy we installed, install it\n+# if it's not available on the system yet.\n eval { require Error };\n-if ($@ || $Error::VERSION < 0.15009) {\n+if ($@ || $Error::VERSION < 0.15009 || $Error::INSTALLED_BY eq 'git') {\n+\tif ($Error::INSTALLED_BY eq 'git') {\n+\t\tprint \"**************************************************\\n\";\n+\t\tprint \"WARNING: detected an Error.pm from a previous git\\n\";\n+\t\tprint \"         install, so assuming that you wish to\\n\";\n+\t\tprint \"         continue using git's version.  If this is\\n\";\n+\t\tprint \"         not the case, uninstall your old version\\n\";\n+\t\tprint \"         of git before compiling the new.\\n\";\n+\t\tprint \"**************************************************\\n\";\n+\t}\n \t$pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';\n }\n \ndiff --git a/perl/private-Error.pm b/perl/private-Error.pm\nindex 11e9cd9..a399983 100644\n--- a/perl/private-Error.pm\n+++ b/perl/private-Error.pm\n@@ -16,6 +16,7 @@ use vars qw($VERSION);\n use 5.004;\n \n $VERSION = \"0.15009\";\n+$Error::INSTALLED_BY = \"git\";\n \n use overload (\n \t'\"\"'\t   =>\t'stringify',\n-- \n1.5.4.4\n"},{"id":"77427","messageId":"7vzlqjz2wz.fsf@gitster.siamese.dyndns.org","threadId":"13551","inReplyTo":"20080521222150.GA29696@foursquare.net","subject":"Re: [PATCH resend] perl/Makefile.PL: teach makefiles about possible old Error.pm files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-21T22:51:40Z","receivedAt":"2008-05-21T22:51:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Chris Frey <cdfrey@foursquare.net> writes:\n\n> If a previous version of git was installed on a system without a\n> proper Error.pm, git will install its own.  But the next time\n> git is compiled on that system, that Error.pm will prevent git from\n> installing its own copy the second time.  This causes a broken\n> git install on such systems.\n>\n> This patch fixes this bug by tagging git's Error.pm with an\n> INSTALLED_BY flag, and checking for it during the compile.\n\nI think this is a wrong direction to go.\n\nWe do not currently deal with broken installations, and \"stow\" is just one\neasy way to install and keep a stale version.  The right solution would be\nto check if \"Error.pm\" we find on the system (be it installed by previous\nincarnation of git or some other packages) works as expected, and refrain\nfrom using it if it doesn't.\n\nWhen the system has a slightly older version of Error.pm, it does not\nreally matter if that old one case from our own Error.pm (because back\nthen the system did not have Error.pm at all), or the user installed a\nslightly older version of Error.pm from elsewhere.\n\nIOW, I won't be interested in a solution that adds INSTALLED_BY.  Even if\nit is ours, as long as it is fresh enough, there is no reason to replace\nit with a new copy.  Even if it is _not_ ours, if it is stale and does not\nwork as we expect, we might have to install our own on our path.\n"},{"id":"77430","messageId":"20080521235647.GA21340@foursquare.net","threadId":"13551","inReplyTo":"7vzlqjz2wz.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH resend] perl/Makefile.PL: teach makefiles about possible old Error.pm files","fromName":"Chris Frey","fromEmail":"cdfrey@foursquare.net","sentAt":"2008-05-21T23:56:47Z","receivedAt":"2008-05-21T23:56:47Z","isPatch":true,"sender":{"key":"cdfrey@foursquare.net","avatar":null},"body":"On Wed, May 21, 2008 at 03:51:40PM -0700, Junio C Hamano wrote:\n> I think this is a wrong direction to go.\n> \n> We do not currently deal with broken installations, and \"stow\" is just one\n> easy way to install and keep a stale version.  The right solution would be\n> to check if \"Error.pm\" we find on the system (be it installed by previous\n> incarnation of git or some other packages) works as expected, and refrain\n> from using it if it doesn't.\n\nThank you for your response.\n\nThe problem as I see it, is that the decision about whether the existing\nError.pm \"works as expected\" is done at compile time.  And git will break\nitself by repeated installs.\n\nIs it really valid to expect users to uninstall their current version of\ngit before they can compile a new one correctly?  For systems without\na working Error.pm, this is currently how git behaves.\n\n- Chris\n"},{"id":"77457","messageId":"alpine.DEB.1.00.0805221245240.30431@racer","threadId":"13551","inReplyTo":"20080521235647.GA21340@foursquare.net","subject":"Re: [PATCH resend] perl/Makefile.PL: teach makefiles about possible old Error.pm files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-22T11:46:12Z","receivedAt":"2008-05-22T11:46:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 21 May 2008, Chris Frey wrote:\n\n> The problem as I see it, is that the decision about whether the existing \n> Error.pm \"works as expected\" is done at compile time.  And git will \n> break itself by repeated installs.\n\nI do not see how it is _Git_ that breaks itself by repeated installs.  It \ndetects that there is an Error.pm.  Fine.  You _remove_ it while \ninstalling Git.  Not fine.  Not Git's error.\n\nCiao,\nDscho\n"},{"id":"77480","messageId":"20080522164300.GA19765@foursquare.net","threadId":"13551","inReplyTo":"alpine.DEB.1.00.0805221245240.30431@racer","subject":"Re: [PATCH resend] perl/Makefile.PL: teach makefiles about possible old Error.pm files","fromName":"Chris Frey","fromEmail":"cdfrey@foursquare.net","sentAt":"2008-05-22T16:43:00Z","receivedAt":"2008-05-22T16:43:00Z","isPatch":true,"sender":{"key":"cdfrey@foursquare.net","avatar":null},"body":"On Thu, May 22, 2008 at 12:46:12PM +0100, Johannes Schindelin wrote:\n> I do not see how it is _Git_ that breaks itself by repeated installs.  It \n> detects that there is an Error.pm.  Fine.  You _remove_ it while \n> installing Git.  Not fine.  Not Git's error.\n\nI guess I take the view that anything _installed_ by git is a part of git.\nIf git installs Error.pm, it can't expect the user to keep it around\nif he uninstalls that version of git.\n\nThe user can do the following, and not have any warning that he'll be\nbitten, and won't know what he did wrong.  In fact, when I first saw this\nerror, I thought it was a bug that was fixed in a point release.\n\n\t(slightly abbreviated for clarity, version numbers arbitrary)\n\n\ttar xjf git-1.5.4.3.tar.bz2\n\tcd git...  && ./configure --prefix=/usr/local/stow/git-1.5.4.3\n\tmake && make install\n\tstow git-1.5.4.3\n\n\ttar xjf git-1.5.4.4.tar.bz2\n\tcd git... && ./configure --prefix=/usr/local/stow/git-1.5.4.4\n\tmake\t# git is built assuming git-1.5.4.3 will always exist\n\tmake install\n\n\tstow -D git-1.5.4.3\n\tstow git-1.5.4.4\n\nThe user now has a broken git, and has no idea why.  I don't consider the\nabove to be unusual or user error.\n\n- Chris\n"},{"id":"77481","messageId":"7vd4new8qx.fsf@gitster.siamese.dyndns.org","threadId":"13551","inReplyTo":"20080522164300.GA19765@foursquare.net","subject":"Re: [PATCH resend] perl/Makefile.PL: teach makefiles about possible old Error.pm files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-22T17:26:14Z","receivedAt":"2008-05-22T17:26:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Chris Frey <cdfrey@foursquare.net> writes:\n\n> On Thu, May 22, 2008 at 12:46:12PM +0100, Johannes Schindelin wrote:\n>> I do not see how it is _Git_ that breaks itself by repeated installs.  It \n>> detects that there is an Error.pm.  Fine.  You _remove_ it while \n>> installing Git.  Not fine.  Not Git's error.\n>\n> I guess I take the view that anything _installed_ by git is a part of git.\n> If git installs Error.pm, it can't expect the user to keep it around\n> if he uninstalls that version of git.\n\nTrue, as we do not give \"uninstall\" target.  That's what distros are for.\n"},{"id":"77489","messageId":"20080522181240.GA12725@foursquare.net","threadId":"13551","inReplyTo":"7vd4new8qx.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH resend] perl/Makefile.PL: teach makefiles about possible old Error.pm files","fromName":"Chris Frey","fromEmail":"cdfrey@foursquare.net","sentAt":"2008-05-22T18:12:40Z","receivedAt":"2008-05-22T18:12:40Z","isPatch":true,"sender":{"key":"cdfrey@foursquare.net","avatar":null},"body":"On Thu, May 22, 2008 at 10:26:14AM -0700, Junio C Hamano wrote:\n> > I guess I take the view that anything _installed_ by git is a part of git.\n> > If git installs Error.pm, it can't expect the user to keep it around\n> > if he uninstalls that version of git.\n> \n> True, as we do not give \"uninstall\" target.  That's what distros are for.\n\nI don't see how you can say \"true\" to what I said and keep git doing the\nexact opposite. :-)\n\nAnyway, there are other ways to fix this than INSTALLED_BY and I'm not\nmarried to that idea, but if this isn't seen as a problem in the first\nplace, there's little use.\n\nWould you accept a patch to the INSTALL file explaining this dependency?\n\nThanks,\n- Chris\n"},{"id":"77498","messageId":"bd6139dc0805221456u5fc6d9ar5e69f8318b92924@mail.gmail.com","threadId":"13551","inReplyTo":"7vd4new8qx.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH resend] perl/Makefile.PL: teach makefiles about possible old Error.pm files","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2008-05-22T21:56:00Z","receivedAt":"2008-05-22T21:56:00Z","isPatch":true,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"On Thu, May 22, 2008 at 7:26 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> True, as we do not give \"uninstall\" target.  That's what distros are for.\n\nWhy is this though? I think there are a few distro's out there (call\nthem the hardcore/diehard ones) that don't use packages, instead they\nrely on keeping the install dir around so that you can 'make\nuninstall' later.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"77570","messageId":"20080523192231.GA31416@foursquare.net","threadId":"13551","inReplyTo":"20080522181240.GA12725@foursquare.net","subject":"[PATCH] INSTALL: explain Error.pm dependency","fromName":"Chris Frey","fromEmail":"cdfrey@foursquare.net","sentAt":"2008-05-23T19:22:31Z","receivedAt":"2008-05-23T19:22:31Z","isPatch":true,"sender":{"key":"cdfrey@foursquare.net","avatar":null},"body":"Signed-off-by: Chris Frey <cdfrey@foursquare.net>\n---\n INSTALL |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/INSTALL b/INSTALL\nindex d9b425f..c5cafc4 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -86,6 +86,13 @@ Issues of note:\n \t- \"cpio\" is used by git-clone when doing a local (possibly\n \t  hardlinked) clone.\n \n+\t- \"Error.pm\" version >= 0.15009 is required by perl scripts.\n+\n+\t  If you don't have a fresh enough Error.pm, git will install its\n+\t  own.  If you already have git installed, it will not install\n+\t  another Error.pm.  If this causes problems for you, uninstall\n+\t  git before compiling, or just install your distro's Error.pm.\n+\n  - Some platform specific issues are dealt with Makefile rules,\n    but depending on your specific installation, you may not\n    have all the libraries/tools needed, or you may have\n-- \n1.5.4.4\n"}]}