diff --git a/pkgs/development/interpreters/guile/1.9.nix b/pkgs/development/interpreters/guile/1.9.nix index 75ec27e18ea5..0290567c1fff 100644 --- a/pkgs/development/interpreters/guile/1.9.nix +++ b/pkgs/development/interpreters/guile/1.9.nix @@ -1,7 +1,12 @@ { fetchurl, stdenv, libtool, readline, gmp, pkgconfig, boehmgc, libunistring -, gawk, makeWrapper }: +, gawk, makeWrapper, coverageAnalysis ? null }: -stdenv.mkDerivation rec { +# Do either a coverage analysis build or a standard build. +(if coverageAnalysis != null + then coverageAnalysis + else stdenv.mkDerivation) + +rec { name = "guile-1.9.4"; # This is an alpha release! src = fetchurl { url = "ftp://alpha.gnu.org/gnu/guile/${name}.tar.gz"; @@ -11,6 +16,10 @@ stdenv.mkDerivation rec { buildInputs = [ makeWrapper gawk readline libtool libunistring pkgconfig ]; propagatedBuildInputs = [ gmp boehmgc ]; + patches = + stdenv.lib.optionals (coverageAnalysis != null) + [ ./gcov-file-name.patch ./disable-gc-sensitive-tests.patch ]; + postInstall = '' wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" diff --git a/pkgs/development/interpreters/guile/disable-gc-sensitive-tests.patch b/pkgs/development/interpreters/guile/disable-gc-sensitive-tests.patch new file mode 100644 index 000000000000..8a43e58f5f58 --- /dev/null +++ b/pkgs/development/interpreters/guile/disable-gc-sensitive-tests.patch @@ -0,0 +1,15 @@ +This patch disable GC-sensitive tests. This is particularly useful when +compiling with `-O0' (as is done with coverage analysis) since there may +be many false references held on the stack, leading to the failure of +such tests. + +--- a/test-suite/tests/threads.test ++++ b/test-suite/tests/threads.test +@@ -366,6 +366,7 @@ + (not (mutex-owner m)))) + + (pass-if "mutex with owner not retained (bug #27450)" ++ (throw 'unresolved) + (let ((g (make-guardian))) + (g (let ((m (make-mutex))) (lock-mutex m) m)) + diff --git a/pkgs/development/interpreters/guile/gcov-file-name.patch b/pkgs/development/interpreters/guile/gcov-file-name.patch new file mode 100644 index 000000000000..f144296170ed --- /dev/null +++ b/pkgs/development/interpreters/guile/gcov-file-name.patch @@ -0,0 +1,42 @@ +This patch arranges so that we don't end up, with profiling builds, with a +file named `.gcov' since that confuses lcov: + + :cannot open source file + geninfo: ERROR: cannot read .gcov! + +--- guile/libguile/c-tokenize.c 2009-09-13 13:05:15.000000000 +0200 ++++ guile/libguile/c-tokenize.c 2009-10-28 16:24:15.000000000 +0100 +@@ -1,5 +1,5 @@ + +-#line 3 "" ++#line 3 "c-tokenize.c" + + #define YY_INT_ALIGNED short int + +@@ -616,7 +616,7 @@ int cookie_was_last = 0; + #define IS_COOKIE cookie_was_last = 1 + #define IS_NOT_COOKIE cookie_was_last = 0 + +-#line 620 "" ++#line 620 "c-tokenize.c" + + #define INITIAL 0 + +@@ -799,7 +799,7 @@ YY_DECL + #line 65 "./c-tokenize.lex" + + +-#line 803 "" ++#line 803 "c-tokenize.c" + + if ( !(yy_init) ) + { +@@ -1235,7 +1235,7 @@ YY_RULE_SETUP + #line 181 "./c-tokenize.lex" + ECHO; + YY_BREAK +-#line 1239 "" ++#line 1239 "c-tokenize.c" + case YY_STATE_EOF(INITIAL): + yyterminate(); + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d68d8be36a8c..1967252199fb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2333,6 +2333,12 @@ let libunistring pkgconfig boehmgc; }; + guile_1_9_coverage = import ../development/interpreters/guile/1.9.nix { + inherit fetchurl stdenv readline libtool gmp gawk makeWrapper + libunistring pkgconfig boehmgc; + inherit (releaseTools) coverageAnalysis; + }; + io = builderDefsPackage (import ../development/interpreters/io) { inherit sqlite zlib gmp libffi cairo ncurses freetype mesa libpng libtiff libjpeg readline libsndfile libxml2 diff --git a/pkgs/top-level/guile-2-test.nix b/pkgs/top-level/guile-2-test.nix index 305e7ab9650e..2f221f69c097 100644 --- a/pkgs/top-level/guile-2-test.nix +++ b/pkgs/top-level/guile-2-test.nix @@ -54,6 +54,7 @@ in (mapTestOn { */ guile = linux; + guile_1_9_coverage = linux; autogen = linux; lsh = linux;