aboutsummaryrefslogtreecommitdiffstats
path: root/main/python2/APKBUILD
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-12-14 15:43:52 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-12-14 15:44:45 +0000
commit2f35283fec8ec451fe5fb477dd32ffdcc0776e89 (patch)
tree49e90dda207bf9c7493a2ee4a4194716d8b45f56 /main/python2/APKBUILD
parentea3800db78eca2e296891eb24453ea58f1db0025 (diff)
downloadaports-2f35283fec8ec451fe5fb477dd32ffdcc0776e89.tar.bz2
aports-2f35283fec8ec451fe5fb477dd32ffdcc0776e89.tar.xz
main/python2: set thread stack size to 1 MiB
We need increase stack size so we dont segfautl before we hit the recursion limit.
Diffstat (limited to 'main/python2/APKBUILD')
-rw-r--r--main/python2/APKBUILD24
1 files changed, 22 insertions, 2 deletions
diff --git a/main/python2/APKBUILD b/main/python2/APKBUILD
index 5ac8fad4f4..eae2a0d211 100644
--- a/main/python2/APKBUILD
+++ b/main/python2/APKBUILD
@@ -4,7 +4,7 @@ pkgname=python2
# the python2-tkinter's pkgver needs to be synchronized with this.
pkgver=2.7.14
_verbase=${pkgver%.*}
-pkgrel=1
+pkgrel=2
pkgdesc="A high-level scripting language"
url="http://www.python.org"
arch="all"
@@ -36,7 +36,7 @@ prepare() {
build() {
cd "$builddir"
- export OPT="$CFLAGS"
+ export OPT="$CFLAGS -DTHREAD_STACK_SIZE=0x100000"
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -51,6 +51,26 @@ build() {
make
}
+check() {
+ cd "$builddir"
+
+ # test that we reach recursionlimit before we segfault
+ cat > test-stacksize.py <<-EOF
+ import threading
+ import sys
+
+ def fun(i):
+ try:
+ fun(i+1)
+ except:
+ sys.exit(0)
+
+ t = threading.Thread(target=fun, args=[1])
+ t.start()
+EOF
+ LD_LIBRARY_PATH=$PWD ./python test-stacksize.py
+}
+
package() {
cd "$builddir"
make -j1 DESTDIR="$pkgdir" install