unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#63517] Fixing lcov usage?
@ 2023-05-15 12:10 Luca Cirrottola
  2023-05-22 15:29 ` bug#63517: " Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Luca Cirrottola @ 2023-05-15 12:10 UTC (permalink / raw)
  To: 63517


[-- Attachment #1.1: Type: text/plain, Size: 1749 bytes --]

Hello, 
I want use lcov to generate a coverage report for a C program, but I find out I always need to add "findutils" package to my shell in order for "lcov" to work. Shouldn't "findutils" be added to the propagated-inputs of "lcov", to have it available at runtime? 

Here is a short description of the problem which can be tested on the attached (empty) C program "main.c". 

1. The shell I want to use: 

guix shell -C gcc-toolchain lcov 

2. The commands I run in the shell: 

gcc -fprofile-arcs -ftest-coverage -g -O0 -c main.c 
gcc -fprofile-arcs -ftest-coverage -g -O0 -lgcov main.o -o my_program 
./my_program 
lcov --directory . --capture --output-file coverage.info 

3. The problem I get: lcov is unable to find the .gcda files for its coverage report (message ".geninfo-real: WARNING: no .gcda files found in . - skipping!"). 

Everything works fine with "guix shell -C gcc-toolchain lcov findutils", or if I add "findutils" to the propagated-inputs of "lcov" as in the proposed patch (for the commit 13e252af79ffb85bc68d8104fdf700269b903875 on master), which I have tested by defining and building the modified package in a local copy of the gnu/packages/code.scm module. 

Of coarse I am open to recognize my errors if I have missed something in the package usage :-) or if I have misunderstood the usage of propagated-inputs (but it didn't work with findutils as "normal" input)... or if there are better solutions. 

Thank you in advance, 
Luca 

-- 
Luca CIRROTTOLA 
Research software engineer @ INRIA - research center of the university of Bordeaux and Pau 
Personal webpage: [ https://lcirrottola.github.io/ | https://lcirrottola.github.io/ ] 
Tel: +33 5 2 4 57 41 21 
200 Avenue de la Vieille Tour 
33405 Talence cedex 
France 

[-- Attachment #1.2: Type: text/html, Size: 3184 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: main.c --]
[-- Type: text/x-c++src; name=main.c, Size: 51 bytes --]

int main( int argc, char* argv[] ) {
  return 0;
}

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: log_patch_13e252af79_lcov --]
[-- Type: text/x-patch; name=log_patch_13e252af79_lcov, Size: 575 bytes --]

diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
index d57954c47c..2b1d221122 100644
--- a/gnu/packages/code.scm
+++ b/gnu/packages/code.scm
@@ -580,6 +580,7 @@ stack traces.")
                  `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB")))))
              #t)))))
     (inputs (list perl perl-io-compress perl-json))
+    (propagated-inputs (list findutils))
     (home-page "https://ltp.sourceforge.net/coverage/lcov.php")
     (synopsis "Code coverage tool that enhances GNU gcov")
     (description "LCOV is an extension of @command{gcov}, a tool part of the

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#63517: Fixing lcov usage?
  2023-05-15 12:10 [bug#63517] Fixing lcov usage? Luca Cirrottola
@ 2023-05-22 15:29 ` Ludovic Courtès
  2023-05-24 12:36   ` [bug#63517] " Luca Cirrottola
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2023-05-22 15:29 UTC (permalink / raw)
  To: Luca Cirrottola; +Cc: 63517-done

Hi Luca,

Luca Cirrottola <luca.cirrottola@inria.fr> skribis:

> I want use lcov to generate a coverage report for a C program, but I find out I always need to add "findutils" package to my shell in order for "lcov" to work. Shouldn't "findutils" be added to the propagated-inputs of "lcov", to have it available at runtime? 

I took a slightly less intrusive approach:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=88a2871d8f82a7280486c2a30cc9b510ee8b2b5c

Thanks for the bug report & proposal!

Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#63517] Fixing lcov usage?
  2023-05-22 15:29 ` bug#63517: " Ludovic Courtès
@ 2023-05-24 12:36   ` Luca Cirrottola
  0 siblings, 0 replies; 3+ messages in thread
From: Luca Cirrottola @ 2023-05-24 12:36 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 63517-done

Hello Ludo',
I could have bet there was a more elegant solution :-)
It works like a charm, thanks!

Luca

----- Mail original -----
> De: "Ludovic Courtès" <ludovic.courtes@inria.fr>
> À: "Luca Cirrottola" <luca.cirrottola@inria.fr>
> Cc: 63517-done@debbugs.gnu.org
> Envoyé: Lundi 22 Mai 2023 17:29:19
> Objet: Re: bug#63517: Fixing lcov usage?

> Hi Luca,
> 
> Luca Cirrottola <luca.cirrottola@inria.fr> skribis:
> 
>> I want use lcov to generate a coverage report for a C program, but I find out I
>> always need to add "findutils" package to my shell in order for "lcov" to work.
>> Shouldn't "findutils" be added to the propagated-inputs of "lcov", to have it
>> available at runtime?
> 
> I took a slightly less intrusive approach:
> 
>  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=88a2871d8f82a7280486c2a30cc9b510ee8b2b5c
> 
> Thanks for the bug report & proposal!
> 
> Ludo’.

-- 
Luca CIRROTTOLA 
Research software engineer @ INRIA - research center of the university of Bordeaux and Pau 
Personal webpage: [ https://lcirrottola.github.io/ | https://lcirrottola.github.io/ ] 
Tel: +33 5 2 4 57 41 21 
200 Avenue de la Vieille Tour 
33405 Talence cedex 
France




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-24 12:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-15 12:10 [bug#63517] Fixing lcov usage? Luca Cirrottola
2023-05-22 15:29 ` bug#63517: " Ludovic Courtès
2023-05-24 12:36   ` [bug#63517] " Luca Cirrottola

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).