Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Add ARM CPU architectures #2253

Closed
wants to merge 1 commit into from
Closed

Add ARM CPU architectures #2253

wants to merge 1 commit into from

Conversation

jhermsmeier
Copy link
Contributor

This adds armv7 and armv8 cpu architectures to getHumanArchitecture()
in order to support running node-sass on ARM.

This adds armv7 and armv8 cpu architectures to `getHumanArchitecture()`
in order to support running node-sass on ARM.
@jhermsmeier
Copy link
Contributor Author

jhermsmeier commented Feb 19, 2018

Note, it installs and builds fine on ARM since some time after v4.5.3, it's just that this manual check prevents it from actually running – would it make sense to remove these manual checks entirely, or only display any platform related errors if loading the binding fails?

@nschonni
Copy link
Contributor

nschonni commented Mar 9, 2018

@jhermsmeier we will likely remove those checks in 5, and just rely on the node-pre-gyp syntax for people wanting different combos #2111

@xzyfer
Copy link
Contributor

xzyfer commented Mar 30, 2018

I'm curious where you for these values from? The installer gets these values from process.arch. According the documentation it return either arm or arm64.

https://nodejs.org/api/process.html#process_process_arch

@xzyfer
Copy link
Contributor

xzyfer commented Mar 30, 2018

Looking at the official downloads I see the following arm variations.

  • arm64
  • armv6l
  • armv7l

It's not clear to me if/how these map to just arm and arm64.

@jessaustin
Copy link

@xzyfer all three are different architectures. arm64 is sometimes labeled "v8", although I've never seen "armv8" as an architecture as included in this PR. aarch64 is indeed the same thing as arm64. As far as I can tell, "arm" by itself is not a thing. I don't know if there is a reason the armv6l architecture was left out of this PR?

@xzyfer
Copy link
Contributor

xzyfer commented Apr 18, 2018

We use the value of process.arch to determine which binary to download for the user. As stated in my previous comment the only official downloads I see the following arm variations.

  • arm64
  • armv6l
  • armv7l

We can only support the value returned by process.arch (on each of those downloads). I am unable to confirm those values since I don't have any arm devices to test on.

@jessaustin
Copy link

What you describe should be good enough:

$ uname -m -p -i
aarch64 aarch64 aarch64
$ node
> process.arch
'arm64'

However I only found this PR because of the following error I got while trying to install node-sass:

$ npm i --save-dev node-sass

> node-sass@4.8.3 install /home/jess/dev/first.site/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.8.3/linux-arm64-59_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.8.3/linux-arm64-59_binding.node": 

HTTP error 404 Not Found

It's expecting an "arm64" at that location, and it's not finding it. I'm thinking I'll try to just install the Github version, although I haven't figured that out yet.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 18, 2018 via email

@jessaustin
Copy link

jessaustin commented Apr 18, 2018

What can I do to help? My current chromebook is arm64, although I think I have a armv7l in a box in a closet somewhere.

Alternatively, the package could just fall back to attempting to build itself on the current installation machine. I guess that would be hard to test though.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 18, 2018

Honestly this issue is a dead lock until either

  • we can have access to arm hardware
    • i.e. arm based CI, or physical hardware
  • we onboard a community member who is available to
    • build the release binaries, and
    • ensure changes don't break arm compatibility

We are able to support linux, windows, osx, and alpine because we can either automate test and binary generation, or we have team members who take on that responsibility.


Related, in version 5 we will be relaxing the installation process to automatically fallback to a local compilation if a pre-built binary is not available for download.

This will at least lower the barrier to running on unsupported architectures. This comes at the cost of guaranteeing future releases will continue to work on those architectures.

@jessaustin
Copy link

Have the relevant v5 patches hit yet?

@xzyfer
Copy link
Contributor

xzyfer commented Apr 18, 2018

No. You can subscribe to #2312 for updates.

@jessaustin
Copy link

OK thanks I will.

@jhermsmeier
Copy link
Contributor Author

Honestly this issue is a dead lock until either

we can have access to arm hardware
i.e. arm based CI, or physical hardware

@xzyfer I'd be happy to donate a RPi, if that'd help

@vielmetti
Copy link

node-sass is a dependency for the new CNCF project harbor, which I'm currently trying to build on arm64. I'm tracking that effort at goharbor/harbor#6277 . I get the error

Cannot download "https://github.com/sass/node-sass/releases/download/v4.9.3/linux-arm64-64_binding.node": 

and now it's building the binary from sources.

I run the "Works on Arm" project, where we have a variety of options for getting CI and machine access for arm64 project - happy to talk to @xzyfer to see if we can't do something to provide resources to break the deadlock above.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 14, 2018 via email

@vielmetti
Copy link

I joined the Slack channel, @xzyfer !

@ossdev07
Copy link

ossdev07 commented Nov 15, 2018

Honestly this issue is a dead lock until either

  • we can have access to arm hardware

    • i.e. arm based CI, or physical hardware
  • we onboard a community member who is available to

    • build the release binaries, and
    • ensure changes don't break arm compatibility

