From 1f13f15620dbac11917116fee661e82417840612 Mon Sep 17 00:00:00 2001 From: lukechilds Date: Fri, 12 Jun 2015 23:36:02 +0100 Subject: [PATCH 1/6] Add --without-snapshot configure flag to ARM devices --- nvm.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nvm.sh b/nvm.sh index e857577..32860a3 100755 --- a/nvm.sh +++ b/nvm.sh @@ -1022,6 +1022,12 @@ nvm_install_node_source() { local ADDITIONAL_PARAMETERS ADDITIONAL_PARAMETERS="$2" + local NVM_ARCH + NVM_ARCH="$(nvm_get_arch)" + if [[ $NVM_ARCH = *"arm"* ]]; then + ADDITIONAL_PARAMETERS+=" --without-snapshot" + fi + if [ -n "$ADDITIONAL_PARAMETERS" ]; then echo "Additional options while compiling: $ADDITIONAL_PARAMETERS" fi From 67f2ee82ca5a84dcf8d57d6ef93b608e85604c97 Mon Sep 17 00:00:00 2001 From: lukechilds Date: Sat, 13 Jun 2015 10:13:15 +0100 Subject: [PATCH 2/6] POSIX compatibility --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 32860a3..1b717b1 100755 --- a/nvm.sh +++ b/nvm.sh @@ -1024,8 +1024,8 @@ nvm_install_node_source() { local NVM_ARCH NVM_ARCH="$(nvm_get_arch)" - if [[ $NVM_ARCH = *"arm"* ]]; then - ADDITIONAL_PARAMETERS+=" --without-snapshot" + if [ $NVM_ARCH = "armv6l" ] || [ $NVM_ARCH = "armv7l" ]; then + ADDITIONAL_PARAMETERS="--without-snapshot $ADDITIONAL_PARAMETERS" fi if [ -n "$ADDITIONAL_PARAMETERS" ]; then From 3214caa4ec3bbb590a7c62bb21c523ca7e3a9767 Mon Sep 17 00:00:00 2001 From: lukechilds Date: Sat, 13 Jun 2015 15:58:27 +0100 Subject: [PATCH 3/6] Adding installation test for disabling V8 snapshot on ARM --- ...ll from source without V8 snapshot for ARM | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 test/installation/node/install from source without V8 snapshot for ARM diff --git a/test/installation/node/install from source without V8 snapshot for ARM b/test/installation/node/install from source without V8 snapshot for ARM new file mode 100755 index 0000000..9362cf0 --- /dev/null +++ b/test/installation/node/install from source without V8 snapshot for ARM @@ -0,0 +1,25 @@ +#!/bin/sh + +die () { echo $@ ; exit 1; } + +. ../../../nvm.sh + +NVM_TEST_VERSION=v0.10.7 + +# Remove the stuff we're clobbering. +[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION + +# Fake ARM arch +nvm_get_arch() { + echo "armv7l" +} + +# Install from source +nvm install -s $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed" + +# Check Install +[ -d ../../../$NVM_TEST_VERSION ] +nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed" + +# Check V8 snapshot isn't compiled +nvm run $NVM_TEST_VERSION -p process.config | grep "v8_use_snapshot: false" || "'nvm run $NVM_TEST_VERSION -p process.config | grep \"v8_use_snapshot: false\"' failed" \ No newline at end of file From 83466446cea628781344c8565c2fda43f7a90233 Mon Sep 17 00:00:00 2001 From: lukechilds Date: Sat, 13 Jun 2015 16:10:49 +0100 Subject: [PATCH 4/6] Added newline to end of ARM test --- .../node/install from source without V8 snapshot for ARM | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/installation/node/install from source without V8 snapshot for ARM b/test/installation/node/install from source without V8 snapshot for ARM index 9362cf0..a7a562c 100755 --- a/test/installation/node/install from source without V8 snapshot for ARM +++ b/test/installation/node/install from source without V8 snapshot for ARM @@ -22,4 +22,5 @@ nvm install -s $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' fail nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed" # Check V8 snapshot isn't compiled -nvm run $NVM_TEST_VERSION -p process.config | grep "v8_use_snapshot: false" || "'nvm run $NVM_TEST_VERSION -p process.config | grep \"v8_use_snapshot: false\"' failed" \ No newline at end of file +nvm run $NVM_TEST_VERSION -p process.config | grep "v8_use_snapshot: false" || "'nvm run $NVM_TEST_VERSION -p process.config | grep \"v8_use_snapshot: false\"' failed" + From 3b67b3b9bb268e7082a77022c9d6a0b263fa9a34 Mon Sep 17 00:00:00 2001 From: lukechilds Date: Sat, 13 Jun 2015 18:52:54 +0100 Subject: [PATCH 5/6] Use node instead of nvm run and check v8_use_snapshot in node rather than shell --- .../node/install from source without V8 snapshot for ARM | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/installation/node/install from source without V8 snapshot for ARM b/test/installation/node/install from source without V8 snapshot for ARM index a7a562c..9fd1c89 100755 --- a/test/installation/node/install from source without V8 snapshot for ARM +++ b/test/installation/node/install from source without V8 snapshot for ARM @@ -17,10 +17,12 @@ nvm_get_arch() { # Install from source nvm install -s $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed" +# Use new version +nvm use $NVM_TEST_VERSION + # Check Install [ -d ../../../$NVM_TEST_VERSION ] -nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed" +node --version | grep $NVM_TEST_VERSION || "'node --version | grep $NVM_TEST_VERSION' failed" # Check V8 snapshot isn't compiled -nvm run $NVM_TEST_VERSION -p process.config | grep "v8_use_snapshot: false" || "'nvm run $NVM_TEST_VERSION -p process.config | grep \"v8_use_snapshot: false\"' failed" - +node -p "if(! process.config.variables.v8_use_snapshot) { console.log('no-snapshot'); }" | grep "no-snapshot" || "'node -p \"if(! process.config.variables.v8_use_snapshot) { console.log('no-snapshot'); }\" | grep \"no-snapshot\"' failed" \ No newline at end of file From c1ef31df53361e94b52bcd7eaecbb7fe2b682c35 Mon Sep 17 00:00:00 2001 From: lukechilds Date: Sat, 13 Jun 2015 19:38:28 +0100 Subject: [PATCH 6/6] Remove unnecessary nvm use --- .../node/install from source without V8 snapshot for ARM | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/installation/node/install from source without V8 snapshot for ARM b/test/installation/node/install from source without V8 snapshot for ARM index 9fd1c89..3755d71 100755 --- a/test/installation/node/install from source without V8 snapshot for ARM +++ b/test/installation/node/install from source without V8 snapshot for ARM @@ -17,9 +17,6 @@ nvm_get_arch() { # Install from source nvm install -s $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed" -# Use new version -nvm use $NVM_TEST_VERSION - # Check Install [ -d ../../../$NVM_TEST_VERSION ] node --version | grep $NVM_TEST_VERSION || "'node --version | grep $NVM_TEST_VERSION' failed"