On Fri, 13 Dec 2013, Petr Vobornik wrote:
Web UI build fails on some architectures or configuration due to
StackOverflow. This patch increases the stack size to solve it.

512k is usually enough but we encountered fail on ppc64 even with 2m,
therefore the 8m. The build is single threaded so it shouldn't waste
much memory.
--
Petr Vobornik

From 9eeb52abaa6a53bb3304f96dd17d0b1f74083b50 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Wed, 31 Jul 2013 15:12:19 +0200
Subject: [PATCH] Increase stack size for Web UI builder

Web UI build fails on some architectures or configuration due to
StackOverflow. This patch increases the stack size to solve it.

512k is usually enough but we encountered fail on ppc64 even with 2m,
therefore the 8m. The build is single threaded so it shouldn't waste
much memory.
---
install/ui/util/build.sh        | 5 +++--
install/ui/util/uglifyjs/uglify | 9 +++++----
2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/install/ui/util/build.sh b/install/ui/util/build.sh
index 
7cd623485a8a87872e29d32f529bd77a45d59810..9495e119bac123645e41aeb2b304d7d399a3fd96
 100755
--- a/install/ui/util/build.sh
+++ b/install/ui/util/build.sh
@@ -31,5 +31,6 @@ if [[ ! $profile ]] ; then
    exit 1
fi

-rhino $DIR/build/build.js baseUrl=$DIR/build load=build 
profile=$DIR/../src/$profile.profile.js
-exit $?
\ No newline at end of file
+RHINO="java -Xss8m -classpath /usr/share/java/rhino.jar  
org.mozilla.javascript.tools.shell.Main"
+$RHINO $DIR/build/build.js baseUrl=$DIR/build load=build 
profile=$DIR/../src/$profile.profile.js
+exit $?
diff --git a/install/ui/util/uglifyjs/uglify b/install/ui/util/uglifyjs/uglify
index 
7d25b38df19e465227f29b8b70ccf7ca140f725a..fb46275b868f60f5f92175ee070d98737b5d7c89
 100755
--- a/install/ui/util/uglifyjs/uglify
+++ b/install/ui/util/uglifyjs/uglify
@@ -25,8 +25,9 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# rhino-1.7R4 doesn't have -main option to enable CommonJS support. It was
# replaced by -require option.
-if [ `rhino --help | grep -e -require | wc -l` -gt 0 ] ; then
-    rhino -require $DIR/uglify-js.js $@
+RHINO="java -Xss8m -classpath /usr/share/java/rhino.jar  
org.mozilla.javascript.tools.shell.Main"
+if [ `$RHINO --help | grep -e -require | wc -l` -gt 0 ] ; then
+    $RHINO -require $DIR/uglify-js.js $@
else
-    rhino -main $DIR/uglify-js.js $DIR/ug.js $@
-fi
\ No newline at end of file
+    $RHINO -main $DIR/uglify-js.js $DIR/ug.js $@
+fi
I'd prefer to get the value from some environmental variable within
build and uglify scripts and default to some expected value if that is missing.
Then we can put default value in top Makefile and easily override it
from the spec if needed.

Makefile:
...
JAVA_STACK_SIZE ?= 8m
...

build.sh:
RHINO="java -Xss${JAVA_STACK_SIZE:-512k} ..."

uglify:
RHINO="java -Xss${JAVA_STACK_SIZE:-512k} ..."


then if some platform gets it broken, we can redefine JAVA_STACK_SIZE in
the specfile to any value without touching the code.

--
/ Alexander Bokovoy

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to