Bug 1434235 - build-id breaks --short-circuit
Summary: build-id breaks --short-circuit
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-21 03:19 UTC by Tomasz Kłoczko
Modified: 2017-03-27 09:04 UTC (History)
7 users (show)

Fixed In Version: 4.13.0.1-15.fc27
Clone Of:
Environment:
Last Closed: 2017-03-27 09:04:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomasz Kłoczko 2017-03-21 03:19:44 UTC
Just I found yet another issue related to build-id.

Seems it breaks rpmbuild in some other way.
When rpmbuild is executed only to verify %files it start showing on duplicated %files entries on build-id entries.

Please test it for example on parted by:

$ rpmbuild -bi parted.spec --nocheck

(--nocheck added to speedup this test)
And after this

$ rpmbuild -bl --short-circuit parted.spec


This is what I have after second command:

Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64
error: Installed (but unpackaged) file(s) found:
   /usr/lib/.build-id/34/dfbcd8dc3d9854803dd00834a96b28ccd98eb8
   /usr/lib/.build-id/52/2c07e88879c4b17b2d0261e7702bf4d2bea0a0
   /usr/lib/.build-id/75/85dac3b1406a284187295c757f790ea0d11aca
   /usr/lib/.build-id/83/ced6d73243074c274e46b907a466932e629f6b
   /usr/lib/debug/.build-id/34/dfbcd8dc3d9854803dd00834a96b28ccd98eb8
   /usr/lib/debug/.build-id/34/dfbcd8dc3d9854803dd00834a96b28ccd98eb8.debug
   /usr/lib/debug/.build-id/52/2c07e88879c4b17b2d0261e7702bf4d2bea0a0
   /usr/lib/debug/.build-id/52/2c07e88879c4b17b2d0261e7702bf4d2bea0a0.debug
   /usr/lib/debug/.build-id/75/85dac3b1406a284187295c757f790ea0d11aca
   /usr/lib/debug/.build-id/75/85dac3b1406a284187295c757f790ea0d11aca.debug
   /usr/lib/debug/.build-id/83/ced6d73243074c274e46b907a466932e629f6b
   /usr/lib/debug/.build-id/83/ced6d73243074c274e46b907a466932e629f6b.debug


RPM build errors:
    Duplicate build-ids /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/sbin/parted and /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/sbin/parted
    Duplicate build-ids /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/sbin/partprobe and /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/sbin/partprobe
    Duplicate build-ids /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/lib64/libparted.so.2.0.1 and /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/lib64/libparted.so.2.0.1
    Duplicate build-ids /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/lib64/libparted-fs-resize.so.0.0.1 and /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/lib64/libparted-fs-resize.so.0.0.1
    Duplicate build-ids /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/usr/lib/debug/lib64/libparted.so.2.0.1-3.2-25.fc27.x86_64.debug and /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/usr/lib/debug/lib64/libparted.so.2.0.1-3.2-25.fc27.x86_64.debug
    Duplicate build-ids /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/usr/lib/debug/lib64/libparted-fs-resize.so.0.0.1-3.2-25.fc27.x86_64.debug and /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/usr/lib/debug/lib64/libparted-fs-resize.so.0.0.1-3.2-25.fc27.x86_64.debug
    Duplicate build-ids /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/usr/lib/debug/sbin/parted-3.2-25.fc27.x86_64.debug and /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/usr/lib/debug/sbin/parted-3.2-25.fc27.x86_64.debug
    Duplicate build-ids /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/usr/lib/debug/sbin/partprobe-3.2-25.fc27.x86_64.debug and /home/tkloczko/rpmbuild/BUILDROOT/parted-3.2-25.fc27.x86_64/usr/lib/debug/sbin/partprobe-3.2-25.fc27.x86_64.debug
    Installed (but unpackaged) file(s) found:
   /usr/lib/.build-id/34/dfbcd8dc3d9854803dd00834a96b28ccd98eb8
   /usr/lib/.build-id/52/2c07e88879c4b17b2d0261e7702bf4d2bea0a0
   /usr/lib/.build-id/75/85dac3b1406a284187295c757f790ea0d11aca
   /usr/lib/.build-id/83/ced6d73243074c274e46b907a466932e629f6b
   /usr/lib/debug/.build-id/34/dfbcd8dc3d9854803dd00834a96b28ccd98eb8
   /usr/lib/debug/.build-id/34/dfbcd8dc3d9854803dd00834a96b28ccd98eb8.debug
   /usr/lib/debug/.build-id/52/2c07e88879c4b17b2d0261e7702bf4d2bea0a0
   /usr/lib/debug/.build-id/52/2c07e88879c4b17b2d0261e7702bf4d2bea0a0.debug
   /usr/lib/debug/.build-id/75/85dac3b1406a284187295c757f790ea0d11aca
   /usr/lib/debug/.build-id/75/85dac3b1406a284187295c757f790ea0d11aca.debug
   /usr/lib/debug/.build-id/83/ced6d73243074c274e46b907a466932e629f6b
   /usr/lib/debug/.build-id/83/ced6d73243074c274e46b907a466932e629f6b.debug
