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

adding architecture detection for Raspberry Pi 2 #742

Merged
merged 1 commit into from
Apr 26, 2015

Conversation

sjasperse
Copy link
Contributor

I have no idea how to write tests for this. I have about 3hrs of linux/RPi experience, but I know that my Raspberry Pi 2 reports an architecture of armv7l whereas nvm currently only detects armv6l as a Raspberry Pi. I made this change on my machine and it worked, so I am contributing my changes. :-) Hopefully they help.

If you want to give me a little direction on how to write and run tests I can try to help out with that also. :-)

@ljharb
Copy link
Member

ljharb commented Apr 25, 2015

Thanks for the contribution!

This is definitely very tricky to write tests for, so we may not need them. My concern is older versions of node. Can you manually test all of nvm install 0.6, 0.8, 0.10, 0.11, and 0.12, just to make sure that this change doesn't break any of those?

It's highly likely that this will just make rpis work better with no adverse side effects :-)

Another option would be [ "_${NVM_ARCH#armv}" != "_$NVM_ARCH" ] which should detect any future armv… architectures?

@ljharb ljharb added OS: Raspberry Pi installing node Issues with installing node/io.js versions. labels Apr 25, 2015
@sjasperse
Copy link
Contributor Author

Are you wanting these manual tests on non-Pi machines, or on my Pi? The issue was that it was trying to download https://nodejs.org/dist/v0.11.9/node-v0.11.9-linux-arm7l.tar.gz instead of https://nodejs.org/dist/v0.11.9/node-v0.11.9-linux-arm-pi.tar.gz.
The ARM builds are non-automated, from what I can tell from message boards, so the only way a version has ARM binaries is if someone manually submitted it to the download dist area. I had to manually go through https://nodejs.org/dist/ in my browser to find which ARM builds even existed. 0.11.9 was the latest I could find.
I just checked downloading v0.6.0 from the Pi and it downloaded, but failed due to something about OpenSSL. I think it got past the code this PR is in reference to, but probably the old versions are Pi/ARM compatible. Just a guess.

@ljharb
Copy link
Member

ljharb commented Apr 26, 2015

You're right - since the issue is about which tarball is downloaded, the only concern here would be if an armv71 file existed that was no longer accessible.

Since it appears there isn't any armv71 tarballs on nodejs.org (I'll wait for you to confirm), then I think this is good as-is!

@sjasperse
Copy link
Contributor Author

I wrote a script to dig into all the nodejs.org/dist/v0../ folders and look for arm.tar.gz and I don't see any other than arm-pi.

