DKMS module fails to build if CC env-var set but not OK (=> "sudo -H"?)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dkms (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
Binary package hint: dkms
When the CC environment variable is set, dkms may fail to build. In my case, apparently because the CC is not readable to user "nobody" (it points to a ccache-using script).
DKMS should reset environment variables such as CC or CXX. This is important for Ubuntu, where stuff is usually run with sudo, which does not reset env-vars.
This bug causes for example Nvidia's display driver updates to always fail, which will be noticed only on next boot (when gdm enters an infinite respawn loop, cf. #431166).
Also, why is the package upgrade not marked as failed if dkms fails to build the module?
Output on failed package upgrade:
---------------
Configuring: nvidia-
Removing all DKMS Modules
Done.
Adding Module to DKMS build system
driver version= 185.18.36
Doing initial module build
Error! Bad return status for module build on kernel: 2.6.31-11-generic (i686)
Consult the make.log in the build directory
/var/lib/
Installing initial module
Error! Could not locate nvidia.ko for module nvidia in the DKMS tree.
You must run a dkms build for kernel 2.6.31-11-generic (i686) first.
Done.
---------------
The make.log reports:
---------------
DKMS make.log for nvidia-185.18.36 for kernel 2.6.31-11-generic (i686)
ti 29.9.2009 00.03.29 +0300
The C compiler '/home/
create executables. Please make sure you have
your Linux distribution's libc development package
installed and that '/home/
name.
*** Failed CC sanity check. Bailing out! ***
make: *** [select_makefile] Virhe 1
---------------
ProblemType: Bug
Architecture: i386
Date: Tue Sep 29 00:07:11 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelMo
Package: dkms 2.1.0.1-0ubuntu1
PackageArchitec
ProcEnviron:
LANGUAGE=
PATH=(custom, no user)
LANG=fi_FI.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: dkms
Uname: Linux 2.6.31-11-generic i686
Related branches
Changed in dkms (Ubuntu): | |
status: | Triaged → Fix Committed |
I'm a bit perplexed how you hit this. By default sudo *does not* pass the environment variables around.
supermario@ mlimonciello: ~$ export CC=blah mlimonciello: ~$ export | grep CC mlimonciello: ~$ sudo -s lo:~# export | grep CC lo:~#
supermario@
declare -x CC="blah"
supermario@
root@mlimonciel
root@mlimonciel