[gentoo-commits] repo/gentoo:master commit in: dev-util/lcov/files/, dev-util/lcov/

2024-01-25 Thread Sam James
commit: 3a2c07fded0773596b896b5ba59cfd7459f36af1
Author: Jeremy Bettis  google  com>
AuthorDate: Thu Jan 18 20:00:50 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Jan 25 13:42:31 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a2c07fd

dev-util/lcov: Add patch to fix bad error code var

There is a mistake in the lcov code for inconsistent line numbers, the
ignorable error code is an undefined variable. This causes errors like
genhtml: ERROR: "/mnt/host/source/src/platform/ec/common/vboot/vb21_lib.c":18: 
function 'vb21_is_packed_key
_valid last line is 24 but is 25 in testcase 'vboot'
(use "genhtml --ignore-errors code_ ..." to bypass this error)

Switch to the correct variable that was fixed in
https://github.com/linux-test-project/lcov/commit/6f48bf214a06fe09c9708b130a233280c691a7a0#diff-173ac1b8ad02cbcecdc47f8c7fa7762bbcc7050d0efa6a375ffb74eb1517f68cL5342
but not included in the 2.0 release.

Signed-off-by: Jeremy Bettis  google.com>
Closes: https://github.com/gentoo/gentoo/pull/34888
Signed-off-by: Sam James  gentoo.org>

 .../lcov/files/lcov-2.0-wrong-error-code.patch | 18 +
 dev-util/lcov/lcov-2.0-r2.ebuild   | 89 ++
 2 files changed, 107 insertions(+)

diff --git a/dev-util/lcov/files/lcov-2.0-wrong-error-code.patch 
b/dev-util/lcov/files/lcov-2.0-wrong-error-code.patch
new file mode 100644
index ..669308d157d3
--- /dev/null
+++ b/dev-util/lcov/files/lcov-2.0-wrong-error-code.patch
@@ -0,0 +1,18 @@
+From: Jeremy Bettis 
+
+Fix incorrect error code usage.
+
+Bug: https://github.com/linux-test-project/lcov/issues/259
+Signed-off-by: Jeremy Bettis 
+
+--- lcov-2.0/lib/lcovutil.pm
 lcov-2.0-fixed/lib/lcovutil.pm
