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-python/pypy3/
Date: Wed, 08 Mar 2017 11:32:59
Message-Id: 1488972764.890fe16c41e02c0df1de61c6813ae27aeae28e0b.mgorny@gentoo
1 commit: 890fe16c41e02c0df1de61c6813ae27aeae28e0b
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 8 10:56:27 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 8 11:32:44 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=890fe16c
7
8 dev-python/pypy3: Split translation and compile phases
9
10 Like in dev-python/pypy, use --source to disable auto-spawning
11 compilation phase in rpython. Instead, run it manually in src_compile().
12 This way we reduce memory consumption (since rpython normally does not
13 free the lots of memory it used during the translation while spawning
14 the compiler), and make the process easier to resume.
15
16 dev-python/pypy3/pypy3-5.5.0_alpha.ebuild | 29 ++++++++++++++++++-----------
17 dev-python/pypy3/pypy3-9999.ebuild | 25 ++++++++++++++++++-------
18 2 files changed, 36 insertions(+), 18 deletions(-)
19
20 diff --git a/dev-python/pypy3/pypy3-5.5.0_alpha.ebuild b/dev-python/pypy3/pypy3-5.5.0_alpha.ebuild
21 index 53fc3868981..1a436991436 100644
22 --- a/dev-python/pypy3/pypy3-5.5.0_alpha.ebuild
23 +++ b/dev-python/pypy3/pypy3-5.5.0_alpha.ebuild
24 @@ -94,7 +94,7 @@ src_prepare() {
25 epatch_user
26 }
27
28 -src_compile() {
29 +src_configure() {
30 tc-export CC
31
32 local jit_backend
33 @@ -151,16 +151,22 @@ src_compile() {
34 "${PYTHON}" --jit loop_longevity=300 )
35 fi
36
37 - set -- "${interp[@]}" rpython/bin/rpython --batch "${args[@]}"
38 + # translate into the C sources
39 + # we're going to make them ourselves since otherwise pypy does not
40 + # free up the unneeded memory before spawning the compiler
41 + set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
42 echo -e "\033[1m${@}\033[0m"
43 - "${@}" || die "compile error"
44 + "${@}" || die "translation failed"
45 +}
46 +
47 +src_compile() {
48 + emake -C "${T}"/usession*-current/testing_1
49
50 - # Exception occurred:
51 - # File "/tmp/1/pypy3-2.4.0-src/pypy/config/makerestdoc.py", line 199, in config_role
52 - # assert txt.check()
53 - # AssertionError
54 - #use doc && emake -C pypy/doc/ html
55 + # copy back to make sys.prefix happy
56 + cp -p "${T}"/usession*-current/testing_1/{pypy-c,libpypy-c.so} . || die
57 pax-mark m pypy-c libpypy-c.so
58 +
59 + #use doc && emake -C pypy/doc html
60 }
61
62 src_test() {
63 @@ -175,10 +181,11 @@ src_test() {
64 src_install() {
65 local dest=/usr/$(get_libdir)/pypy3
66 einfo "Installing PyPy ..."
67 - insinto "${dest}"
68 - doins -r include lib_pypy lib-python pypy-c libpypy-c.so
69 - fperms a+x ${dest}/pypy-c ${dest}/libpypy-c.so
70 + exeinto "${dest}"
71 + doexe pypy-c libpypy-c.so
72 pax-mark m "${ED%/}${dest}/pypy-c" "${ED%/}${dest}/libpypy-c.so"
73 + insinto "${dest}"
74 + doins -r include lib_pypy lib-python
75 dosym ../$(get_libdir)/pypy3/pypy-c /usr/bin/pypy3
76 dodoc README.rst
77
78
79 diff --git a/dev-python/pypy3/pypy3-9999.ebuild b/dev-python/pypy3/pypy3-9999.ebuild
80 index 9c486a55bf3..b399af1a9d4 100644
81 --- a/dev-python/pypy3/pypy3-9999.ebuild
82 +++ b/dev-python/pypy3/pypy3-9999.ebuild
83 @@ -103,7 +103,7 @@ src_prepare() {
84 epatch_user
85 }
86
87 -src_compile() {
88 +src_configure() {
89 tc-export CC
90
91 local jit_backend
92 @@ -160,12 +160,22 @@ src_compile() {
93 "${PYTHON}" --jit loop_longevity=300 )
94 fi
95
96 - set -- "${interp[@]}" rpython/bin/rpython --batch "${args[@]}"
97 + # translate into the C sources
98 + # we're going to make them ourselves since otherwise pypy does not
99 + # free up the unneeded memory before spawning the compiler
100 + set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
101 echo -e "\033[1m${@}\033[0m"
102 - "${@}" || die "compile error"
103 + "${@}" || die "translation failed"
104 +}
105 +
106 +src_compile() {
107 + emake -C "${T}"/usession*-current/testing_1
108
109 - #use doc && emake -C pypy/doc/ html
110 + # copy back to make sys.prefix happy
111 + cp -p "${T}"/usession*-current/testing_1/{pypy-c,libpypy-c.so} . || die
112 pax-mark m pypy-c libpypy-c.so
113 +
114 + #use doc && emake -C pypy/doc html
115 }
116
117 src_test() {
118 @@ -180,10 +190,11 @@ src_test() {
119 src_install() {
120 local dest=/usr/$(get_libdir)/pypy3
121 einfo "Installing PyPy ..."
122 - insinto "${dest}"
123 - doins -r include lib_pypy lib-python pypy-c libpypy-c.so
124 - fperms a+x ${dest}/pypy-c ${dest}/libpypy-c.so
125 + exeinto "${dest}"
126 + doexe pypy-c libpypy-c.so
127 pax-mark m "${ED%/}${dest}/pypy-c" "${ED%/}${dest}/libpypy-c.so"
128 + insinto "${dest}"
129 + doins -r include lib_pypy lib-python
130 dosym ../$(get_libdir)/pypy3/pypy-c /usr/bin/pypy3
131 dodoc README.rst