Gentoo Archives: gentoo-commits

From: "Cédric Krier" <cedk@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-vcs/mercurial/files/, dev-vcs/mercurial/
Date: Sat, 17 Jul 2021 16:02:45
Message-Id: 1626537753.cfdd67678a0953167192ad229966e908b228993c.cedk@gentoo
1 commit: cfdd67678a0953167192ad229966e908b228993c
2 Author: Cédric Krier <cedk <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 17 16:02:00 2021 +0000
4 Commit: Cédric Krier <cedk <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 17 16:02:33 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cfdd6767
7
8 dev-vcs/mercurial: Re-enable tests
9
10 Use the embedded zstd to have the same output as the tests.
11 Disable timeout when running tests and set jobs number.
12
13 Closes: https://bugs.gentoo.org/662052
14 Closes: https://bugs.gentoo.org/661232
15 Package-Manager: Portage-3.0.20, Repoman-3.0.2
16 Signed-off-by: Cédric Krier <cedk <AT> gentoo.org>
17
18 .../files/mercurial-5.8.1-testing-timeout.patch | 12 ++++++++++
19 dev-vcs/mercurial/mercurial-5.8.1.ebuild | 28 ++++++++++------------
20 2 files changed, 24 insertions(+), 16 deletions(-)
21
22 diff --git a/dev-vcs/mercurial/files/mercurial-5.8.1-testing-timeout.patch b/dev-vcs/mercurial/files/mercurial-5.8.1-testing-timeout.patch
23 new file mode 100644
24 index 00000000000..5c68835ccf7
25 --- /dev/null
26 +++ b/dev-vcs/mercurial/files/mercurial-5.8.1-testing-timeout.patch
27 @@ -0,0 +1,12 @@
28 +diff --git a/mercurial/testing/__init__.py b/mercurial/testing/__init__.py
29 +--- a/mercurial/testing/__init__.py
30 ++++ b/mercurial/testing/__init__.py
31 +@@ -25,7 +25,7 @@ def wait_file(path, timeout=10):
32 + timeout *= _timeout_factor()
33 + start = time.time()
34 + while not os.path.exists(path):
35 +- if time.time() - start > timeout:
36 ++ if timeout and time.time() - start > timeout:
37 + raise RuntimeError(b"timed out waiting for file: %s" % path)
38 + time.sleep(0.01)
39 +
40
41 diff --git a/dev-vcs/mercurial/mercurial-5.8.1.ebuild b/dev-vcs/mercurial/mercurial-5.8.1.ebuild
42 index 9405990cae3..ec426005148 100644
43 --- a/dev-vcs/mercurial/mercurial-5.8.1.ebuild
44 +++ b/dev-vcs/mercurial/mercurial-5.8.1.ebuild
45 @@ -127,7 +127,7 @@ zstd-safe-2.0.5+zstd.1.4.5
46 zstd-sys-1.4.17+zstd.1.4.5
47 "
48
49 -inherit bash-completion-r1 cargo elisp-common distutils-r1 flag-o-matic
50 +inherit bash-completion-r1 cargo elisp-common distutils-r1 flag-o-matic multiprocessing
51
52 DESCRIPTION="Scalable distributed SCM"
53 HOMEPAGE="https://www.mercurial-scm.org/"
54 @@ -143,7 +143,6 @@ IUSE="+chg emacs gpg test tk rust"
55 BDEPEND="rust? ( ${RUST_DEPEND} )"
56 RDEPEND="
57 app-misc/ca-certificates
58 - dev-python/zstandard[${PYTHON_USEDEP}]
59 gpg? ( app-crypt/gnupg )
60 tk? ( dev-lang/tk )"
61
62 @@ -153,10 +152,11 @@ DEPEND="emacs? ( >=app-editors/emacs-23.1:* )
63 dev-python/pygments[${PYTHON_USEDEP}]
64 )"
65
66 -SITEFILE="70${PN}-gentoo.el"
67 +PATCHES=(
68 + "${FILESDIR}"/${P}-testing-timeout.patch
69 +)
70
71 -# Too many tests fail #608720
72 -RESTRICT="test"
73 +SITEFILE="70${PN}-gentoo.el"
74
75 src_unpack() {
76 default_src_unpack
77 @@ -171,10 +171,6 @@ python_prepare_all() {
78 # certain cases), bug #362891
79 sed -i -e 's:xcodebuild:nocodebuild:' setup.py || die
80 sed -i -e 's/__APPLE__/__NO_APPLE__/g' mercurial/cext/osutil.c || die
81 - # Use absolute import for zstd
82 - sed -i -e 's/from \.* import zstd/import zstandard as zstd/' \
83 - mercurial/utils/compression.py \
84 - mercurial/wireprotoframing.py || die
85
86 distutils-r1_python_prepare_all
87 }
88 @@ -182,7 +178,7 @@ python_prepare_all() {
89 src_compile() {
90 if use rust; then
91 pushd rust/hg-cpython || die
92 - cargo_src_compile --no-default-features --features python3
93 + cargo_src_compile --no-default-features --features python3 --jobs $(makeopts_jobs)
94 popd
95 fi
96 distutils-r1_src_compile
97 @@ -194,7 +190,7 @@ python_compile() {
98 if use rust; then
99 local -x HGWITHRUSTEXT="cpython"
100 fi
101 - distutils-r1_python_compile build_ext --no-zstd
102 + distutils-r1_python_compile build_ext
103 }
104
105 python_compile_all() {
106 @@ -216,7 +212,7 @@ python_install() {
107 if use rust; then
108 local -x HGWITHRUSTEXT="cpython"
109 fi
110 - distutils-r1_python_install build_ext --no-zstd
111 + distutils-r1_python_install build_ext
112 }
113
114 python_install_all() {
115 @@ -270,6 +266,7 @@ src_test() {
116 rm -f test-convert-mtn* # monotone
117 rm -f test-convert-tla* # GNU Arch tla
118 rm -f test-largefiles* # tends to time out
119 + rm -f test-https* # requires to support tls1.0
120 if [[ ${EUID} -eq 0 ]]; then
121 einfo "Removing tests which require user privileges to succeed"
122 rm -f test-convert*
123 @@ -287,12 +284,11 @@ src_test() {
124 python_test() {
125 local TEST_DIR
126
127 - rm -rf "${TMPDIR}"/test
128 distutils_install_for_testing
129 cd tests || die
130 - "${PYTHON}" run-tests.py --verbose \
131 - --tmpdir="${TMPDIR}"/test \
132 - --with-hg="${TEST_DIR}"/scripts/hg \
133 + "${PYTHON}" run-tests.py \
134 + --jobs $(makeopts_jobs) \
135 + --timeout 0 \
136 || die "Tests fail with ${EPYTHON}"
137 }