Control: tag -1 + confirmed
Control: severity -1 minor

On Mon, 30 May 2022 18:35:57 -0300, Jesse Smith wrote:

> > when I install the cpulimit package in testing, version 2.7 downloads.
> > But when it is run, cpulimit itself shows, that it is actually version
> > 2.4. Aren't these two supposed to match?
> > 
> Yes, they should match. Upstream, the cpulimit executable displays the
> correct (2.7) version number when it is run:
> 
> $ cpulimit
> CPUlimit version 2.7
> Usage: ./cpulimit TARGET [OPTIONS...] [-- PROGRAM]

Thanks Radim for the bug report, and thank Jesse for the quick reply.

Interestingly I can confirm this behaviour here on Debian/unstable
with the same cpulimit version as in testing (2.7-2):

% /usr/bin/cpulimit
Error: You must specify a target process
CPUlimit version 2.4
Usage: /usr/bin/cpulimit TARGET [OPTIONS...] [-- PROGRAM]


Now where does this 2.4 come from?

% grep -r 2\\.4
cpulimit.c:#define VERSION 2.4
…

And how/where is VERSION used?

% grep -r VERSION
cpulimit.c:#ifndef VERSION
cpulimit.c:#define VERSION 2.4
cpulimit.c:        fprintf(stream, "CPUlimit version %1.1f\n", VERSION);
…
Makefile:VERSION?=2.7
Makefile:CFLAGS?=-Wall -O2 -DVERSION=$(VERSION)
Makefile:       cd .. && tar czf cpulimit-$(VERSION).tar.gz --exclude=.svn 
cpulimit-$(VERSION) 


I think what is happening here is that CFLAGS is not taken from the
Makefile but overridden from the Debian build machinery, so -DVERSION
(which would be 2.7) is not set/defined and VERSION is taken from
cpulimit.c and that still says 2.4.


I guess maintaining a variable in two places can easily lead to this
mismatch, and that the build process in Debian is slightly different
doesn't help.


I assume fixing this in a future upstream release is enough …


Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-   

Attachment: signature.asc
Description: Digital Signature

Reply via email to