libarchive-dev needs a compile/link/run test

Bug #1073390 reported by Benjamin Drung
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libarchive (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

This bug represents the need for a simple compile/link/run test for the development libraries of the libarchive package.

The attached patch introduces such test, it builds the minitar example application that is provided by libarchive, and runs some test with it.

The test case already detected an error: minitar crashes if it should extract a tarball.

Benjamin Drung (bdrung)
tags: added: udstestcompetition
tags: added: patch
Revision history for this message
Benjamin Drung (bdrung) wrote :

I forgot to add the "XS-Testsuite: autopkgtest" stanza. Updated patch is attached.

Revision history for this message
Martin Pitt (pitti) wrote :
Download full text (7.4 KiB)

I run this in a VM, and the tests fail with:

adt-run: trace: & dsc0t-minitar: [----------------------------------------
+ buildtree=/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/
+ shift
+ rm -rf -- /tmp/tmp.MvE2K2w6Uu/dsc0t-minitar-testtmp /tmp/tmp.MvE2K2w6Uu/dsc0t-minitar-testtmp/tmpdir /tmp/tmp.MvE2K2w6Uu/dsc0t-minitar-testtmp/adttmp
+ mkdir -- /tmp/tmp.MvE2K2w6Uu/dsc0t-minitar-testtmp /tmp/tmp.MvE2K2w6Uu/dsc0t-minitar-testtmp/tmpdir /tmp/tmp.MvE2K2w6Uu/dsc0t-minitar-testtmp/adttmp
adt-run: trace: & dsc0t-minitar: - - - - - - - - - - results - - - - - - - - - -
dsc0t-minitar FAIL status: 1, stderr: /tmp/tmp.MvE2K2w6Uu/dsc0-build/liba...
adt-run: trace: & dsc0t-minitar: - - - - - - - - - - stderr - - - - - - - - - -
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/debian/tests/minitar: 9: /tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/debian/tests/minitar: pkg-config: not found
/tmp/tmp.MvE2K2w6Uu/dsc0t-minitar-testtmp/tmpdir/ccn1IcM7.o: In function `extract':
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:341: undefined reference to `archive_read_new'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:342: undefined reference to `archive_write_disk_new'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:343: undefined reference to `archive_write_disk_set_options'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:345: undefined reference to `archive_read_support_filter_bzip2'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:348: undefined reference to `archive_read_support_filter_gzip'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:351: undefined reference to `archive_read_support_filter_compress'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:354: undefined reference to `archive_read_support_format_tar'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:357: undefined reference to `archive_read_support_format_cpio'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:360: undefined reference to `archive_write_disk_set_standard_lookup'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:364: undefined reference to `archive_read_open_file'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:370: undefined reference to `archive_read_next_header'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:381: undefined reference to `archive_entry_pathname'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:370: undefined reference to `archive_read_next_header'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:392: undefined reference to `archive_read_close'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:393: undefined reference to `archive_read_free'
/tmp/tmp.MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/examples/minitar/minitar.c:383: undefined reference to `archive_write_header'
/tmp/tmp.MvE2K2w6Uu/dsc0t-minitar-testtmp/tmpdir/ccn1IcM7.o: In function `copy_data':
/tmp/tmp.MvE...

Read more...

Changed in libarchive (Ubuntu):
status: New → Incomplete
Revision history for this message
Benjamin Drung (bdrung) wrote :

> MvE2K2w6Uu/dsc0-build/libarchive-3.0.4/debian/tests/minitar: pkg-config: not found

I forgot to depend on pkg-config.

Changed in libarchive (Ubuntu):
status: Incomplete → New
Revision history for this message
Martin Pitt (pitti) wrote :

Works fine now, thanks for the quick fix!

tags: added: qa-verified
Changed in libarchive (Ubuntu):
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

I committed the test to Debian's collab-maint git, so this does not need forwarding any more:

  http://anonscm.debian.org/gitweb/?p=collab-maint/libarchive.git;a=commitdiff;h=53efb6249165

Changed in libarchive (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

It succeeded on amd64, but failed on i386:

https://jenkins.qa.ubuntu.com/view/Raring/view/AutoPkgTest/job/raring-proposed-adt-libarchive/lastFailedBuild/

on i386 it gets a few errors on stderr:

examples/minitar/minitar.c: In function ‘copy_data’:
examples/minitar/minitar.c:406:3: warning: passing argument 4 of ‘archive_read_data_block’ from incompatible pointer type [enabled by default]
In file included from examples/minitar/minitar.c:45:0:
/usr/include/archive.h:420:15: note: expected ‘int64_t *’ but argument is of type ‘off_t *’
examples/untar.c: In function ‘copy_data’:
examples/untar.c:210:3: warning: passing argument 4 of ‘archive_read_data_block’ from incompatible pointer type [enabled by default]
In file included from examples/untar.c:60:0:
/usr/include/archive.h:420:15: note: expected ‘int64_t *’ but argument is of type ‘off_t *’

This looks like it could cause actual issues. Benjamin, do you want to look into this, or should we just ignore stderr in the tests?

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

This bug was fixed in the package libarchive - 3.0.4-2git1

---------------
libarchive (3.0.4-2git1) raring; urgency=low

  Upload current Debian packaging git.

  * Add autopkgtest (LP: #1073390).
 -- Benjamin Drung <email address hidden> Mon, 12 Nov 2012 14:17:40 +0100

Changed in libarchive (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Benjamin Drung (bdrung) wrote :

I think we should fix the build warning of examples/minitar/minitar.c and examples/untar.c.

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

I finally forwarded the two issues that I discovered while constructing the test case to upstream:
https://code.google.com/p/libarchive/issues/detail?id=283
https://code.google.com/p/libarchive/issues/detail?id=284

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.