dpkg-source sets -i -I by default

Bug #317761 reported by Oumar Aziz OUATTARA
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dpkg (Debian)
Fix Released
Unknown
dpkg (Ubuntu)
Fix Released
Undecided
Unassigned
Intrepid
Fix Released
Medium
Colin Watson

Bug Description

The version of dpkg-source in Ubuntu 8.10 erroneously sets the -i and -I options by default for version 1.0 source packages (i.e. the version of the source format that we actually use). This causes various files to be omitted unexpectedly from tarballs and diffs, which causes problems in particular for people building private source packages that need to contain binary objects.

This bug was fixed by Debian in dpkg 1.14.21, so is fixed in Jaunty and was not present in earlier releases:

  http://git.debian.org/?p=dpkg/dpkg.git;a=commit;h=21d69014f424f670a9ccdce3a7aad11e3b3f1b60

Proposed patch:

  http://launchpadlibrarian.net/23510120/dpkg_1.14.20ubuntu6.2.debdiff

TEST CASE: Download http://launchpadlibrarian.net/21270813/tests.zip, unpack, cd to test-1.0/, and run 'debuild -S -sa; tar tzvf ../test_1.0.orig.tar.gz'. The bug is that the files test-1.0.orig/libsmbclient-x86_64-linux.a and test-1.0.orig/libsmbclient-i486-linux.a are missing from the tarball. Now remove ../test_1.0.orig.tar.gz and repeat 'debuild -S -sa', but this time 'tar tzvf ../test_1.0-1.tar.gz' (this tests native-mode source package building). Again, the .a files will be missing from the tarball if this bug is present. You'll need to remove all these files and start again in order to verify the fix.

Regression potential: Well, it's dpkg. dpkg itself shouldn't change, but I'd recommend running for a while to spot any upgrade problems anyway. If you can, build some other packages and check that the resulting debdiffs are sensible.

Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :

Looking at the changelog in http://changelogs.ubuntu.com/changelogs/pool/main/d/dpkg/dpkg_1.14.20ubuntu6/changelog , I believe it version 1.14.17 that broke debuild.
Not including some binaries in the sources is IMO a good choice, but we should at least have a way to tell dpkg-source to include them (bypassing the default).

Revision history for this message
Colin Watson (cjwatson) wrote :

I cannot reproduce this with a trivial test case. Please provide your full build log, and the contents of ~/.devscripts.

Changed in dpkg:
status: New → Incomplete
Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :

Hi,

I am not home for the moment so I can't provide a build.log right now but I can give you a link to the sources I wanted to pack on intrepid.

https://edge.launchpad.net/~team-xbmc-svn/+archive
    * xbmc_8.10final1svn17113-hardy1.diff.gz (6.6 KiB)
    * xbmc_8.10final1svn17113-hardy1.dsc (1.7 KiB)
    * xbmc_8.10final1svn17113.orig.tar.gz (121.3 MiB)

Getting those, you can unpack them and try to repack using "debuild -S -sa", you migth notice a diff between the two packages.

I will try to create a smaller example to reproduce, when I get home.

Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :

Oki,

Here is an example I have made. On intrepid, when running debuild -S -sa, the orig file doesn't contain the .a files.

Revision history for this message
Colin Watson (cjwatson) wrote :

I ran your test and the resulting test_1.0.orig.tar.gz is as follows:

$ tar tzvf ../test_1.0.orig.tar.gz
drwxr-xr-x cjwatson/cjwatson 0 2009-01-16 20:00 test-1.0.orig/
-rw-r--r-- cjwatson/cjwatson 4204734 2009-01-16 19:49 test-1.0.orig/libsmbclient-x86_64-linux.a
-rw-r--r-- cjwatson/cjwatson 2675908 2009-01-16 19:49 test-1.0.orig/libsmbclient-i486-linux.a

