Bug 1051694 - libguestfs FTBFS on Ubuntu saucy
Summary: libguestfs FTBFS on Ubuntu saucy
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL: https://launchpadlibrarian.net/162975...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-10 21:58 UTC by Daniel Lipsitt
Modified: 2016-05-09 09:39 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-05-09 09:39:47 UTC
Embargoed:


Attachments (Terms of Use)
An attempt to disable build of ruby 1.8 bindings in debian control file (639 bytes, patch)
2014-01-18 00:20 UTC, Daniel Lipsitt
no flags Details | Diff

Description Daniel Lipsitt 2014-01-10 21:58:15 UTC
Description of problem:

I'm attempting to backport 1.24 from Ubuntu Trusty to Ubuntu Saucy. The Trusty version (libguestfs_1.22.4-1ubuntu1) depends on 
 
Version-Release number of selected component (if applicable): 1.22.4 and 1.24.3


Steps to Reproduce:

(PPA build)
1. backportpackage -u ppa:$YOURPPA/ppa supermin
1. backportpackage -u ppa:$YOURPPA/ppa libguestfs

(Local build)
1. install backported supermin (eg https://launchpad.net/~danlipsitt/+archive/ppa/+files/supermin_4.1.6-1~ubuntu13.10.1~ppa1_i386.deb)
2. apt-get -t trusty source libguestfs
3. dpkg-buildpackage -rfakeroot -uc -b

Actual results:

Build fails Ruby tests as follows. Looks like the format of one of the structs has changed:

make[5]: Entering directory `/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/ruby/ext/guestfs'
gcc  -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/ruby/ext/guestfs -DRUBY_EXTCONF_H=\"extconf.h\" -I/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/ruby/../../../src -I/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/ruby/.. -D_FORTIFY_SOURCE=2 -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -c /build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/../../ruby/ext/guestfs/_guestfs.c
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/../../ruby/ext/guestfs/_guestfs.c: In function 'ruby_guestfs_internal_test':
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/../../ruby/ext/guestfs/_guestfs.c:444:10: error: variable 'optargs_s' has initializer but incomplete type
   struct guestfs_internal_test_argv optargs_s = { .bitmask = 0 };
          ^
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/../../ruby/ext/guestfs/_guestfs.c:444:10: error: unknown field 'bitmask' specified in initializer
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/../../ruby/ext/guestfs/_guestfs.c:444:10: warning: excess elements in struct initializer [enabled by default]
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/../../ruby/ext/guestfs/_guestfs.c:444:10: warning: (near initialization for 'optargs_s') [enabled by default]
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/../../ruby/ext/guestfs/_guestfs.c:444:37: error: storage size of 'optargs_s' isn't known
   struct guestfs_internal_test_argv optargs_s = { .bitmask = 0 };

[...]

make[5]: *** [_guestfs.o] Error 1
make[5]: Leaving directory `/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/ruby/ext/guestfs'
rake aborted!
Command failed with status (2): [make...]
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/ruby/Rakefile:63:in `block (2 levels) in <top (required)>'
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/ruby/Rakefile:62:in `chdir'
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/ruby/Rakefile:62:in `block in <top (required)>'
Tasks: TOP => test => build => ./ext/guestfs/_guestfs.so
(See full trace by running task with --trace)
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/run: command failed with exit code 1
FAIL: run-ruby-tests
===================
1 of 2 tests failed
===================
make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory `/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/ruby'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/ruby'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8'
dh_auto_test: make -j1 check CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat returned exit code 2
make[1]: *** [override_dh_auto_test] Error 2
make[1]: Leaving directory `/build/buildd/libguestfs-1.24.3'
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
******************************************************************************
Build finished at 20140110-0915
FAILED [dpkg-buildpackage died]
******************************************************************************

Expected results:

Successful build.

Additional info:

My PPA: https://launchpad.net/~danlipsitt/+archive/ppa/+packages

Build log: https://launchpadlibrarian.net/162098956/buildlog_ubuntu-saucy-i386.libguestfs_1%3A1.24.3-1build1~ubuntu13.10.1~ppa1_FAILEDTOBUILD.txt.gz

Comment 1 Richard W.M. Jones 2014-01-10 22:20:38 UTC
Looking at the error message, I don't think this has anything to do
with supermin.

The error is:

/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/../../ruby/ext/guestfs/_guestfs.c:444:10: error: variable 'optargs_s' has initializer but incomplete type
   struct guestfs_internal_test_argv optargs_s = { .bitmask = 0 };
          ^
/build/buildd/libguestfs-1.24.3/debian/build-ruby1.8/../../ruby/ext/guestfs/_guestfs.c:444:10: error: unknown field 'bitmask' specified in initializer

I don't quite understand this error at the moment.  Does
src/guestfs.h declare 'struct guestfs_internal_test_argv'
and does this struct have a bitmask field?

Comment 2 Daniel Lipsitt 2014-01-11 00:43:16 UTC
Yes, you could be right about supermin.

The struct you mention does exist and it does have a bitmask:

struct guestfs_internal_test_argv {
  uint64_t bitmask;
# define GUESTFS_INTERNAL_TEST_OBOOL_BITMASK (UINT64_C(1)<<0)
  int obool;
# define GUESTFS_INTERNAL_TEST_OINT_BITMASK (UINT64_C(1)<<1)
  int oint;
# define GUESTFS_INTERNAL_TEST_OINT64_BITMASK (UINT64_C(1)<<2)
  int64_t oint64;
# define GUESTFS_INTERNAL_TEST_OSTRING_BITMASK (UINT64_C(1)<<3)
  const char *ostring;
# define GUESTFS_INTERNAL_TEST_OSTRINGLIST_BITMASK (UINT64_C(1)<<4)
  char *const *ostringlist;
};

Comment 3 Daniel Lipsitt 2014-01-11 01:01:38 UTC
The struct is inside this macro, which could cause problems if it isn't set correctly:

#if GUESTFS_PRIVATE
/* Symbols protected by GUESTFS_PRIVATE are NOT part of the public,                                                                                                                                         
 * stable API, and can change at any time!  We export them because                                                                                                                                          
 * they are used by some of the language bindings.                                                                                                                                                          
 */

Comment 4 Richard W.M. Jones 2014-01-12 14:09:52 UTC
I think this is an actual build bug.  Not quite sure why I haven't
seen it before, since I do build regularly on Ubuntu but there we go.

What is supposed to happen is that -DGUESTFS_PRIVATE=1 is passed
through when compiling the ruby bindings.  This happens because

ruby/ext/guestfs/extconf.rb.in
  generates (by ./configure):
ruby/ext/guestfs/extconf.rb
  which creates
ruby/ext/guestfs/Makefile
  containing CFLAGS = ... -DGUESTFS_PRIVATE=1

Something along that chain isn't working on Ubuntu 13.10 and/or with
newer Ruby.

Comment 5 Richard W.M. Jones 2014-01-12 15:08:36 UTC
I'm trying to reproduce this on my Ubuntu 13.10 server.

Can I ask:

 - Are you running this on plain Ubuntu 13.10 (or did you update packages
   from upcoming Ubuntu betas, and if so which ones?)

 - What version of Ruby, rake, etc packages do you have installed?

Comment 6 Richard W.M. Jones 2014-01-12 15:29:37 UTC
The Debian build rebuilds libguestfs a number of times for every
version of ruby and python.

I will also note that the failure happens while building the
ruby1.8 version of libguestfs.

IIRC there is a way to change the versions of ruby/python that
libguestfs is built for in debian/control.  You might try changing
that so that it doesn't build against versions that you don't
care about.

Comment 7 Daniel Lipsitt 2014-01-17 20:30:01 UTC
It looks like I accidentally pulled in a bunch of packages from the current Ubuntu beta (14.04 Trusty), including Ruby. Here the installed versions:

ruby1.8                                         1.8.7.358-8ubuntu3              
ruby1.8-dev                                     1.8.7.358-8ubuntu3              
ruby1.9.1                                       1.9.3.484-1ubuntu2              
ruby1.9.1-dev                                   1.9.3.484-1ubuntu2              
rake                                            10.0.4-1   

Are there other packages you want to know about?

I don't care about the Ruby bindings myself, but I want to get the package officially backported, so it may be important that multiple versions work.

Comment 8 Richard W.M. Jones 2014-01-17 20:38:11 UTC
I'd suggest disabling the Ruby 1.8 bindings (see debian/control).
I don't think anyone cares about such an old version of Ruby and
it has been out of support upstream for > 6 months.

The alternative is to dig into why it's actually failing
(see comment 4).

Comment 9 Richard W.M. Jones 2014-01-17 20:40:15 UTC
You could also try asking Hilko Bengen who is the *Debian* packager.

Comment 10 Daniel Lipsitt 2014-01-18 00:20:09 UTC
Created attachment 851887 [details]
An attempt to disable build of ruby 1.8 bindings in debian control file

Comment 11 Daniel Lipsitt 2014-01-18 00:24:48 UTC
With the patch above, I get the following failure:

make[1]: Entering directory `/home/vagrant/libguestfs/libguestfs-saucy'
mkdir -p debian/tmp/usr/lib/guestfs/supermin.d
install -m755 debian/build-default/appliance/make.sh \
		debian/tmp/usr/lib/guestfs
install -m644 debian/build-default/appliance/*list \
		debian/tmp/usr/lib/guestfs
install -m644 \
		debian/build-default/appliance/supermin.d/*.img* \
		debian/tmp/usr/lib/guestfs/supermin.d/
erlang-depends -perlang-guestfs
dh_install -X.la -X.so.owner -Xbindtests -X/usr/lib/go/ \
		--fail-missing
dh_install: ruby-guestfs missing files (usr/lib/*-*/ruby), aborting
make[1]: *** [override_dh_install] Error 2
make[1]: Leaving directory `/home/vagrant/libguestfs/libguestfs-saucy'
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

Comment 12 Daniel Lipsitt 2014-01-18 00:29:36 UTC
Do any of the libguestfs tools depend on ruby bindings? I'm most interested in virt-builder and guestfish. If not, I'll probably switch to disabling the ruby build entirely and see if I can grab Hilko Bengen's attention while I focus on the rest of the build.

Comment 13 Richard W.M. Jones 2014-01-18 07:35:16 UTC
(In reply to Daniel Lipsitt from comment #12)
> Do any of the libguestfs tools depend on ruby bindings? I'm most interested
> in virt-builder and guestfish. If not, I'll probably switch to disabling the
> ruby build entirely and see if I can grab Hilko Bengen's attention while I
> focus on the rest of the build.

No, you can safely disable Ruby bindings completely.

The older tools in the tools/ directory depend on the Perl bindings.

virt-builder, virt-sysprep, virt-resize and virt-sparsify depend
on the OCaml bindings.

guestfish and all the other virt-* tools only need C.

Comment 14 Richard W.M. Jones 2014-01-18 07:35:54 UTC
To do that, use:

./configure --disable-ruby

Comment 15 Daniel Lipsitt 2014-01-21 00:56:48 UTC
Hilko points out Debian bug 735756, which appears to be the same error and is fixed in 1:1.24.4-1.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735756

I'm attempting to get it imported, but am running into some trouble (https://bugs.launchpad.net/udd/+bug/1270991). I'll keep you posted.

Comment 16 Daniel Lipsitt 2014-01-21 02:42:47 UTC
Still trying to build a plain backport (which defaults to building ruby bindings). Now I get this error:

dh_install -X.la -X.so.owner -Xbindtests -X/usr/lib/go/ \
		--fail-missing
dh_install: ruby-guestfs missing files (usr/lib/*-*/ruby), aborting
make[1]: *** [override_dh_install] Error 2
make[1]: Leaving directory `/build/buildd/libguestfs-1.24.4'
make: *** [binary] Error 2
dpkg-buildpackage: error: /usr/bin/fakeroot debian/rules binary gave error exit status 2

Comment 17 Richard W.M. Jones 2014-01-21 08:53:28 UTC
It looks as if the files are getting installed in
/usr/lib/ruby/vendor_ruby/<rubyversion>/<arch>-linux

This path is chosen by evaluating:

$ruby -rrbconfig -e "puts RbConfig::CONFIG['vendorlibdir']"

$ruby -rrbconfig -e "puts RbConfig::CONFIG['vendorarchdir']"

where $ruby is the particular ruby binary, eg. ruby1.8.

Thus no file will match /usr/lib/ruby/*-*

Comment 18 Pino Toscano 2016-05-09 09:39:47 UTC
Ubuntu Saucy is no more supported upstream at this point; libguestfs builds fine on Ubuntu Trusty (the second LTS currently), which has Ruby 1.9.x.

My bet the issue was to the mix of Saucy and Trusty packages (older Ruby 1.8 with newer rake, maybe?).

Anyway, the problem does not happen with newer versions of libguestfs and/or Ruby and/or Ubuntu, so closing.  If you can reproduce it again, please reopen with updated details.


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