FS#49080 - [dkms] module build error from dkms not reported (status code 0)

Attached to Project: Arch Linux
Opened by Alexei Colin (alexei) - Monday, 25 April 2016, 19:03 GMT
Last edited by Sébastien Luttringer (seblu) - Wednesday, 06 July 2016, 21:42 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
Installing packaged kernel module that does not build (for example, currently, openafs-modules-dkms in AUR on 4.5) does not report the build error, nor does pacman exit with a non-zero exit code. The current behavior from pacman is as if module install succeeded. This is not a major issue, but could be more helpful to the user.

The 'dkms -q' command silences not just the build output but also the build error (which is printed without the -q). This is unfortunate, but at least dkms exits with non-zero error code (10) if the build fails. Pacman, however, exists with error code 0, even if dkms exited with a non-zero error code.

Expected behavior: when dkms exits with non-zero code, pacman also exits with non-zero error code. Also, ideally pacman prints a generic error message that 'dkms' invocation failed.

Additional info:
* package version(s): pacman 5.0.1-2

Steps to reproduce:
1. Install openafs-modules-dkms from AUR via yaourt or manually via pacman on Linux kernel 4.5
2. Let dkms attempt to build the modules as part of the installation.
3. Check the error code from pacman: it is 0, but build failed (see log in /var/lib/dkms or manually invoke the same dkms command and 'echo $?' to see '10').
This task depends upon

Closed by  Sébastien Luttringer (seblu)
Wednesday, 06 July 2016, 21:42 GMT
Reason for closing:  Fixed
Comment by Doug Newgard (Scimmia) - Wednesday, 27 April 2016, 15:55 GMT
Is there no indication at all that the build failed? If so, that's an issue with the dkms hook, not with pacman.
Comment by Alexei Colin (alexei) - Wednesday, 27 April 2016, 17:43 GMT
There is no indication of failure. Ok, how should this ticket be redirected? Which package does the relevant dkms hook live in? (sorry, didn't manage to track it down quickly enough)
Comment by Kevin Brodsky (Corax) - Thursday, 26 May 2016, 23:48 GMT
The source of the problem is /usr/lib/dkms/alpm-hook in the dkms package (do_module/do_kernel functions).

See https://bugs.archlinux.org/task/49468 for how I think this should be fixed.
Comment by Gordian Edenhofer (Edenhofer) - Monday, 20 June 2016, 17:39 GMT
This can be really confusing to not get notified. A red box in case the return code was not zero should be sufficient.
Comment by Kevin Brodsky (Corax) - Monday, 20 June 2016, 21:48 GMT
It is... I kind of forgot about it but this needs to be fixed, anyone on this?
Comment by Sébastien Luttringer (seblu) - Monday, 20 June 2016, 22:38 GMT
should be fixed in dkms-2.2.0.3+git151023-11
Comment by Gordian Edenhofer (Edenhofer) - Tuesday, 21 June 2016, 06:54 GMT
Thanks a lot!
Comment by Kevin Brodsky (Corax) - Tuesday, 21 June 2016, 20:26 GMT
Great, that's an even better solution than what I proposed! In fact I'm starting to think that it's really a problem in dkms, there should be a way to silence the normal output without silencing error messages... I'll open a ticket upstream.
Comment by Kevin Brodsky (Corax) - Wednesday, 22 June 2016, 23:28 GMT
In case anyone is interested, I opened a ticket upstream: https://github.com/dell-oss/dkms/issues/3
Comment by Sébastien Luttringer (seblu) - Wednesday, 06 July 2016, 21:41 GMT
I remember why I disabled the output of dkms:  FS#49816 

Loading...