From 1eb54928c2c3079530871aa6bdb849cb6c243a9a Mon Sep 17 00:00:00 2001 From: Svetoslav Neykov Date: Tue, 22 Jul 2014 10:16:46 +0300 Subject: [PATCH] Workaround for builds.apache.org CI The build on builds.apache.org fails due to the wrong nodejs binary being used. Until nodejs-maven-plugin is fixed force the usage of the 64 bit nodejs binary on 64 bit systems. --- pom.xml | 1 + usage/jsgui/pom.xml | 47 +++++++++++++++++++++++++++++++++++- usage/jsgui/src/build/nodejs | 41 +++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100755 usage/jsgui/src/build/nodejs diff --git a/pom.xml b/pom.xml index 19b325983b..b67ae2bd03 100644 --- a/pom.xml +++ b/pom.xml @@ -172,6 +172,7 @@ 1.0_jdk5 1.5.2 1.0.3 + 0.10.25 1.2.0.0 true diff --git a/usage/jsgui/src/build/nodejs b/usage/jsgui/src/build/nodejs new file mode 100755 index 0000000000..2b00792be2 --- /dev/null +++ b/usage/jsgui/src/build/nodejs @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# nodejs-maven-plugin incorrectly detects the architecture on +# Linux x64 running 32 bit Java leading to the installation of +# invalid nodejs binary - 32 bit on 64 bit OS. This is a +# wrapper which makes a check for the architecture again and +# forces the usage of the 64 bit binary. The 64 bit nodejs +# is installed in advance in case we need it. +# +# target/nodejs64/node - the forcibly installed 64 bit binary +# target/nodejs/node - the binary installed by nodejs-maven-plugin +# could be 32 bit or 64 bit. +# + +MACHINE_TYPE=`uname -m` +if [ $MACHINE_TYPE = 'x86_64' ]; then + NODE_PATH=$( dirname "$0" )/../../target/nodejs64/node + chmod +x $NODE_PATH + echo Forcing 64 bit nodejs at $NODE_PATH +else + NODE_PATH=$( dirname "$0" )/../../target/nodejs/node +fi + +$NODE_PATH "$@"