]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
vnu-jar.js: pass `-Xss512k` for 32-bit Java to avoid a StackOverflowError error.
authorXhmikosR <xhmikosr@gmail.com>
Tue, 31 Oct 2017 11:06:39 +0000 (13:06 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Tue, 31 Oct 2017 19:36:17 +0000 (21:36 +0200)
build/vnu-jar.js

index f31b9795a8ea3de7ac4f8ba5069e4899979c5058..ea894ac06c9762d99a1b49d7b892791e0e391532 100644 (file)
 const childProcess = require('child_process')
 const vnu = require('vnu-jar')
 
-childProcess.exec('java -version', (error) => {
+childProcess.exec('java -version', (error, stdout, stderr) => {
   if (error) {
     console.error('Skipping HTML lint test; Java is missing.')
     return
   }
 
+  const is32bitJava = !stderr.match(/64-Bit/)
+
   // vnu-jar accepts multiple ignores joined with a `|`
   const ignores = [
     'Attribute “autocomplete” is only allowed when the input type is “color”, “date”, “datetime-local”, “email”, “hidden”, “month”, “number”, “password”, “range”, “search”, “tel”, “text”, “time”, “url”, or “week”.',
@@ -44,6 +46,11 @@ childProcess.exec('java -version', (error) => {
     'js/tests/'
   ]
 
+  // For the 32-bit Java we need to pass `-Xss512k`
+  if (is32bitJava) {
+    args.splice(0, 0, '-Xss512k')
+  }
+
   return childProcess.spawn('java', args, {
     shell: true,
     stdio: 'inherit'