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

Build native extensions on M1 #223

Closed
wants to merge 1 commit into from
Closed

Conversation

bbuchalter
Copy link

We already support disabling this compilation flag anyway, so might as well just do it automatically for architectures that don't support it.

@bbuchalter
Copy link
Author

Hello, just a friendly poke.

Based on https://github.com/sass/sassc-ruby/graphs/contributors perhaps @bolandrm or @eregon could help?

@bbuchalter
Copy link
Author

Friendly ping here. 👋

@bbuchalter
Copy link
Author

Maybe @glebm or @edward could help?

if enable_config('march-tune-native', false)
# darwin arm doesn't support native
# see: https://github.com/sass/sassc-ruby/issues/222
if enable_config('march-tune-native', false) && Gem::Platform.local.cpu != 'arm64'
Copy link
Contributor

Choose a reason for hiding this comment

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

The default is already false, why is this change needed?

@bbuchalter
Copy link
Author

Upon further investigation, this issue only exists in versions prior to v2.3.0. It's not clear which commit fixes it, but this does address this error:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/brian.buchalter/.gem/ruby/2.7.4/gems/sassc-2.2.1/ext
/Users/brian.buchalter/.rubies/ruby-2.7.4/bin/ruby -I /Users/brian.buchalter/.rubies/ruby-2.7.4/lib/ruby/2.7.0 -r ./siteconf20210720-81997-w05u9w.rb extconf.rb
creating Makefile

current directory: /Users/brian.buchalter/.gem/ruby/2.7.4/gems/sassc-2.2.1/ext
make "DESTDIR=" clean

current directory: /Users/brian.buchalter/.gem/ruby/2.7.4/gems/sassc-2.2.1/ext
make "DESTDIR="
compiling ./libsass/src/units.cpp
clang: error: the clang compiler does not support '-march=native'
make: *** [units.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/brian.buchalter/.gem/ruby/2.7.4/gems/sassc-2.2.1 for inspection.
Results logged to /Users/brian.buchalter/.gem/ruby/2.7.4/extensions/arm64-darwin-20/2.7.0-static/sassc-2.2.1/gem_make.out

An error occurred while installing sassc (2.2.1), and Bundler cannot continue.
Make sure that `gem install sassc -v '2.2.1'` succeeds before bundling.

@bbuchalter bbuchalter closed this Jul 20, 2021
@bbuchalter bbuchalter deleted the patch-1 branch July 20, 2021 13:51
@bbuchalter
Copy link
Author

Per your comment, it was probably #158

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

Successfully merging this pull request may close these issues.

2 participants