+@@ -4219,7 +4219,7 @@
+ } else {
+ if ($f->end_line() != $func->end_line()) {
+ lcovutil::ignorable_error(
+-   $lcovutil::ERROR_INCONSISTENT,
++   $lcovutil::ERROR_INCONSISTENT_DATA,
+'"' . $func->file() .
+'":' . $first . ': function \'' .
+$func->name() . ' last line is ' .

diff --git a/dev-util/lcov/lcov-2.0-r2.ebuild b/dev-util/lcov/lcov-2.0-r2.ebuild
new file mode 100644
index ..a55e751b194d
--- /dev/null
+++ b/dev-util/lcov/lcov-2.0-r2.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit optfeature prefix python-any-r1
+
+DESCRIPTION="A graphical front-end for GCC's coverage testing tool gcov"
+HOMEPAGE="https://github.com/linux-test-project/lcov;
+
+if [[ ${PV} ==  ]] ; then
+   EGIT_REPO_URI="https://github.com/linux-test-project/lcov.git;
+   inherit git-r3
+else
+   
SRC_URI="https://github.com/linux-test-project/lcov/releases/download/v${PV}/${P}.tar.gz;
+   KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc 
~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux ~x64-macos"
+fi
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+# Python is used for spreadsheet.py
+RDEPEND="
+   dev-lang/perl
+   dev-perl/Capture-Tiny
+   dev-perl/DateTime
+   || (
+   dev-perl/JSON-XS
+   dev-perl/Cpanel-JSON-XS
+   virtual/perl-JSON-PP
+   dev-perl/JSON
+   )
+   dev-perl/PerlIO-gzip
+"
+BDEPEND="
+   test? (
+   ${RDEPEND}
+   dev-perl/GD
+   $(python_gen_any_dep '
+   dev-python/xlsxwriter[${PYTHON_USEDEP}]
+   ')
+   )
+"
+
+PATCHES=(
+   "${FILESDIR}"/${P}-wrong-error-code.patch
+)
+
+python_check_deps() {
+   python_has_version "dev-python/xlsxwriter[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+   use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+   default
+   if use prefix; then
+   hprefixify bin/*.{pl,sh}
+   fi
+}
+
+src_compile() { :; }
+
+src_test() {
+   emake -j1 check
+}
+
+src_install() {
+   emake -j1 \
+   DESTDIR="${D}" \
+   CFG_DIR="${EPREFIX}/etc" \
+   PREFIX="${EPREFIX}/usr" \
+   LCOV_PERL_PATH="${EPREFIX}/usr/bin/perl" \
+   install
+}
+
+pkg_postinst() {
+   optfeature_header "Optional outuput support:"
+   optfeature "png output support" dev-perl/GD[png]
+   optfeature "spreadsheet output support" dev-python/xlsxwriter
+   optfeature_header "Optional language support:"
+   optfeature "Python code coverage support" dev-python/coverage
+   optfeature "Perl code coverage support" dev-perl/Devel-Cover
+}



[gentoo-commits] repo/gentoo:master commit in: dev-util/lcov/files/

2021-03-22 Thread Joonas Niilola
commit: 48250a8c5ca66d2fea1da96cac93e9e541e9aeb2
Author: Michael Mair-Keimberger  levelnine  at>
AuthorDate: Sun Mar 21 12:39:58 2021 +
Commit: Joonas Niilola  gentoo  org>
CommitDate: Mon Mar 22 14:04:28 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48250a8c

dev-util/lcov: remove unused patch(es)

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Michael Mair-Keimberger  levelnine.at>
Closes: https://github.com/gentoo/gentoo/pull/20033
Signed-off-by: Joonas Niilola  gentoo.org>

 dev-util/lcov/files/lcov-1.13-gcc-8.patch | 91 ---
 1 file changed, 91 deletions(-)

diff --git a/dev-util/lcov/files/lcov-1.13-gcc-8.patch 
b/dev-util/lcov/files/lcov-1.13-gcc-8.patch
deleted file mode 100644
index b67ca411bda..000
--- a/dev-util/lcov/files/lcov-1.13-gcc-8.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From a5dd9529f9232b8d901a4d6eb9ae54cae179e5b3 Mon Sep 17 00:00:00 2001
-From: Peter Oberparleiter 
-Date: Wed, 7 Mar 2018 14:18:55 +0100
-Subject: [PATCH] geninfo: Add gcc 8 support
-
-Fix errors and incorrect data when trying to collect coverage data
-for programs compiled with gcc 8.
-
-Covers the following gcov-related changes in gcc:
-
-.gcov-file format:
-  - Line coverage data can appear multiple times for the same line
-  - Line coverage count can be suffixed by '*' to indicated unexecuted
-basic blocks in that line
-
-.gcno-file format:
-  - new header field 'support unexecuted blocks flag'
-  - new function record fields 'column number', 'ending line number',
-and 'compiler-generated entity flag'
-
-Signed-off-by: Peter Oberparleiter 

- bin/geninfo | 20 
- 1 file changed, 20 insertions(+)
-
-diff --git a/bin/geninfo b/bin/geninfo
-index 8562560..ef6a818 100755
 a/bin/geninfo
-+++ b/bin/geninfo
-@@ -68,6 +68,7 @@ our $lcov_url= 
"http://ltp.sourceforge.net/coverage/lcov.php;;
- our $gcov_tool= "gcov";
- our $tool_name= basename($0);
-
-+our $GCOV_VERSION_8_0_0   = 0x8;
- our $GCOV_VERSION_4_7_0   = 0x40700;
- our $GCOV_VERSION_3_4_0   = 0x30400;
- our $GCOV_VERSION_3_3_0   = 0x30300;
-@@ -1934,6 +1935,9 @@ sub read_gcov_file($)
-   {
-   my ($count, $line, $code) = ($1, $2, $3);
-
-+  # Skip instance-specific counts
-+  next if ($line == $last_line);
-+
-   $last_line = $line;
-   $last_block = $UNNAMED_BLOCK;
-   # Check for exclusion markers
-@@ -1963,6 +1967,9 @@ sub read_gcov_file($)
-   }
-   }
-
-+  # Strip unexecuted basic block marker
-+  $count =~ s/\*$//;
-+
-   # ::
-   if ($line eq "0")
-   {
-@@ -3537,6 +3544,10 @@ sub read_gcno_function_record(*$)
-   graph_expect("function name");
-   $function = read_gcno_string($handle, $big_endian);
-   return undef if (!defined($function));
-+  if ($version >= $GCOV_VERSION_8_0_0) {
-+  graph_skip($handle, 4, "compiler-generated entity flag")
-+  or return undef;
-+  }
-   # Read filename
-   graph_expect("filename");
-   $filename = read_gcno_string($handle, $big_endian);
-@@ -3544,6 +3555,11 @@ sub read_gcno_function_record(*$)
-   # Read first line number
-   $lineno = read_gcno_value($handle, $big_endian, "initial line number");
-   return undef if (!defined($lineno));
-+  # Skip column and ending line number
-+  if ($version >= $GCOV_VERSION_8_0_0) {
-+  graph_skip($handle, 4, "column number") or return undef;
-+  graph_skip($handle, 4, "ending line number") or return undef;
-+  }
-   # Add to list
-   push(@{$bb->{$function}->{$filename}}, $lineno);
-   graph_add_order($fileorder, $function, $filename);
-@@ -3631,6 +3647,10 @@ sub read_gcno($)
-   debug(sprintf("found version 0x%08x\n", $version));
-   # Skip stamp
-   graph_skip(*HANDLE, 4, "file timestamp") or goto incomplete;
-+  if ($version >= $GCOV_VERSION_8_0_0) {
-+  graph_skip(*HANDLE, 4, "support unexecuted blocks flag")
-+  or goto incomplete;
-+  }
-   while (!eof(HANDLE)) {
-   my $next_pos;
-   my $curr_pos;



[gentoo-commits] repo/gentoo:master commit in: dev-util/lcov/files/

2019-11-18 Thread Aaron Bauman
commit: 65be439d3c9e151727ad05c7a13502536940120c
Author: Michael Mair-Keimberger  gmail  com>
AuthorDate: Mon Nov 18 10:35:34 2019 +
Commit: Aaron Bauman  gentoo  org>
CommitDate: Mon Nov 18 22:15:43 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65be439d

dev-util/lcov: remove unused patch

Signed-off-by: Michael Mair-Keimberger  gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/13695
Signed-off-by: Aaron Bauman  gentoo.org>

 dev-util/lcov/files/lcov-1.9-gcc-4.7.patch | 29 -
 1 file changed, 29 deletions(-)

diff --git a/dev-util/lcov/files/lcov-1.9-gcc-4.7.patch 
b/dev-util/lcov/files/lcov-1.9-gcc-4.7.patch
deleted file mode 100644
index 1b9d6ac0ff2..000
--- a/dev-util/lcov/files/lcov-1.9-gcc-4.7.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-fix from upstream to work with gcc-4.7
-
-Index: bin/geninfo
-===
-RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v
-retrieving revision 1.95
-retrieving revision 1.96
-diff -u -p -r1.95 -r1.96
 bin/geninfo20 Jan 2012 11:53:57 -  1.95
-+++ bin/geninfo10 Apr 2012 11:48:52 -  1.96
-@@ -61,6 +61,7 @@ if( $^O eq "msys" )
- our $gcov_tool= "gcov";
- our $tool_name= basename($0);
- 
-+our $GCOV_VERSION_4_7_0   = 0x40700;
- our $GCOV_VERSION_3_4_0   = 0x30400;
- our $GCOV_VERSION_3_3_0   = 0x30300;
- our $GCNO_FUNCTION_TAG= 0x0100;
-@@ -3023,5 +3024,10 @@ sub read_gcno_function_record(*)
-   graph_expect("function record");
-   # Skip ident and checksum
-   graph_skip($handle, 8, "function ident and checksum") or return undef;
-+  if ($gcov_version >= $GCOV_VERSION_4_7_0) {
-+  # Skip extra checksum added by android 4.4.0 / gcc >= 4.7
-+  # toolchains.
-+  graph_skip($handle, 4, "function extra checksum");
-+  }
-   # Read function name
-   graph_expect("function name");