Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libgit2/files/, dev-libs/libgit2/
Date: Sun, 28 Oct 2018 21:44:31
Message-Id: 1540763051.99914da67e748f4eceec5a02e9ce603917d50004.mgorny@gentoo
1 commit: 99914da67e748f4eceec5a02e9ce603917d50004
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 28 21:40:28 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 28 21:44:11 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99914da6
7
8 dev-libs/libgit2: Skip OOM tests on 32-bit systems
9
10 Closes: https://bugs.gentoo.org/669892
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 ...libgit2-0.26.8-disable-oom-tests-on-32bit.patch | 64 ++++++++++++++++++++++
14 dev-libs/libgit2/libgit2-0.26.8.ebuild | 7 +++
15 dev-libs/libgit2/libgit2-0.27.7.ebuild | 7 +++
16 3 files changed, 78 insertions(+)
17
18 diff --git a/dev-libs/libgit2/files/libgit2-0.26.8-disable-oom-tests-on-32bit.patch b/dev-libs/libgit2/files/libgit2-0.26.8-disable-oom-tests-on-32bit.patch
19 new file mode 100644
20 index 00000000000..40be2aee8fd
21 --- /dev/null
22 +++ b/dev-libs/libgit2/files/libgit2-0.26.8-disable-oom-tests-on-32bit.patch
23 @@ -0,0 +1,64 @@
24 +From 16b5a7baf67169ff12a9a2de9c2853c6f921317c Mon Sep 17 00:00:00 2001
25 +From: Edward Thomson <ethomson@×××××××××××××.com>
26 +Date: Thu, 13 Sep 2018 13:27:07 +0100
27 +Subject: [PATCH] tests: don't run buf::oom on 32-bit systems
28 +
29 +On a 32-bit Linux systems, the value large enough to make malloc
30 +guarantee a failure is also large enough that valgrind considers it
31 +"fishy". Skip this test on those systems entirely.
32 +
33 +[rebased for v0.26.8]
34 +---
35 + tests/buf/oom.c | 14 +++++++++-----
36 + 1 file changed, 9 insertions(+), 5 deletions(-)
37 +
38 +diff --git a/tests/buf/oom.c b/tests/buf/oom.c
39 +index 16a03cc1a..86f5e7239 100644
40 +--- a/tests/buf/oom.c
41 ++++ b/tests/buf/oom.c
42 +@@ -11,12 +11,8 @@
43 + */
44 + #if defined(GIT_ARCH_64) && defined(__linux__)
45 + # define TOOBIG 0x0fffffffffffffff
46 +-#elif defined(__linux__)
47 +-# define TOOBIG 0x0fffffff
48 + #elif defined(GIT_ARCH_64)
49 + # define TOOBIG 0xffffffffffffff00
50 +-#else
51 +-# define TOOBIG 0xffffff00
52 + #endif
53 +
54 + /**
55 +@@ -25,13 +21,18 @@
56 + * will fail. And because the git_buf_grow() wrapper always
57 + * sets mark_oom, the code in git_buf_try_grow() will free
58 + * the internal buffer and set it to git_buf__oom.
59 +- *
60 ++ *
61 + * We initialized the internal buffer to (the static variable)
62 + * git_buf__initbuf. The purpose of this test is to make sure
63 + * that we don't try to free the static buffer.
64 ++ *
65 ++ * Skip this test entirely on 32-bit platforms; a buffer large enough
66 ++ * to guarantee malloc failures is so large that valgrind considers
67 ++ * it likely to be an error.
68 + */
69 + void test_buf_oom__grow(void)
70 + {
71 ++#ifdef GIT_ARCH_64
72 + git_buf buf = GIT_BUF_INIT;
73 +
74 + git_buf_clear(&buf);
75 +@@ -40,6 +41,9 @@ void test_buf_oom__grow(void)
76 + cl_assert(git_buf_oom(&buf));
77 +
78 + git_buf_free(&buf);
79 ++#else
80 ++ cl_skip();
81 ++#endif
82 + }
83 +
84 + void test_buf_oom__grow_by(void)
85 +--
86 +2.19.1
87 +
88
89 diff --git a/dev-libs/libgit2/libgit2-0.26.8.ebuild b/dev-libs/libgit2/libgit2-0.26.8.ebuild
90 index 3a86d17be96..825f2293602 100644
91 --- a/dev-libs/libgit2/libgit2-0.26.8.ebuild
92 +++ b/dev-libs/libgit2/libgit2-0.26.8.ebuild
93 @@ -40,6 +40,13 @@ DEPEND="${RDEPEND}
94
95 DOCS=( AUTHORS CONTRIBUTING.md CONVENTIONS.md README.md )
96
97 +PATCHES=(
98 + # skip OOM tests on 32-bit systems
99 + # https://bugs.gentoo.org/669892
100 + # https://github.com/libgit2/libgit2/commit/415a8ae9c9b6ac18f0524b6af8e58408b426457d
101 + "${FILESDIR}"/libgit2-0.26.8-disable-oom-tests-on-32bit.patch
102 +)
103 +
104 src_configure() {
105 local mycmakeargs=(
106 -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
107
108 diff --git a/dev-libs/libgit2/libgit2-0.27.7.ebuild b/dev-libs/libgit2/libgit2-0.27.7.ebuild
109 index d39c0a7a026..3815701da06 100644
110 --- a/dev-libs/libgit2/libgit2-0.27.7.ebuild
111 +++ b/dev-libs/libgit2/libgit2-0.27.7.ebuild
112 @@ -40,6 +40,13 @@ DEPEND="${RDEPEND}
113
114 DOCS=( AUTHORS CONTRIBUTING.md CONVENTIONS.md README.md )
115
116 +PATCHES=(
117 + # skip OOM tests on 32-bit systems
118 + # https://bugs.gentoo.org/669892
119 + # https://github.com/libgit2/libgit2/commit/415a8ae9c9b6ac18f0524b6af8e58408b426457d
120 + "${FILESDIR}"/libgit2-0.26.8-disable-oom-tests-on-32bit.patch
121 +)
122 +
123 src_configure() {
124 local mycmakeargs=(
125 -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"