[tkloczko@domek SPECS]$

Comment 1 Tomasz Kłoczko 2017-03-21 03:52:25 UTC
Some comments about --short-circuit are in https://bugzilla.redhat.com/show_bug.cgi?id=1433837

Comment 2 Panu Matilainen 2017-03-21 07:34:13 UTC
Mark, this is the same thing we discussed back in January:
http://lists.rpm.org/pipermail/rpm-maint/2017-January/004763.html

I never got around to applying the patch because I had some doubts about it and then there was Devconf and other stuff came up and now I can't for the life of me remember what the thing troubling me was.

Comment 3 Mark Wielaard 2017-03-21 08:56:33 UTC
(In reply to Panu Matilainen from comment #2)
> Mark, this is the same thing we discussed back in January:
> http://lists.rpm.org/pipermail/rpm-maint/2017-January/004763.html
> 
> I never got around to applying the patch because I had some doubts about it
> and then there was Devconf and other stuff came up and now I can't for the
> life of me remember what the thing troubling me was.

Thanks. I had forgotten about that patch. I'll take a look and play with it now that I understand how people use --short-circuit.

Comment 4 Mark Wielaard 2017-03-21 10:58:07 UTC
(In reply to Panu Matilainen from comment #2)
> Mark, this is the same thing we discussed back in January:
> http://lists.rpm.org/pipermail/rpm-maint/2017-January/004763.html
> 
> I never got around to applying the patch because I had some doubts about it
> and then there was Devconf and other stuff came up and now I can't for the
> life of me remember what the thing troubling me was.

It might be because with the patch applied there are two failing testcases...

 103: rpmbuildid.at:911  rpmbuild buildid duplicate compat
      build debuginfo buildid
 104: rpmbuildid.at:990  rpmbuild buildid hardlink compat
      build debuginfo buildid

Those test packages that deliberately include binaries with duplicate build-ids. Either by having an exact copy (for which we want to emit a warning) or by hard-linking files. To the code that situation looks exactly like the short-circuited case. If the duplication is caused by actual binaries with the same build-id, then the code should create alternative file names. If the duplication is caused by short-circuited it should not.

I am pondering if we can resolve that (duplicate) conflict somehow.

Comment 5 Panu Matilainen 2017-03-21 11:30:02 UTC
Ah, that seems to ring a distant bell. I've probably posted the patch after testing with a manual testcase and then later when considering actually applying it ran the test-suite and discovered those failures.

Various possibilities might include:
- Detect --short-circuit and only activate what my patch does in that case
- Write the buildids into a file that survives across rpmbuild invocations, much like debugfiles.list, debuglinks.list etc and reuse that if it exists already (ie it must be a short-circuited build)
- Only do the buildid stuff in complete builds (but this is bad for debugging it)

Comment 6 Panu Matilainen 2017-03-21 12:18:59 UTC
(In reply to Panu Matilainen from comment #5)
> Various possibilities might include:
> - Detect --short-circuit and only activate what my patch does in that case

Just sent a V2 patch that does exactly this (but wont apply as-is to 4.13.x):
http://lists.rpm.org/pipermail/rpm-maint/2017-March/005266.html

That makes the test-suite pass and also lets --short-circuit work. Of course duplicate build-id detection is still broken in short-circuited builds, but whether we actually care about that...

Comment 7 Mark Wielaard 2017-03-22 11:35:56 UTC
(In reply to Panu Matilainen from comment #6)
> (In reply to Panu Matilainen from comment #5)
> > Various possibilities might include:
> > - Detect --short-circuit and only activate what my patch does in that case
> 
> Just sent a V2 patch that does exactly this (but wont apply as-is to 4.13.x):
> http://lists.rpm.org/pipermail/rpm-maint/2017-March/005266.html
> 
> That makes the test-suite pass and also lets --short-circuit work. Of course
> duplicate build-id detection is still broken in short-circuited builds, but
> whether we actually care about that...

Sent an update to your original patch (which I liked better than the new one because it doesn't require special casing short-circuit builds):
http://lists.rpm.org/pipermail/rpm-maint/2017-March/005270.html

Comment 8 Mark Wielaard 2017-03-27 09:04:54 UTC
After some different attempts the following fix was added:
http://lists.rpm.org/pipermail/rpm-maint/2017-March/005278.html


Note You need to log in before you can comment on or make changes to this bug.