sass / node-sass

:rainbow: Node.js bindings to libsass
https://npmjs.org/package/node-sass
MIT License
8.51k stars 1.33k forks source link

Apple ARM Support #3033

Open nschonni opened 4 years ago

nschonni commented 4 years ago

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.

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

woolfel commented 3 years ago

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

o-alquimista commented 3 years ago

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.

kycfeel commented 3 years ago

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.

xzyfer commented 3 years ago

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

Ton-O commented 3 years ago

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

woolfel commented 3 years ago

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 commented 3 years ago

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

aminroosta commented 3 years ago
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?

hoyangtsai commented 3 years ago

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)
             ^~~~~~~~~~~~~~~~~~~~~~~~
                        &
xzyfer commented 3 years ago

It should, in theory, compile eventually, although it's untested with node

  1. It can be very slow on r-pis.

On Thu, 31 Dec 2020, 6:38 pm Ho-Yang Tsai, notifications@github.com 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 .

hakey1408 commented 3 years ago

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!

nschonni commented 3 years ago

@connorlurring that's a different package

lexos-development commented 3 years ago

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. ;-)

Ton-O commented 3 years ago

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

cwagner22 commented 3 years ago

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

mzagaja commented 3 years ago

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
jhodapp commented 3 years ago

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!

MokryPatrik commented 3 years ago

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:

parreirat commented 3 years ago

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.

MokryPatrik commented 3 years ago

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

nschonni commented 3 years ago

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 commented 3 years ago

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 commented 1 year ago

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 commented 10 months ago

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