{"thread":{"id":"3087","subject":"git-diff-files and fakeroot","startedAt":"2006-01-17T02:10:57Z","lastAt":"2006-01-17T18:10:12Z","messageCount":7,"participants":["Ryan Anderson","Junio C Hamano","Kyle Moffett","Sam Ravnborg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"14756","messageId":"43CC5231.3090005@michonline.com","threadId":"3087","inReplyTo":null,"subject":"git-diff-files and fakeroot","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-01-17T02:10:57Z","receivedAt":"2006-01-17T02:10:57Z","isPatch":false,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"I've been trying to track down a strange issue with building kernels\n(and scripts/setlocalversion) and finally realized the problem was the\nwhen run under fakeroot, git-diff-files thinks everything is changed\n(deleted, I believe)\n\nOddly, running \"git status\" seems to correct things.\n\nRunning \"fakeroot git-diff-files\" gives me lines like this:\n\n\n:100644 100644 f866059f24bacd314fa4a979334a9893dbfc19ba 0000000000000000000000000000000000000000 M      write-tree.c\n\nLooking at strace output, I can't see a difference that appears meaningful,\n\n\nI can probably work around this, some other way, but knowing if\nthis is something that is fixable in git itself or not would be nice.\n\nThanks!\n\n\n-- \n\nRyan Anderson\n  sometimes Pug Majere\n\n"},{"id":"14757","messageId":"7v7j8zlh1p.fsf@assigned-by-dhcp.cox.net","threadId":"3087","inReplyTo":"43CC5231.3090005@michonline.com","subject":"Re: git-diff-files and fakeroot","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-17T02:33:22Z","receivedAt":"2006-01-17T02:33:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ryan Anderson <ryan@michonline.com> writes:\n\n> Oddly, running \"git status\" seems to correct things.\n>\n> Running \"fakeroot git-diff-files\" gives me lines like this:\n>\n> :100644 100644 f866059f24bacd314fa4a979334a9893dbfc19ba 0000000000000000000000000000000000000000 M      write-tree.c\n>\n> Looking at strace output, I can't see a difference that appears meaningful,\n\nHow does fakeroot keep track of fake ownerships?\n\nThat is, I suspect:\n\n\t$ date >foo\n\t$ ls -l foo\n\t-rw-rw-r--  1 junio junio 29 Jan 16 18:29 foo\n\t$ fakeroot sh -i\n        # ls -l foo\n\t-rw-rw-r--  1 root root 29 Jan 16 18:29 foo\n\nwhich means that under fakeroot, stat would give file ownerships\nfor *my* files as if they are owned by root.\n\nAnd of course .git/index records the as me and fakeroot has no\nway of knowing me maps to root in that fake environment.\n\n\"git status\" includes \"git update-index --refresh\", which reads\nfrom the stat bits and ownerships, notices that file contents have\nnot changed, and writes a new index file that records these stat\nbits (so git thinks they are now owned by root).\n\nIf you come out of the fakeroot environment, I am reasonably\nsure that you would find all the index entries are dirty again,\nfor exactly the same reason.  index thinks things are owned by\nroot, the files are owned by you, so without looking at file\ncontents, it says \"these things might have changed\".\n\n\n\n\n\t\n"},{"id":"14758","messageId":"7vzmlvk2bs.fsf@assigned-by-dhcp.cox.net","threadId":"3087","inReplyTo":"43CC5231.3090005@michonline.com","subject":"Re: git-diff-files and fakeroot","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-17T02:36:39Z","receivedAt":"2006-01-17T02:36:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ryan Anderson <ryan@michonline.com> writes:\n\n> I've been trying to track down a strange issue with building kernels\n> (and scripts/setlocalversion) and finally realized the problem was the\n> when run under fakeroot, git-diff-files thinks everything is changed\n> (deleted, I believe)\n\nBTW, Ryan, I suspect this is where you try to append \"-dirty\" to\nthe version number.  But I wonder why you are doing the build\nunder fakeroot to begin with?  Wasn't the SOP \"build as\nyourself, install as root\"?\n"},{"id":"14761","messageId":"20060117052758.GA22839@mythryan2.michonline.com","threadId":"3087","inReplyTo":"7vzmlvk2bs.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-diff-files and fakeroot","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-01-17T05:27:59Z","receivedAt":"2006-01-17T05:27:59Z","isPatch":false,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"On Mon, Jan 16, 2006 at 06:36:39PM -0800, Junio C Hamano wrote:\n> Ryan Anderson <ryan@michonline.com> writes:\n> \n> > I've been trying to track down a strange issue with building kernels\n> > (and scripts/setlocalversion) and finally realized the problem was the\n> > when run under fakeroot, git-diff-files thinks everything is changed\n> > (deleted, I believe)\n> \n> BTW, Ryan, I suspect this is where you try to append \"-dirty\" to\n> the version number.  But I wonder why you are doing the build\n> under fakeroot to begin with?  Wasn't the SOP \"build as\n> yourself, install as root\"?\n\nThat's exactly what started this search, because I was running\n\"make deb-pkg\". (Effectively.)  dpkg-buildpackage wants to think it is\nrunning as root, either via sudo or via fakeroot.  I had my build\nenvironment switched over entirely to fakeroot, as it just seems to be a\nbetter practice, but I've temporarily switched back to sudo.\n\nHowever, your explanation has pointed out to me how I can solve this -\nrun \"fakeroot -u\" instead of \"fakeroot\", and I think it will be fixed.\n\nlkml cc:ed to hopefully stick this in an archive where someone else will\nfind it.\n\n\n\n\n\n-- \n\nRyan Anderson\n  sometimes Pug Majere\n"},{"id":"14764","messageId":"95E085A7-B910-4C01-BA6E-43971A6F5F97@mac.com","threadId":"3087","inReplyTo":"20060117052758.GA22839@mythryan2.michonline.com","subject":"Re: git-diff-files and fakeroot","fromName":"Kyle Moffett","fromEmail":"mrmacman_g4@mac.com","sentAt":"2006-01-17T05:59:24Z","receivedAt":"2006-01-17T05:59:24Z","isPatch":false,"sender":{"key":"mrmacman_g4@mac.com","avatar":null},"body":"On Jan 17, 2006, at 00:27, Ryan Anderson wrote:\n> On Mon, Jan 16, 2006 at 06:36:39PM -0800, Junio C Hamano wrote:\n>> BTW, Ryan, I suspect this is where you try to append \"-dirty\" to  \n>> the version number.  But I wonder why you are doing the build  \n>> under fakeroot to begin with?  Wasn't the SOP \"build as\n>> yourself, install as root\"?\n>\n> That's exactly what started this search, because I was running  \n> \"make deb-pkg\". (Effectively.)  dpkg-buildpackage wants to think it  \n> is running as root, either via sudo or via fakeroot.  I had my  \n> build environment switched over entirely to fakeroot, as it just  \n> seems to be a better practice, but I've temporarily switched back  \n> to sudo.\n>\n> However, your explanation has pointed out to me how I can solve  \n> this - run \"fakeroot -u\" instead of \"fakeroot\", and I think it will  \n> be fixed.\n\nYou should run \"make\" first, then after that completes run \"fakeroot  \nmake deb-pkg\".  I think this is similar to what the Debian package  \n\"kernel-package\" does, except it substitutes an alternate \"debian/\"  \ndirectory.  IIRC, it just runs \"make install\" as a normal user to a  \nstaging directory, then runs \"$(ROOTCMD) dpkg-deb -b [...]\" to build  \nthe package.  IMHO it's somewhat of a cleaner solution, and I've used  \nit for several years now with no issues.\n\nCheers,\nKyle Moffett\n\n--\nI have yet to see any problem, however complicated, which, when you  \nlooked at it in the right way, did not become still more complicated.\n   -- Poul Anderson\n"},{"id":"14765","messageId":"43CC89F0.7060109@michonline.com","threadId":"3087","inReplyTo":"95E085A7-B910-4C01-BA6E-43971A6F5F97@mac.com","subject":"Re: git-diff-files and fakeroot","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-01-17T06:08:48Z","receivedAt":"2006-01-17T06:08:48Z","isPatch":false,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"Kyle Moffett wrote:\n\n> On Jan 17, 2006, at 00:27, Ryan Anderson wrote:\n>\n>> On Mon, Jan 16, 2006 at 06:36:39PM -0800, Junio C Hamano wrote:\n>>\n>>> BTW, Ryan, I suspect this is where you try to append \"-dirty\" to \n>>> the version number.  But I wonder why you are doing the build  under\n>>> fakeroot to begin with?  Wasn't the SOP \"build as\n>>> yourself, install as root\"?\n>>\n>>\n>> That's exactly what started this search, because I was running  \"make\n>> deb-pkg\". (Effectively.)  dpkg-buildpackage wants to think it  is\n>> running as root, either via sudo or via fakeroot.  I had my  build\n>> environment switched over entirely to fakeroot, as it just  seems to\n>> be a better practice, but I've temporarily switched back  to sudo.\n>>\n>> However, your explanation has pointed out to me how I can solve  this\n>> - run \"fakeroot -u\" instead of \"fakeroot\", and I think it will  be\n>> fixed.\n>\n>\n> You should run \"make\" first, then after that completes run \"fakeroot \n> make deb-pkg\".  I think this is similar to what the Debian package \n> \"kernel-package\" does, except it substitutes an alternate \"debian/\" \n> directory.  IIRC, it just runs \"make install\" as a normal user to a \n> staging directory, then runs \"$(ROOTCMD) dpkg-deb -b [...]\" to build \n> the package.  IMHO it's somewhat of a cleaner solution, and I've used \n> it for several years now with no issues.\n\n\nRight \"make all && fakeroot make deb-pkg\" was failing, because with\nCONFIG_LOCALVERSION_AUTO set, I was both getting a \"-dirty\" string\nappended to the version, as well as something awfully close to a full\nrebuild due to the version number changing, and on top of all that, the\ndpkg-buildpackage would fail, as \"-dirty\" doesn't have a number in it\n(hence why you see dfsg1 or ubuntu0 in version strings.)\n\nI think I might take your suggestion, and fix up the builddeb script to\ndo the \"run as root\" part itself, rather than needing to do it outside. \nIt would make it possible to just run \"make oldconfig deb-pkg\" which\nwould make things a little bit simpler.\n\n-- \n\nRyan Anderson\n  sometimes Pug Majere\n\n"},{"id":"14788","messageId":"20060117181012.GA8047@mars.ravnborg.org","threadId":"3087","inReplyTo":"43CC89F0.7060109@michonline.com","subject":"Re: git-diff-files and fakeroot","fromName":"Sam Ravnborg","fromEmail":"sam@ravnborg.org","sentAt":"2006-01-17T18:10:12Z","receivedAt":"2006-01-17T18:10:12Z","isPatch":false,"sender":{"key":"sam@ravnborg.org","avatar":"https://gravatar.com/avatar/168a912606ed0742d840bb365e3cc21db390c36531a58341dc7a069cc1f15f62?d=mp&s=160"},"body":"On Tue, Jan 17, 2006 at 01:08:48AM -0500, Ryan Anderson wrote:\n> \n> I think I might take your suggestion, and fix up the builddeb script to\n> do the \"run as root\" part itself, rather than needing to do it outside. \n> It would make it possible to just run \"make oldconfig deb-pkg\" which\n> would make things a little bit simpler.\nIf we do something it must be consistent for all *-pkg targets.\nSo fixing up builddeb is not enough, we must fix it for rpm etc also.\n\nNot that I have looked into what is needed, but we shall not have\ninconsistent behavious between the different *-pkg targets.\n\n\tSam\n"}]}