On Sat, 2 Dec 2017 00:10:11 +0100 marcel-hollerb...@t-online.de said:
> Hello,
>
> so it turned out that this is a ninja bug.
>
> Ninja has some sort of recompactination if the number of entries in the
> .ninja_log and .ninja_deps files are getting too big, then it will cut
> off a few, write that into a temp file, and rename that temp file later
> to .ninja_log or .ninja_deps, if you ran exactly this time ninja as root
> it will place .ninja_log and .ninja_deps as root owned files in the
> directory instead of maintaining the old gid / uid of the file.
I'm amazed it took us to discover this and you to fix it... ninja isn't exactly
THAT new... :) is it that no one does regular "build as user, install as root"
when using ninja? like this is the regular workflow with make like since...
dinosaurs roamed the earth.
> tldr:
> There is a bugfix:
> https://github.com/ninja-build/ninja/pull/1362
>
> Greetings,
>Marcel Hollerbach
>
> On Thu, Nov 23, 2017 at 08:57:20AM +0900, Carsten Haitzler wrote:
> > On Wed, 22 Nov 2017 20:13:48 + Mike Blumenkrantz
> > said:
> >
> > > I'm on fedora with meson 0.42.1 and ninja 1.8.2
> >
> > Can you try doing the "build as user, install as root/sudo" and hit the
> > issue and details exactly what files are owned by root at that point and
> > what file the problem is with and why the permission problem is there? I
> > just can't see the source of the issue in my build trees.
> >
> > > On Wed, Nov 22, 2017 at 1:08 PM Andrew Williams
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > I'm on Arch and generally try to stay up to date so maybe they have
> > > > fixed it?
> > > > Mike?
> > > >
> > > > On Wed, 22 Nov 2017 at 15:55 Jérémy Zurcher wrote:
> > > >
> > > > > I can't reproduce that root owner ship issue right now.
> > > > > I made the changes to my scripts on the 2017/08/17
> > > > > at that time on my archlinux boxes ninja was 1.7.2 and meson was
> > > > > 0.41.2 since then ninja has been upgraded to 1.8.2, and meson to
> > > > > 0.42.1 then 0.43.0
> > > > > maybe it has been fixed in one of them fixed now.
> > > > > (but I won't dive into their respective repos to check that ;)
> > > > >
> > > > >
> > > > > On Wednesday 22 November 2017 20:51, Carsten Haitzler wrote :
> > > > > > On Wed, 22 Nov 2017 10:36:36 + Andrew Williams <
> > > > a...@andywilliams.me>
> > > > > said:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I'm glad that it is not affecting you. Jeyzu and I both seem to
> > > > > > > have
> > > > > hit
> > > > > > > this issue (and I guess zmike too as described earlier).
> > > > > > > Some times after a "sudo ninja install" I can no longer "ninja"
> > > > > > > due
> > > > to
> > > > > > > permissions issues with files that have become root owned.
> > > > > > >
> > > > > > > It is unfortunate but it would be good to get a solution that
> > > > > > > works
> > > > > all the
> > > > > > > time for everyone if possible.
> > > > > >
> > > > > > I checked what files were root owned. I currently don't see a reason
> > > > why
> > > > > it
> > > > > > should fail. Someone show me a reason where it does fail (a file
> > > > written
> > > > > to as
> > > > > > root has to be overwritten as a user or it cannot be deleted as a
> > > > user).
> > > > > I
> > > > > > don't see it. perhaps its a bug in meson in an older version? or a
> > > > newer
> > > > > one?
> > > > > >
> > > > > > > Andy
> > > > > > >
> > > > > > > On Wed, 22 Nov 2017 at 10:17 Carsten Haitzler
> > > > > > >
> > > > > wrote:
> > > > > > >
> > > > > > > > On Wed, 22 Nov 2017 10:33:05 +0100 Jérémy Zurcher
> > > > > > > > > > > >
> > > > > said:
> > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > I confirm, I had to add the above in my build script :
> > > > > > > > >
> > > > > > > > > sudo -S chown $USER $BUILD_DIR/.ninja_deps
> > > > > > > > > $BUILD_DIR/.ninja_log
> > > > > > > >
> > > > > > > > 7:14PM ~/C/e/build ⎇ master > ls -al
> > > > > > > > total 4.4M
> > > > > > > > 4.0K drwxr-xr-x 9 raster raster 4.0K Nov 22 15:36 ./
> > > > > > > > 4.0K drwxr-xr-x 10 raster raster 4.0K Nov 22 15:36 ../
> > > > > > > > 1.6M -rw-r--r-- 1 raster raster 1.6M Nov 22 15:36 .ninja_deps
> > > > > > > > 64K -rw-r--r-- 1 raster raster 61K Nov 22 15:36 .ninja_log
> > > > > > > >
> > > > > > > > written not as root. (make ninja install was as root). ... ?
> > > > > > > >
> > > > > > > > > On Wednesday 22 November 2017 08:18, Andrew Williams wrote :
> > > > > > > > > > Hi,
> > > > > > > > > >
> > > > > > > > > > Compiling as root may be a bad thing but mike is right,
> > > > > > > > > > ninja
> > > > > install
> > > > > > > > hits
> > > > > > > > > > log files and other - some times causing root ownership. I
> > > > > > > > > > have
> > > > > seen it
> > > > > > > > > > occasionally myself and have had to either delete the build
> > > > tree
> > > > >