node-sass icon indicating copy to clipboard operation
node-sass copied to clipboard

Apple ARM Support

Open nschonni opened this issue 4 years ago • 24 comments

Now that Apple is releasing ARM based chips, opening a general tracking issue. This will likely hit the same lack of CI support that we run into for general ARM support.

  • [ ] Need a CI provider to test and produce binaries
  • [ ] Updates to supported architecture

This would likely come as a 5.0.1 or later, and there is no plan to add support for older versions as per https://github.com/sass/node-sass#node-version-support-policy

nschonni avatar Nov 23 '20 20:11 nschonni

I just tried building a project on M1 Macbook air and got architecture not supported error. node sass does not yet support your current environment: os x unsupported architecture (arm64)

Is there instructions for building it on arm64? I can try building it and see how it goes. thanks

woolfel avatar Dec 12 '20 00:12 woolfel

Same for Raspberry Pi 4 :(

EDIT: for anyone trying to build assets on an ARM64 device such as the RPi4 with Webpack through sass-loader, you can get it working by replacing the dependency node-sass with sass.

o-alquimista avatar Dec 16 '20 11:12 o-alquimista

We really need official binary support for the ARM64 arch. ARM CPU is slowly but surely being an important part of computing. Since node-sass is a common dependency for JS projects, I'm sure that more and more users will face this issue and come to here.

kycfeel avatar Dec 17 '20 08:12 kycfeel

We'd love to support the new Apple M1 chips however we're blocked until there is a free hosted CI solution that supports that hardware. Currently we're tracking these issues for github actions

  • https://github.com/actions/virtual-environments/issues/2187
  • https://github.com/actions/runner/issues/805

xzyfer avatar Dec 17 '20 09:12 xzyfer

We'd love to support the new Apple M1 chips however we're blocked until there is a free hosted CI solution that supports that hardware. Currently we're tracking these issues for github actions

You could start with ARM on raspberry pi.... Many many solutions running on rpi....

Ton-O avatar Dec 17 '20 11:12 Ton-O

circleCI announced self-hosted here https://circleci.com/blog/self-hosted-runners-add-arm-support-to-circleci/

I'm willing to donate some raspberry pi4 if circleCI self-hosted is an option you want to consider.

woolfel avatar Dec 17 '20 14:12 woolfel

I have several raspberry pi that I can setup with circleCI self-hosted.

woolfel avatar Dec 17 '20 14:12 woolfel

yarn add sass
rm -rf node_modules/node-sass/ && mv node_modules/sass node_modules/node-sass

manually replacing node-sass with the npm sass module works for me. Does yarn or npm have a way to do this in package.json?

aminroosta avatar Dec 24 '20 04:12 aminroosta

When I tried to install node-sass@5 with node@15, recursively printing out these message below and never finish installation.

2 warnings generated.
  c++ -o Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o ../src/libsass/src/ast_fwd_decl.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/Users/xxx/Library/Caches/node-gyp/15.4.0/include/node -I/Users/xxx/Library/Caches/node-gyp/15.4.0/src -I/Users/xxx/Library/Caches/node-gyp/15.4.0/deps/openssl/config -I/Users/xxx/Library/Caches/node-gyp/15.4.0/deps/openssl/openssl/include -I/Users/xxx/Library/Caches/node-gyp/15.4.0/deps/uv/include -I/Users/xxx/Library/Caches/node-gyp/15.4.0/deps/zlib -I/Users/xxx/Library/Caches/node-gyp/15.4.0/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o.d.raw   -c
In file included from ../src/libsass/src/ast_fwd_decl.cpp:1:
../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' of type 'const
      std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>'
      [-Wrange-loop-analysis]
        for (const auto numerator : numerators)
                        ^
../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent
      copying
        for (const auto numerator : numerators)
             ^~~~~~~~~~~~~~~~~~~~~~
                        &
../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' of type 'const
      std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>'
      [-Wrange-loop-analysis]
        for (const auto denominator : denominators)
                        ^
../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent
      copying
        for (const auto denominator : denominators)
             ^~~~~~~~~~~~~~~~~~~~~~~~
                        &

hoyangtsai avatar Dec 31 '20 07:12 hoyangtsai

It should, in theory, compile eventually, although it's untested with node 15. It can be very slow on r-pis.

On Thu, 31 Dec 2020, 6:38 pm Ho-Yang Tsai, [email protected] wrote:

When I tried to install node-sass@5, recursively printing out these message below

2 warnings generated. c++ -o Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o ../src/libsass/src/ast_fwd_decl.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/Users/xxx/Library/Caches/node-gyp/15.4.0/include/node -I/Users/xxx/Library/Caches/node-gyp/15.4.0/src -I/Users/xxx/Library/Caches/node-gyp/15.4.0/deps/openssl/config -I/Users/xxx/Library/Caches/node-gyp/15.4.0/deps/openssl/openssl/include -I/Users/xxx/Library/Caches/node-gyp/15.4.0/deps/uv/include -I/Users/xxx/Library/Caches/node-gyp/15.4.0/deps/zlib -I/Users/xxx/Library/Caches/node-gyp/15.4.0/deps/v8/include -I../src/libsass/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o.d.raw -c In file included from ../src/libsass/src/ast_fwd_decl.cpp:1: ../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' of type 'const std::__1::basic_string' creates a copy from type 'const std::__1::basic_string' [-Wrange-loop-analysis] for (const auto numerator : numerators) ^ ../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::__1::basic_string &' to prevent copying for (const auto numerator : numerators) ^~~~~~~~~~~~~~~~~~~~~~ & ../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' of type 'const std::__1::basic_string' creates a copy from type 'const std::__1::basic_string' [-Wrange-loop-analysis] for (const auto denominator : denominators) ^ ../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::__1::basic_string &' to prevent copying for (const auto denominator : denominators) ^~~~~~~~~~~~~~~~~~~~~~~~ &

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sass/node-sass/issues/3033#issuecomment-752877293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAENSWAX5NCPETX2IZMBMJ3SXQS6ZANCNFSM4T77ZYFA .

xzyfer avatar Dec 31 '20 10:12 xzyfer

Hi, I'm facing this error when running compilation with MB Air M1: Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (88) For more information on which environments are supported please see: Apple silicon support would be great!

hakey1408 avatar Dec 31 '20 13:12 hakey1408

@connorlurring that's a different package

nschonni avatar Jan 01 '21 01:01 nschonni

We'd love to support the new Apple M1 chips however we're blocked until there is a free hosted CI solution that supports that hardware. Currently we're tracking these issues for github actions

You could start with ARM on raspberry pi.... Many many solutions running on rpi....

Might be true, but since it never run on raspberry pi's before, but was used by a huge number of developers on Macs, Mac should be prioritised. Anyway, raspberry pi should follow up if possible. ;-)

lexos-development avatar Jan 05 '21 20:01 lexos-development

We'd love to support the new Apple M1 chips however we're blocked until there is a free hosted CI solution that supports that hardware. Currently we're tracking these issues for github actions

You could start with ARM on raspberry pi.... Many many solutions running on rpi....

Might be true, but since it never run on raspberry pi's before, but was used by a huge number of developers on Macs, Mac should be prioritised. Anyway, raspberry pi should follow up if possible. ;-)

Chicken and egg.......... If there's no solution for pi, its not going to run there; if there's no possibility to deliver support for new M1, then close that other gap

Ton-O avatar Jan 06 '21 08:01 Ton-O

I've worked with a macbook m1 chip 8gb of ram for almost a month. Each day has been painfully slow because of being stuck with nodejs 14 since node-sass doesn't work with the arm version of nodejs. I'm finally giving up and upgrading to 16gb ram...

cwagner22 avatar Jan 13 '21 20:01 cwagner22

For Google wanderers like me trying to get their node-sass working on the site in the meantime the magic trick to use Rosetta 2 is:

rm -rf node_modules
npm install --target_arch=x64

mzagaja avatar Jan 19 '21 22:01 mzagaja

Same for Raspberry Pi 4 :(

EDIT: for anyone trying to build assets on an ARM64 device such as the RPi4 with Webpack through sass-loader, you can get it working by replacing the dependency node-sass with sass.

This workaround seems to have done the trick for me on Ubuntu on an RPi4. Thanks!

jhodapp avatar Jan 23 '21 21:01 jhodapp

Hi, I'm facing same error when running on MB Pro M1 (16GB RAM): Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (88) For more information on which environments are supported please see:

MokryPatrik avatar Jan 25 '21 07:01 MokryPatrik

For Google wanderers like me trying to get their node-sass working on the site in the meantime the magic trick to use Rosetta 2 is:

rm -rf node_modules
npm install --target_arch=x64

Did not work for me, will still output architecture not supported - ended up switching to sass as a temporary workaround.

parreirat avatar Jan 25 '21 12:01 parreirat

This worked for me https://stackoverflow.com/a/64902152, not the cleanest solution but it works without any modifications in the project.

MokryPatrik avatar Jan 25 '21 12:01 MokryPatrik

Locked the thread as per the first issue, this is about tracking when we'll officially support these builds. We can't till GitHub actions adds support

nschonni avatar Jan 25 '21 14:01 nschonni

From @Peredery in #3157, it looks like GA for macOS 11 pool should be generally available in the next week or so https://github.com/actions/virtual-environments/issues/2486#issuecomment-885458538

nschonni avatar Jul 26 '21 14:07 nschonni

Looks like the runners are available https://github.com/actions/runner-images/issues/8439

edit: looks like it's still paid only, so we're not there yet

nschonni avatar Oct 02 '23 20:10 nschonni

Runner support landed for OSS https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/ Starting to test it out in https://github.com/sass/node-sass/pull/3390

nschonni avatar Jan 31 '24 06:01 nschonni