zfsonlinux / pkg-zfs

Native ZFS packaging for Debian and Ubuntu
https://launchpad.net/~zfs-native/+archive/daily
308 stars 55 forks source link

g++ missing dependency on Ubuntu trusty (14.04.01) #129

Closed fabrica64 closed 9 years ago

fabrica64 commented 9 years ago

Installing ubuntu-zfs on trusty server (14.04.01) with commands: add-apt-repository ppa:zfs-native/stable aptitude (installing ubuntu-zfs and dependencies)

Cannot build zfs and spl kernel modules, logs: ... Setting up dkms (2.2.0.3-1.1ubuntu5+zfs9~trusty) ... Setting up spl-dkms (0.6.3-1~trusty) ... Loading new spl-0.6.3 DKMS files... First Installation: checking all kernels... Building only for 3.13.0-39-generic Building initial module for 3.13.0-39-generic configure: error: in /var/lib/dkms/spl/0.6.3/build': configure: error: C compiler cannot create executables Seeconfig.log' for more details Error! Bad return status for module build on kernel: 3.13.0-39-generic (x86_64) Consult /var/lib/dkms/spl/0.6.3/build/make.log for more information. ... Setting up zfs-dkms (0.6.3-3~trusty) ... Loading new zfs-0.6.3 DKMS files... First Installation: checking all kernels... Building only for 3.13.0-39-generic Building initial module for 3.13.0-39-generic configure: error: in /var/lib/dkms/zfs/0.6.3/build': configure: error: C compiler cannot create executables Seeconfig.log' for more details Error! Bad return status for module build on kernel: 3.13.0-39-generic (x86_64) Consult /var/lib/dkms/zfs/0.6.3/build/make.log for more information. ...

Installed g++ (apt-get install g++) and can compile kernel modules without problems

dajhorn commented 9 years ago

@fabrica64, please post the log files from /var/lib/dkms/zfs/0.6.3 and the output of dpkg --get-selections to http://gist.github.com/.

fabrica64 commented 9 years ago

Sorry... I was in a hurry yesterday and I had no time to rollback and reproduce the error

These are the logs from a test system I installed today (Ubuntu 14.04.1) https://gist.github.com/fabrica64/50c3e903fbbe7b93e54f

It seems that the C compiler is not able to access the libc...

fabrica64 commented 9 years ago

I guess I found why I get the error, and it's a Ubuntu packages error. I have unset the aptitude "Install the recommended packages automatically" option. The gcc package does not have a dependency on libc6-dev, it's only in the recommended packages list, so it is not installed when ubuntu-zfs installs gcc package. The g++ package depends on libc6-dev, so it resolve the issue.

dajhorn commented 9 years ago

@fabrica64, thanks for reporting why this glitch happened. Some of those dependencies are loose so that you can more easily do things like replacing GCC with the Intel compiler suite.

dajhorn commented 9 years ago

I'm closing this ticket because the reported issue happens by design according to distro policy. The baseline supported system configuration is the ubuntu-minimal package with default installation rules.

dasjoe commented 9 years ago

@dajhorn would adding build-essential to Pre-Depends help?

dajhorn commented 9 years ago

@dasjoe, no, because a hard dependency here would violate system policy and break some known deployment cases. Any system configuration that intentionally overrides the default Ubuntu dependency graph or accidentally mangles an ubuntu-minimal bootstrap is unsupported.

If this is a recurring problem for a cloud deployment, then use the equivs utility to create an ubuntu-zfs-local package that depends on ubuntu-zfs and build-essential and bake it into the deployment image. The apt pinning facility can do the same thing with a single configuration file, but is easier to integrate into the vanilla images that places like AWS or Azure provide.

dasjoe commented 9 years ago

@dajhorn you are right, 4.2 Package relationships clearly states you don't need to depend on build-essentials. Anyway, I've seen people run into this issue, I would consider adding a hint about build-essential being, well, essential to the PPA description.