We are able to support linux, windows, osx, and alpine because we can either automate test and binary generation, or we have team members who take on that responsibility.

Related, in version 5 we will be relaxing the installation process to automatically fallback to a local compilation if a pre-built binary is not available for download.

This will at least lower the barrier to running on unsupported architectures. This comes at the cost of guaranteeing future releases will continue to work on those architectures.

I can see that your concern is not having access to arm hardware. There is a CI available to run the project on arm.
Shippable is a CI where we can run the node-sass for arm64 architecture. We need to generate the shippable.yml file by which the package runs. https://app.shippable.com/

I was successfully able to generate the binary for node-sass on shippable.

@xzyfer I will be happy to provide any more information regarding it. It will be delight to see the binary available for arm64 architecture.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 15, 2018

Nothing on the shippable site mentions that it's specifically supports ARM. It has a BYO option but in that case I'd prefer to use buildkite.

@rhenwood-arm
Copy link

@xzyfer: yes, it isn't obvious to me either, but after digging: shippable make mention of their Arm support here:

https://www.shippable.com/continuous-delivery.html

**Run jobs on Ubuntu, Windows, MacOS, CentOS, RHEL7, and Arm nodes. You can even run jobs across different platforms in the same workflow! Use one platform for all your applications. **

@nschonni
Copy link
Contributor

Looks like Drone.io is doing free ARM builds now for OSS https://blog.drone.io/drone-cloud/
I'll give it a try

@nschonni
Copy link
Contributor

Kind of got a POC running https://cloud.drone.io/nschonni/node-sass/12/1/2 but since it is Docker based, it will probably only work when we drop the old Node versions

@xzyfer
Copy link
Contributor

xzyfer commented Nov 26, 2018

We only support Alpine for whatever versions there are official images for. I'm happy to offer limited version support for ARM too.

@rhenwood-arm
Copy link

Is there an update on this work - and if not, what can be done to move it forward?

@ossdev07
Copy link

Ping - @xzyfer. @nschonni

Any update on the ARM support?

@ossdev07
Copy link

ossdev07 commented Feb 8, 2019

Hi @xzyfer @nschonni

Sorry to bother you again.

I tried to build the node-sass binary for aarch64, using shippable CI.

You can see, the package build successfully on the aarch64 platform with node version v11.9.0 https://app.shippable.com/github/ossdev07/node-sass/runs/13/1/console

To run the package on shippable, you need the shippable.yml file and license.
I will be more than happy to provide my shippable.yml file, you can apply for the license and easily able to run it on the aarch64 platform.

It will be a delight to see the package supporting the aarch64 platform.

@sokoow
Copy link

sokoow commented Feb 11, 2019

I've same comments for armv6l (rpi zero) - still no support for it

$ uname -m -p -i
armv6l unknown unknown
$ node
> process.arch
'arm'

@sokoow sokoow mentioned this pull request Feb 11, 2019
@ossdev07
Copy link

ossdev07 commented Apr 3, 2019

Hi @xzyfer @nschonni

Is there any update for the ARM support?

Please let us known, if any help is required. Seeing the package supporting the aarch64 architecture will be a delight.

@ossdev07
Copy link

ossdev07 commented Apr 8, 2019

Hi @xzyfer

Please let us know if you are planning to release any arm-related support for the package.

@rhenwood-arm
Copy link

hi @jhermsmeier: I remain interested in this work (AArch64 and Armv7 support). It is unclear to me why this ticket has been closed. Please can you provide some more background to your decision?

@jhermsmeier
Copy link
Contributor Author

Hey @rhenwood-arm! It's more than a year old, my solution here is incorrect and outdated, and since I don't work on Etcher anymore, there's no real reason for me to spend time on this anymore (as I'm not a sass user myself). Further, I've offered to donate hardware (in order to test on ARM), but response and action has tailed off, and nothing really happened as far as I can gather.

So yeah, I'd say it's for someone else to pick up :) While there should be some CI services supporting ARM out there as mentioned in this thread, my offer to donate some HW (Raspberry Pis or so) still stands, in case it's still desired / needed.

@vielmetti
Copy link

Thanks @jhermsmeier - that's a good reason to close this particular PR.

@rhenwood-arm I think we can continue this forward by opening up a new issue to provide a current (not historic) diagnosis of the issue, reference this PR as an outdated option, and figure out next steps.

@rhenwood-arm
Copy link

Thanks for the background @jhermsmeier - yes. I agree with you @vielmetti . I guess two PRs are necessary: One to add in Arm* support and a second one to add CI/CD support (with Drone.io?). I have been working with @ossdev07 so I will ask them to proceed creating a new PR for this work.

@rhenwood-arm
Copy link

FYI: Travis-CI have announced multi-platform support: https://blog.travis-ci.com/2019-10-07-multi-cpu-architecture-support

@xzyfer
Copy link
Contributor

xzyfer commented Oct 31, 2019

Thanks, the Travis features look promising

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants