Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --without-snapshot configure flag to ARM devices by default #766

Merged
merged 6 commits into from
Jun 18, 2015
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "armv6l" ] || [ $NVM_ARCH = "armv7l" ]; then
ADDITIONAL_PARAMETERS="--without-snapshot $ADDITIONAL_PARAMETERS"
fi

if [ -n "$ADDITIONAL_PARAMETERS" ]; then
echo "Additional options while compiling: $ADDITIONAL_PARAMETERS"
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the install, the version should be auto-used, so you should be able to simply check nvm current and node --version, and below, directly use node

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok,I just copied most of it from it from the install from source test. Do you want me to update it or leave it for consistency?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way. Consistency isn't as important in tests. I was just thinking it might make the test easier to debug ¯_(ツ)_/¯


# 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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I note that when I run this command on my own system, it says v8_use_snapshot: 1 - is there a chance it will sometimes be 0/1, and sometimes true/false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I'll update it to check the falsy value in node rather than trying to scrape it out with grep.