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

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

merged 6 commits into from
Jun 18, 2015

Conversation

lukechilds
Copy link
Contributor

At the time of this writing, there is a problem with the Google V8 Snapshot feature causing node to segmentation fault on ARM devices. Snapshotting helps node start faster and is not a big-deal feature so it's safe to disable by default for ARM.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

I believe this double bracket syntax is not portable - nvm has to work in POSIX, which includes dash, sh, ksh, zsh, and bash. Same, I believe, with the += below.

@ljharb
Copy link
Member

ljharb commented Jun 13, 2015

Can you please add an installation test for this, that mocks out nvm_get_arch to be one of the arm architecture values?

@ljharb ljharb added installing node Issues with installing node/io.js versions. feature requests I want a new feature in nvm! needs followup We need some info or action from whoever filed this issue/PR. labels Jun 13, 2015
@lukechilds
Copy link
Contributor Author

I've updated for POSIX compatibility.
Sorry but I'm not too sure how to go about writing the test for ARM.

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"
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.

@ljharb
Copy link
Member

ljharb commented Jun 13, 2015

Weird that it's only failing on zsh :-/

@lukechilds
Copy link
Contributor Author

Even weirder that zsh is my default shell and it runs fine on my machine. Weirder still that the issue seems to be with ./configure not the shell.

configure: error: no such option: --without-snapshot

Pretty stumped...

nvm install -s $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed"

# Use new version
nvm use $NVM_TEST_VERSION
Copy link
Member

Choose a reason for hiding this comment

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

This is done automatically by nvm install, so either it should be removed, or a || die should be added in case this line fails.

@lukechilds
Copy link
Contributor Author

Seems to be working fine on zsh now.

@lukechilds
Copy link
Contributor Author

Any plans to merge this in?

@ljharb
Copy link
Member

ljharb commented Jun 15, 2015

Yes - I'm out of town until tonight, so I'll test and merge it tonight or tomorrow.

@lukechilds
Copy link
Contributor Author

Awesome.

@ljharb
Copy link
Member

ljharb commented Jun 18, 2015

Sorry for the delay - this looks great, thanks!

@ljharb ljharb removed the needs followup We need some info or action from whoever filed this issue/PR. label Jun 18, 2015
ljharb added a commit that referenced this pull request Jun 18, 2015
Add --without-snapshot configure flag to ARM devices by default
@ljharb ljharb merged commit 6b8fd19 into nvm-sh:master Jun 18, 2015
@lukechilds
Copy link
Contributor Author

No problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature requests I want a new feature in nvm! installing node Issues with installing node/io.js versions. OS: Raspberry Pi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants