Bug 238

Summary: sstate code doesn't detect overwriting files
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Richard Purdie <richard.purdie>
Component: meta-yoctoAssignee: Richard Purdie <richard.purdie>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: alexandrux.palalau, dexuan.cui, gary, jessica.zhang, kevin.tian, poky.bs.watcher, poky.watcher, richard.purdie, sgw, song.liu
Version: 0.9   
Target Milestone: 1.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard: (Scheduled)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Richard Purdie 2010-08-27 04:18:33 UTC
Two packages should not be able to install the same filename to a sstate location without raising an error.

Currently the code silently overwrites the file and there is no duplicate detection.
Comment 1 Richard Purdie 2011-02-01 11:17:01 UTC
We can check for overwritten files from the shell now:

cd tmp/sstate-control
cat * | sort | uniq -d | grep -v /$

which on a small build I had lying around resulted in:

/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/fonts/X11/misc/fonts.alias
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/info/bfd.info
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/info/configure.info
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/info/dir
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/info/standards.info
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man1/kill.1
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man1/last.1
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man1/mesg.1
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man1/wall.1
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man3/libblkid.3
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man8/blkid.8
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man8/findfs.8
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man8/fsck.8
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man8/halt.8
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man8/reboot.8
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man8/shutdown.8
/media/build2/builds/rptest/b4/tmp/sysroots/qemux86/usr/share/man/man8/uuidd.8
/media/build2/builds/rptest/b4/tmp/sysroots/x86_64-linux/usr/share/info/dir
/media/build2/builds/rptest/b4/tmp/sysroots/x86_64-linux/usr/share/man/man3/libblkid.3
/media/build2/builds/rptest/b4/tmp/sysroots/x86_64-linux/usr/share/man/man8/blkid.8
/media/build2/builds/rptest/b4/tmp/sysroots/x86_64-linux/usr/share/man/man8/findfs.8
/media/build2/builds/rptest/b4/tmp/sysroots/x86_64-linux/usr/share/man/man8/fsck.8
/media/build2/builds/rptest/b4/tmp/sysroots/x86_64-linux/usr/share/man/man8/uuidd.8

not too bad at least since its mainly man/doc data
Comment 2 Dexuan Cui 2011-02-21 21:31:33 UTC
(In reply to comment #1)
> We can check for overwritten files from the shell now:
> cd tmp/sstate-control
> cat * | sort | uniq -d | grep -v /$
> which on a small build I had lying around resulted in: ...
> not too bad at least since its mainly man/doc data

I built poky-image-sato-sdk and meta-toolchain-sdk recently and here is my list:

root@dcui-desktop:/distro/dcui/110214/p1/qemumips/tmp/sstate-control# cat * | sort | uniq -d | grep -v /$
/distro/dcui/110214/p1/qemumips/tmp/sysroots/i686-linux/usr/share/man/man3/libblkid.3
/distro/dcui/110214/p1/qemumips/tmp/sysroots/i686-linux/usr/share/man/man8/blkid.8
/distro/dcui/110214/p1/qemumips/tmp/sysroots/i686-linux/usr/share/man/man8/findfs.8
/distro/dcui/110214/p1/qemumips/tmp/sysroots/i686-linux/usr/share/man/man8/fsck.8
/distro/dcui/110214/p1/qemumips/tmp/sysroots/i686-linux/usr/share/man/man8/uuidd.8
/distro/dcui/110214/p1/qemumips/tmp/sysroots/i686-nativesdk-pokysdk-linux/opt/poky/0.9+snapshot/sysroots/i686-pokysdk-linux/usr/share/info/dir.old
/distro/dcui/110214/p1/qemumips/tmp/sysroots/i686-pokysdk-linux-nativesdk/opt/poky/0.9+snapshot/sysroots/i686-pokysdk-linux/usr/share/info/bfd.info
/distro/dcui/110214/p1/qemumips/tmp/sysroots/i686-pokysdk-linux-nativesdk/opt/poky/0.9+snapshot/sysroots/i686-pokysdk-linux/usr/share/info/configure.info
/distro/dcui/110214/p1/qemumips/tmp/sysroots/i686-pokysdk-linux-nativesdk/opt/poky/0.9+snapshot/sysroots/i686-pokysdk-linux/usr/share/info/standards.info
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/lib/libiberty.a
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/info/bfd.info
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/info/configure.info
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/info/dir
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/info/dir.old
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/info/standards.info
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man1/kill.1
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man1/last.1
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man1/mesg.1
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man1/wall.1
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man3/libblkid.3
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man8/blkid.8
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man8/findfs.8
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man8/fsck.8
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man8/halt.8
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man8/reboot.8
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man8/shutdown.8
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/share/man/man8/uuidd.8


What's notable is:
Both binutils and gcc supplies 
/distro/dcui/110214/p1/qemumips/tmp/sysroots/qemumips/usr/lib/libiberty.a

Hi Richard, IIRC, you said we could use the one binutils supplies(I'm not clear about the exact reason)? So we should discard the one gcc supplies?
Comment 3 Richard Purdie 2011-02-22 03:55:59 UTC
Yes, we shouldn't stage the one from gcc and always use the one from binutils instead (we just have to make a clear choice and this makes the most sense).
Comment 4 Richard Purdie 2012-04-06 16:27:57 UTC
*** Bug 2235 has been marked as a duplicate of this bug. ***
Comment 6 Alexandru Palalau 2012-09-28 13:54:01 UTC
Verified on master branch, latest commit ID a8c78aa835b06578759c4ca170f759928bac3efd
After building core-image-sato-sdk and meta-toolchain-sdk the mentioned cat command provided no output.