Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/re2/files/, dev-libs/re2/
Date: Sat, 23 May 2020 20:17:28
Message-Id: 1590265007.a2f96c874b23ad03c613265cf326172a264c3b24.floppym@gentoo
commit:     a2f96c874b23ad03c613265cf326172a264c3b24
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat May 23 20:16:47 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat May 23 20:16:47 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2f96c87

dev-libs/re2: fix tests on 32-bit platforms

Closes: https://bugs.gentoo.org/724404
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../files/0.2020.05.01-test-memory-budget.patch    | 27 ++++++++++++++++++++++
 dev-libs/re2/re2-0.2020.05.01.ebuild               |  3 +++
 2 files changed, 30 insertions(+)

diff --git a/dev-libs/re2/files/0.2020.05.01-test-memory-budget.patch b/dev-libs/re2/files/0.2020.05.01-test-memory-budget.patch
new file mode 100644
index 00000000000..3e62934153c
--- /dev/null
+++ b/dev-libs/re2/files/0.2020.05.01-test-memory-budget.patch
@@ -0,0 +1,27 @@
+From bde1ea09550a61b4a092cdf0e3ba8dca4200947a Mon Sep 17 00:00:00 2001
+From: Paul Wankadia <junyer@××××××.com>
+Date: Sun, 10 May 2020 07:12:35 -0700
+Subject: [PATCH] Lower the memory budget in TestCompile.InsufficientMemory.
+
+Fixes #256.
+
+Change-Id: I975c5f6f7a12dc86fedc0f3ab35f16295c18a7e8
+Reviewed-on: https://code-review.googlesource.com/c/re2/+/56150
+Reviewed-by: Paul Wankadia <junyer@××××××.com>
+---
+ re2/testing/compile_test.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/re2/testing/compile_test.cc b/re2/testing/compile_test.cc
+index 4598aa64..2096e2f0 100644
+--- a/re2/testing/compile_test.cc
++++ b/re2/testing/compile_test.cc
+@@ -236,7 +236,7 @@ TEST(TestCompile, InsufficientMemory) {
+       "^(?P<name1>[^\\s]+)\\s+(?P<name2>[^\\s]+)\\s+(?P<name3>.+)$",
+       Regexp::LikePerl, NULL);
+   EXPECT_TRUE(re != NULL);
+-  Prog* prog = re->CompileToProg(920);
++  Prog* prog = re->CompileToProg(850);
+   // If the memory budget has been exhausted, compilation should fail
+   // and return NULL instead of trying to do anything with NoMatch().
+   EXPECT_TRUE(prog == NULL);

diff --git a/dev-libs/re2/re2-0.2020.05.01.ebuild b/dev-libs/re2/re2-0.2020.05.01.ebuild
index c0c9da9e15f..45f70cb1090 100644
--- a/dev-libs/re2/re2-0.2020.05.01.ebuild
+++ b/dev-libs/re2/re2-0.2020.05.01.ebuild
@@ -31,6 +31,9 @@ DOCS=( AUTHORS CONTRIBUTORS README doc/syntax.txt )
 HTML_DOCS=( doc/syntax.html )
 
 src_prepare() {
+	local PATCHES=(
+		"${FILESDIR}"/0.2020.05.01-test-memory-budget.patch
+	)
 	default
 	grep -q "^SONAME=${SONAME}\$" Makefile || die "SONAME mismatch"
 	if use icu; then