As I requested a few comments ago, could you please provide the full build log that you see (you'll find it in test_1.0-1_source.build) and the contents of your ~/.devscripts file?

Revision history for this message
Oumar Aziz OUATTARA (wattazoum) wrote :

Here is my log file.

I don't have a .devscripts in my HOME directory.

By the way, are you using intrepid for your tests ?

Changed in dpkg:
status: Incomplete → New
Revision history for this message
Colin Watson (cjwatson) wrote :

Ah, this is specifically a bug in Intrepid's dpkg, not in other releases. It was fixed by Debian in dpkg 1.14.21.

Changed in dpkg:
status: New → Fix Released
assignee: nobody → cjwatson
importance: Undecided → Medium
milestone: none → intrepid-updates
status: New → Triaged
Revision history for this message
Colin Watson (cjwatson) wrote :
description: updated
Revision history for this message
Colin Watson (cjwatson) wrote :

I've uploaded a fix for this to intrepid-proposed. ubuntu-sru team: please review.

description: updated
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Fix tested and works for me

Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into intrepid-proposed; please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in dpkg:
status: Triaged → Fix Committed
Revision history for this message
Brian Thomason (brian-thomason) wrote :

I had run into this bug the other day in building a commercial package with .so files in it. I installed the update from proposed and can confirm that -I is now disabled by default as it should be.

Revision history for this message
Martin Pitt (pitti) wrote :

I built some source packages with this version, and confirm that -i -I are not used by default. Explicitly using -i and -I still works correctly.

I also tested dpkg itself with some dist-upgrades, and dpkg -P, and did not see any regressions. Together with Brian's testimonial I consider this verified.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dpkg - 1.14.20ubuntu6.2

---------------
dpkg (1.14.20ubuntu6.2) intrepid-proposed; urgency=low

  * Backport from 1.14.21 (Raphael Hertzog):
    - Fix dpkg-source to not use -i and -I by default with "1.0" source
      packages. Closes: #495138, LP: #317761

 -- Colin Watson <email address hidden> Thu, 05 Mar 2009 09:37:38 +0000

Changed in dpkg:
status: Fix Committed → Fix Released
Changed in dpkg (Debian):
status: Unknown → Fix Released
Revision history for this message
Jason Abernathy (j-abernathy) wrote :

Has this bug regressed to dpkg 1.16.1.2?

> tar -xzf foo-app-full.tgz
> cd fooapp-1.0

> cat debian/source/include-binaries
extra/bar
extra/bar.so
extra/bar.a

> dpkg-source -b .
dpkg-source: info: using source format `3.0 (quilt)'
dpkg-source: info: building fooapp using existing ./fooapp_1.0.orig.tar.gz
dpkg-source: info: building fooapp in fooapp_1.0-1.debian.tar.gz
dpkg-source: info: building fooapp in fooapp_1.0-1.dsc

> tar -ztf ../fooapp_1.0-1.debian.tar.gz | grep bar
extra/bar

> dpkg-source -b -I*.dat .
dpkg-source: info: using source format `3.0 (quilt)'
dpkg-source: info: building fooapp using existing ./fooapp_1.0.orig.tar.gz
dpkg-source: info: building fooapp in fooapp_1.0-1.debian.tar.gz
dpkg-source: info: building fooapp in fooapp_1.0-1.dsc

> tar -ztf ../fooapp_1.0-1.debian.tar.gz | grep bar
extra/bar.so
extra/bar.a
extra/bar

Revision history for this message
Frederic Van Espen (frederic-ve) wrote :

for source format 3.0 (quilt), the --help switch shows you which -I options are set by default:

  -I[<pattern>] filter out files when building tarballs
                             (defaults to: -I*.a -I*.la -I*.o -I*.so -I.*.sw? -I*/*~ -I,,* -I.[#~]* -I.arch-ids -I.arch-inventory -I.be -I.bzr -I.bzr.backup -I.bzr.tags -I.bzrignore -I.cvsignore -I.deps -I.git -I.gitattributes -I.gitignore -I.gitmodules -I.hg -I.hgignore -I.hgsigs -I.hgtags -I.shelf -I.svn -ICVS -IDEADJOE -IRCS -I_MTN -I_darcs -I{arch}).

I believe indeed this is a bug in dpkg-dev, since we are explicitely requesting those files to be included. The default set of excludes should not remove this file from the source package. which is why I reported a debian bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718984

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.