[ '/dist/v0.10.0/node-v0.10.0-linux-arm-pi.tar.gz',
'/dist/v0.10.0/node-v0.10.0-linux-arm-pi.tar.gz',
'/dist/v0.10.1/node-v0.10.1-linux-arm-pi.tar.gz',
'/dist/v0.10.1/node-v0.10.1-linux-arm-pi.tar.gz',
'/dist/v0.10.10/node-v0.10.10-linux-arm-pi.tar.gz',
'/dist/v0.10.10/node-v0.10.10-linux-arm-pi.tar.gz',
'/dist/v0.10.11/node-v0.10.11-linux-arm-pi.tar.gz',
'/dist/v0.10.11/node-v0.10.11-linux-arm-pi.tar.gz',
'/dist/v0.10.12/node-v0.10.12-linux-arm-pi.tar.gz',
'/dist/v0.10.12/node-v0.10.12-linux-arm-pi.tar.gz',
'/dist/v0.10.13/node-v0.10.13-linux-arm-pi.tar.gz',
'/dist/v0.10.13/node-v0.10.13-linux-arm-pi.tar.gz',
'/dist/v0.10.14/node-v0.10.14-linux-arm-pi.tar.gz',
'/dist/v0.10.14/node-v0.10.14-linux-arm-pi.tar.gz',
'/dist/v0.10.14/node-v0.10.14-linux-arm-pi.tar.gz',
'/dist/v0.10.14/node-v0.10.14-linux-arm-pi.tar.gz',
'/dist/v0.10.15/node-v0.10.15-linux-arm-pi.tar.gz',
'/dist/v0.10.15/node-v0.10.15-linux-arm-pi.tar.gz',
'/dist/v0.10.16/node-v0.10.16-linux-arm-pi.tar.gz',
'/dist/v0.10.16/node-v0.10.16-linux-arm-pi.tar.gz',
'/dist/v0.10.16/node-v0.10.16-linux-arm-pi.tar.gz',
'/dist/v0.10.16/node-v0.10.16-linux-arm-pi.tar.gz',
'/dist/v0.10.17/node-v0.10.17-linux-arm-pi.tar.gz',
'/dist/v0.10.17/node-v0.10.17-linux-arm-pi.tar.gz',
'/dist/v0.10.18/node-v0.10.18-linux-arm-pi.tar.gz',
'/dist/v0.10.18/node-v0.10.18-linux-arm-pi.tar.gz',
'/dist/v0.10.19/node-v0.10.19-linux-arm-pi.tar.gz',
'/dist/v0.10.19/node-v0.10.19-linux-arm-pi.tar.gz',
'/dist/v0.10.2/node-v0.10.2-linux-arm-pi.tar.gz',
'/dist/v0.10.2/node-v0.10.2-linux-arm-pi.tar.gz',
'/dist/v0.10.20/node-v0.10.20-linux-arm-pi.tar.gz',
'/dist/v0.10.20/node-v0.10.20-linux-arm-pi.tar.gz',
'/dist/v0.10.21/node-v0.10.21-linux-arm-pi.tar.gz',
'/dist/v0.10.21/node-v0.10.21-linux-arm-pi.tar.gz',
'/dist/v0.10.22/node-v0.10.22-linux-arm-pi.tar.gz',
'/dist/v0.10.22/node-v0.10.22-linux-arm-pi.tar.gz',
'/dist/v0.10.23/node-v0.10.23-linux-arm-pi.tar.gz',
'/dist/v0.10.23/node-v0.10.23-linux-arm-pi.tar.gz',
'/dist/v0.10.24/node-v0.10.24-linux-arm-pi.tar.gz',
'/dist/v0.10.24/node-v0.10.24-linux-arm-pi.tar.gz',
'/dist/v0.10.25/node-v0.10.25-linux-arm-pi.tar.gz',
'/dist/v0.10.25/node-v0.10.25-linux-arm-pi.tar.gz',
'/dist/v0.10.26/node-v0.10.26-linux-arm-pi.tar.gz',
'/dist/v0.10.26/node-v0.10.26-linux-arm-pi.tar.gz',
'/dist/v0.10.27/node-v0.10.27-linux-arm-pi.tar.gz',
'/dist/v0.10.27/node-v0.10.27-linux-arm-pi.tar.gz',
'/dist/v0.10.28/node-v0.10.28-linux-arm-pi.tar.gz',
'/dist/v0.10.28/node-v0.10.28-linux-arm-pi.tar.gz',
'/dist/v0.10.3/node-v0.10.3-linux-arm-pi.tar.gz',
'/dist/v0.10.3/node-v0.10.3-linux-arm-pi.tar.gz',
'/dist/v0.10.4/node-v0.10.4-linux-arm-pi.tar.gz',
'/dist/v0.10.4/node-v0.10.4-linux-arm-pi.tar.gz',
'/dist/v0.10.5/node-v0.10.5-linux-arm-pi.tar.gz',
'/dist/v0.10.5/node-v0.10.5-linux-arm-pi.tar.gz',
'/dist/v0.10.6/node-v0.10.6-linux-arm-pi.tar.gz',
'/dist/v0.10.6/node-v0.10.6-linux-arm-pi.tar.gz',
'/dist/v0.10.7/node-v0.10.7-linux-arm-pi.tar.gz',
'/dist/v0.10.7/node-v0.10.7-linux-arm-pi.tar.gz',
'/dist/v0.10.8/node-v0.10.8-linux-arm-pi.tar.gz',
'/dist/v0.10.8/node-v0.10.8-linux-arm-pi.tar.gz',
'/dist/v0.10.9/node-v0.10.9-linux-arm-pi.tar.gz',
'/dist/v0.10.9/node-v0.10.9-linux-arm-pi.tar.gz',
'/dist/v0.11.0/node-v0.11.0-linux-arm-pi.tar.gz',
'/dist/v0.11.0/node-v0.11.0-linux-arm-pi.tar.gz',
'/dist/v0.11.1/node-v0.11.1-linux-arm-pi.tar.gz',
'/dist/v0.11.1/node-v0.11.1-linux-arm-pi.tar.gz',
'/dist/v0.11.10/node-v0.11.10-linux-arm-pi.tar.gz',
'/dist/v0.11.10/node-v0.11.10-linux-arm-pi.tar.gz',
'/dist/v0.11.11/node-v0.11.11-linux-arm-pi.tar.gz',
'/dist/v0.11.11/node-v0.11.11-linux-arm-pi.tar.gz',
'/dist/v0.11.12/node-v0.11.12-linux-arm-pi.tar.gz',
'/dist/v0.11.12/node-v0.11.12-linux-arm-pi.tar.gz',
'/dist/v0.11.2/node-v0.11.2-linux-arm-pi.tar.gz',
'/dist/v0.11.2/node-v0.11.2-linux-arm-pi.tar.gz',
'/dist/v0.11.3/node-v0.11.3-linux-arm-pi.tar.gz',
'/dist/v0.11.3/node-v0.11.3-linux-arm-pi.tar.gz',
'/dist/v0.11.4/node-v0.11.4-linux-arm-pi.tar.gz',
'/dist/v0.11.4/node-v0.11.4-linux-arm-pi.tar.gz',
'/dist/v0.11.5/node-v0.11.5-linux-arm-pi.tar.gz',
'/dist/v0.11.5/node-v0.11.5-linux-arm-pi.tar.gz',
'/dist/v0.11.6/node-v0.11.6-linux-arm-pi.tar.gz',
'/dist/v0.11.6/node-v0.11.6-linux-arm-pi.tar.gz',
'/dist/v0.11.7/node-v0.11.7-linux-arm-pi.tar.gz',
'/dist/v0.11.7/node-v0.11.7-linux-arm-pi.tar.gz',
'/dist/v0.11.8/node-v0.11.8-linux-arm-pi.tar.gz',
'/dist/v0.11.8/node-v0.11.8-linux-arm-pi.tar.gz',
'/dist/v0.11.9/node-v0.11.9-linux-arm-pi.tar.gz',
'/dist/v0.11.9/node-v0.11.9-linux-arm-pi.tar.gz',
'/dist/v0.8.17/node-v0.8.17-linux-arm-pi.tar.gz',
'/dist/v0.8.17/node-v0.8.17-linux-arm-pi.tar.gz',
'/dist/v0.8.18/node-v0.8.18-linux-arm-pi.tar.gz',
'/dist/v0.8.18/node-v0.8.18-linux-arm-pi.tar.gz',
'/dist/v0.8.19/node-v0.8.19-linux-arm-pi.tar.gz',
'/dist/v0.8.19/node-v0.8.19-linux-arm-pi.tar.gz',
'/dist/v0.8.20/node-v0.8.20-linux-arm-pi.tar.gz',
'/dist/v0.8.20/node-v0.8.20-linux-arm-pi.tar.gz',
'/dist/v0.8.21/node-v0.8.21-linux-arm-pi.tar.gz',
'/dist/v0.8.21/node-v0.8.21-linux-arm-pi.tar.gz',
'/dist/v0.8.22/node-v0.8.22-linux-arm-pi.tar.gz',
'/dist/v0.8.22/node-v0.8.22-linux-arm-pi.tar.gz',
'/dist/v0.9.10/node-v0.9.10-linux-arm-pi.tar.gz',
'/dist/v0.9.10/node-v0.9.10-linux-arm-pi.tar.gz',
'/dist/v0.9.11/node-v0.9.11-linux-arm-pi.tar.gz',
'/dist/v0.9.11/node-v0.9.11-linux-arm-pi.tar.gz',
'/dist/v0.9.12/node-v0.9.12-linux-arm-pi.tar.gz',
'/dist/v0.9.12/node-v0.9.12-linux-arm-pi.tar.gz',
'/dist/v0.9.7/node-v0.9.7-linux-arm-pi.tar.gz',
'/dist/v0.9.7/node-v0.9.7-linux-arm-pi.tar.gz',
'/dist/v0.9.8/node-v0.9.8-linux-arm-pi.tar.gz',
'/dist/v0.9.8/node-v0.9.8-linux-arm-pi.tar.gz',
'/dist/v0.9.9/node-v0.9.9-linux-arm-pi.tar.gz',
'/dist/v0.9.9/node-v0.9.9-linux-arm-pi.tar.gz' ]

ljharb added a commit that referenced this pull request Apr 26, 2015
adding architecture detection for Raspberry Pi 2
@ljharb ljharb merged commit 54d2d70 into nvm-sh:master Apr 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants