Re: git-diff-files and fakeroot

5 messages, 4 authors, 2016-06-15 · open the first message on its own page

Re: git-diff-files and fakeroot

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:16

Ryan Anderson [off-list ref] writes:
I've been trying to track down a strange issue with building kernels
(and scripts/setlocalversion) and finally realized the problem was the
when run under fakeroot, git-diff-files thinks everything is changed
(deleted, I believe)
BTW, Ryan, I suspect this is where you try to append "-dirty" to
the version number.  But I wonder why you are doing the build
under fakeroot to begin with?  Wasn't the SOP "build as
yourself, install as root"?

Re: git-diff-files and fakeroot

From: Ryan Anderson <hidden>
Date: 2006-01-17 05:29:11

On Mon, Jan 16, 2006 at 06:36:39PM -0800, Junio C Hamano wrote:
Ryan Anderson [off-list ref] writes:
quoted
I've been trying to track down a strange issue with building kernels
(and scripts/setlocalversion) and finally realized the problem was the
when run under fakeroot, git-diff-files thinks everything is changed
(deleted, I believe)
BTW, Ryan, I suspect this is where you try to append "-dirty" to
the version number.  But I wonder why you are doing the build
under fakeroot to begin with?  Wasn't the SOP "build as
yourself, install as root"?
That's exactly what started this search, because I was running
"make deb-pkg". (Effectively.)  dpkg-buildpackage wants to think it is
running as root, either via sudo or via fakeroot.  I had my build
environment switched over entirely to fakeroot, as it just seems to be a
better practice, but I've temporarily switched back to sudo.

However, your explanation has pointed out to me how I can solve this -
run "fakeroot -u" instead of "fakeroot", and I think it will be fixed.

lkml cc:ed to hopefully stick this in an archive where someone else will
find it.





-- 

Ryan Anderson
  sometimes Pug Majere

Re: git-diff-files and fakeroot

From: Kyle Moffett <hidden>
Date: 2006-01-17 05:59:38

On Jan 17, 2006, at 00:27, Ryan Anderson wrote:
On Mon, Jan 16, 2006 at 06:36:39PM -0800, Junio C Hamano wrote:
quoted
BTW, Ryan, I suspect this is where you try to append "-dirty" to  
the version number.  But I wonder why you are doing the build  
under fakeroot to begin with?  Wasn't the SOP "build as
yourself, install as root"?
That's exactly what started this search, because I was running  
"make deb-pkg". (Effectively.)  dpkg-buildpackage wants to think it  
is running as root, either via sudo or via fakeroot.  I had my  
build environment switched over entirely to fakeroot, as it just  
seems to be a better practice, but I've temporarily switched back  
to sudo.

However, your explanation has pointed out to me how I can solve  
this - run "fakeroot -u" instead of "fakeroot", and I think it will  
be fixed.
You should run "make" first, then after that completes run "fakeroot  
make deb-pkg".  I think this is similar to what the Debian package  
"kernel-package" does, except it substitutes an alternate "debian/"  
directory.  IIRC, it just runs "make install" as a normal user to a  
staging directory, then runs "$(ROOTCMD) dpkg-deb -b [...]" to build  
the package.  IMHO it's somewhat of a cleaner solution, and I've used  
it for several years now with no issues.

Cheers,
Kyle Moffett

--
I have yet to see any problem, however complicated, which, when you  
looked at it in the right way, did not become still more complicated.
   -- Poul Anderson

Re: git-diff-files and fakeroot

From: Ryan Anderson <hidden>
Date: 2006-01-17 06:09:01

Kyle Moffett wrote:
On Jan 17, 2006, at 00:27, Ryan Anderson wrote:
quoted
On Mon, Jan 16, 2006 at 06:36:39PM -0800, Junio C Hamano wrote:
quoted
BTW, Ryan, I suspect this is where you try to append "-dirty" to 
the version number.  But I wonder why you are doing the build  under
fakeroot to begin with?  Wasn't the SOP "build as
yourself, install as root"?

That's exactly what started this search, because I was running  "make
deb-pkg". (Effectively.)  dpkg-buildpackage wants to think it  is
running as root, either via sudo or via fakeroot.  I had my  build
environment switched over entirely to fakeroot, as it just  seems to
be a better practice, but I've temporarily switched back  to sudo.

However, your explanation has pointed out to me how I can solve  this
- run "fakeroot -u" instead of "fakeroot", and I think it will  be
fixed.

You should run "make" first, then after that completes run "fakeroot 
make deb-pkg".  I think this is similar to what the Debian package 
"kernel-package" does, except it substitutes an alternate "debian/" 
directory.  IIRC, it just runs "make install" as a normal user to a 
staging directory, then runs "$(ROOTCMD) dpkg-deb -b [...]" to build 
the package.  IMHO it's somewhat of a cleaner solution, and I've used 
it for several years now with no issues.

Right "make all && fakeroot make deb-pkg" was failing, because with
CONFIG_LOCALVERSION_AUTO set, I was both getting a "-dirty" string
appended to the version, as well as something awfully close to a full
rebuild due to the version number changing, and on top of all that, the
dpkg-buildpackage would fail, as "-dirty" doesn't have a number in it
(hence why you see dfsg1 or ubuntu0 in version strings.)

I think I might take your suggestion, and fix up the builddeb script to
do the "run as root" part itself, rather than needing to do it outside. 
It would make it possible to just run "make oldconfig deb-pkg" which
would make things a little bit simpler.

-- 

Ryan Anderson
  sometimes Pug Majere

Re: git-diff-files and fakeroot

From: Sam Ravnborg <hidden>
Date: 2006-01-17 18:10:39

On Tue, Jan 17, 2006 at 01:08:48AM -0500, Ryan Anderson wrote:
I think I might take your suggestion, and fix up the builddeb script to
do the "run as root" part itself, rather than needing to do it outside. 
It would make it possible to just run "make oldconfig deb-pkg" which
would make things a little bit simpler.
If we do something it must be consistent for all *-pkg targets.
So fixing up builddeb is not enough, we must fix it for rpm etc also.

Not that I have looked into what is needed, but we shall not have
inconsistent behavious between the different *-pkg targets.

	Sam
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help