-
Notifications
You must be signed in to change notification settings - Fork 158
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
sassc is very slow to compile and install #189
Comments
For comparison, nokogiri 1.10.9 takes 30 seconds to compile:
libxml2 is a much larger library than libsass (200k C SLOC vs 22k C++ SLOC), but probably part of why it compiles faster is it's C instead of C++. |
@eregon Enable parallel compilation or do a unity bulid |
See sparklemotion/nokogiri#1983 (comment) regarding what nokogiri does. I'm not sure what they do to deal with alpine but the binary gem seems to work with alpine/musl. @glebm Could you clarify the main issue(s) with having precompiled gems for linux/macos for sassc? |
@eregon The main issue is libc. RubyGems does not allow targeting different versions of libc. This is a deficiency in RubyGems. A libc cannot be linked statically for this project, one of the reasons being that plugins are loaded using dlopen. |
Right. It seems for Nokogiri they just dynamically link to glibc (the default) and apparently in that case it seems binary compatible with musl (I checked with |
This is undefined behaviour, and won't work with ucLibc or even older glibc. There is an open PR in the Nokogiri repo that removes the use of |
Adding more data about the impact of this: I came to realise that Jekyll depends on This makes Jekyll (fairly popular) quite slow to deploy on platforms like Netlify (see https://community.netlify.com/t/ruby-gems-cache-seems-to-be-ineffective/14821 for an example, the install times is above 3 minutes. Caching is another problem ^_^). I've opened an issue at jekyll/jekyll#8184 to evaluate if Not sure what can be done and how I could help either yet, so for now just providing this data. |
If anyone finds this helpful, here is where it actually takes 2 minutes (I installed gns@gns-mac1 ~ % docker run -it ruby:latest /bin/bash root@4f4bf2280063:/# time gem install ffi Building native extensions. This could take a while... Successfully installed ffi-1.13.1 1 gem installed real 0m7.137s user 0m5.407s sys 0m1.055s root@4f4bf2280063:/# time gem install sassc --verbose HEAD https://rubygems.org/api/v1/dependencies 200 OK GET https://rubygems.org/api/v1/dependencies?gems=sassc 200 OK GET https://rubygems.org/quick/Marshal.4.8/sassc-2.4.0.gemspec.rz 200 OK GET https://rubygems.org/api/v1/dependencies?gems=ffi 200 OK Downloading gem sassc-2.4.0.gem GET https://rubygems.org/gems/sassc-2.4.0.gem Fetching sassc-2.4.0.gem 200 OK /usr/local/bundle/gems/sassc-2.4.0/.gitignore /usr/local/bundle/gems/sassc-2.4.0/.gitmodules /usr/local/bundle/gems/sassc-2.4.0/.travis.yml /usr/local/bundle/gems/sassc-2.4.0/CHANGELOG.md /usr/local/bundle/gems/sassc-2.4.0/CODE_OF_CONDUCT.md /usr/local/bundle/gems/sassc-2.4.0/Gemfile /usr/local/bundle/gems/sassc-2.4.0/LICENSE.txt /usr/local/bundle/gems/sassc-2.4.0/README.md /usr/local/bundle/gems/sassc-2.4.0/Rakefile /usr/local/bundle/gems/sassc-2.4.0/ext/depend /usr/local/bundle/gems/sassc-2.4.0/ext/extconf.rb /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/VERSION /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/contrib/plugin.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/include/sass.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/include/sass/base.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/include/sass/context.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/include/sass/functions.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/include/sass/values.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/include/sass/version.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/include/sass2scss.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/MurmurHash2.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast2c.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast2c.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_def_macros.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_fwd_decl.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_fwd_decl.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_helpers.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_sel_cmp.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_sel_super.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_sel_unify.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_sel_weave.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_selectors.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_selectors.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_supports.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_supports.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_values.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ast_values.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/b64/cencode.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/b64/encode.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/backtrace.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/backtrace.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/base64vlq.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/base64vlq.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/bind.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/bind.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/c2ast.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/c2ast.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/c99func.c /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/cencode.c /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/check_nesting.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/check_nesting.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/color_maps.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/color_maps.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/constants.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/constants.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/context.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/context.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/cssize.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/cssize.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/dart_helpers.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/debug.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/debugger.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/emitter.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/emitter.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/environment.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/environment.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/error_handling.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/error_handling.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/eval.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/eval.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/eval_selectors.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/expand.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/expand.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/extender.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/extender.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/extension.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/extension.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/file.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/file.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_colors.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_colors.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_lists.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_lists.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_maps.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_maps.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_miscs.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_miscs.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_numbers.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_numbers.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_selectors.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_selectors.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_strings.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_strings.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_utils.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/fn_utils.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/inspect.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/inspect.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/json.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/json.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/kwd_arg_macros.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/lexer.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/lexer.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/listize.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/listize.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/mapping.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/memory.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/memory/allocator.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/memory/allocator.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/memory/config.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/memory/memory_pool.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/memory/shared_ptr.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/memory/shared_ptr.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/operation.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/operators.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/operators.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/ordered_map.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/output.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/output.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/parser.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/parser.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/parser_selectors.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/permutate.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/plugins.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/plugins.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/position.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/position.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/prelexer.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/prelexer.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/remove_placeholders.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/remove_placeholders.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/sass.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/sass.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/sass2scss.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/sass_context.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/sass_context.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/sass_functions.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/sass_functions.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/sass_values.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/sass_values.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/settings.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/source.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/source.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/source_data.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/source_map.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/source_map.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/stylesheet.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/stylesheet.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/to_value.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/to_value.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/units.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/units.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/utf8.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/utf8/checked.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/utf8/core.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/utf8/unchecked.h /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/utf8_string.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/utf8_string.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/util.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/util.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/util_string.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/util_string.hpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/values.cpp /usr/local/bundle/gems/sassc-2.4.0/ext/libsass/src/values.hpp /usr/local/bundle/gems/sassc-2.4.0/lib/sassc.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/dependency.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/engine.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/error.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/functions_handler.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/import_handler.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/importer.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/native.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/native/native_functions_api.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/native/sass2scss_api.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/native/sass_input_style.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/native/sass_output_style.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/native/sass_value.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/native/string_list.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/sass_2_scss.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/functions.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value/bool.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value/color.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value/list.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value/map.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value/number.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value/string.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value_conversion.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value_conversion/base.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value_conversion/bool.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value_conversion/color.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value_conversion/list.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value_conversion/map.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value_conversion/number.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/script/value_conversion/string.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/util.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/util/normalized_map.rb /usr/local/bundle/gems/sassc-2.4.0/lib/sassc/version.rb /usr/local/bundle/gems/sassc-2.4.0/sassc.gemspec /usr/local/bundle/gems/sassc-2.4.0/test/custom_importer_test.rb /usr/local/bundle/gems/sassc-2.4.0/test/engine_test.rb /usr/local/bundle/gems/sassc-2.4.0/test/error_test.rb /usr/local/bundle/gems/sassc-2.4.0/test/fixtures/paths.scss /usr/local/bundle/gems/sassc-2.4.0/test/functions_test.rb /usr/local/bundle/gems/sassc-2.4.0/test/native_test.rb /usr/local/bundle/gems/sassc-2.4.0/test/output_style_test.rb /usr/local/bundle/gems/sassc-2.4.0/test/sass_2_scss_test.rb /usr/local/bundle/gems/sassc-2.4.0/test/test_helper.rb Building native extensions. This could take a while... current directory: /usr/local/bundle/gems/sassc-2.4.0/ext ["/usr/local/bin/ruby", "-I", "/usr/local/lib/ruby/2.7.0", "-r", "./siteconf20200712-167-n5du3e.rb", "extconf.rb"] creating Makefile current directory: /usr/local/bundle/gems/sassc-2.4.0/ext "make \"DESTDIR=\" clean" current directory: /usr/local/bundle/gems/sassc-2.4.0/ext "make \"DESTDIR=\"" This is where it took ~2 minutes. compiling ./libsass/src/ast.cpp compiling ./libsass/src/ast2c.cpp compiling ./libsass/src/ast_fwd_decl.cpp compiling ./libsass/src/ast_sel_cmp.cpp compiling ./libsass/src/ast_sel_super.cpp compiling ./libsass/src/ast_sel_unify.cpp compiling ./libsass/src/ast_sel_weave.cpp compiling ./libsass/src/ast_selectors.cpp compiling ./libsass/src/ast_supports.cpp compiling ./libsass/src/ast_values.cpp compiling ./libsass/src/backtrace.cpp compiling ./libsass/src/base64vlq.cpp compiling ./libsass/src/bind.cpp compiling ./libsass/src/c2ast.cpp compiling ./libsass/src/c99func.c compiling ./libsass/src/cencode.c compiling ./libsass/src/check_nesting.cpp compiling ./libsass/src/color_maps.cpp compiling ./libsass/src/constants.cpp compiling ./libsass/src/context.cpp compiling ./libsass/src/cssize.cpp compiling ./libsass/src/emitter.cpp compiling ./libsass/src/environment.cpp compiling ./libsass/src/error_handling.cpp compiling ./libsass/src/eval.cpp compiling ./libsass/src/eval_selectors.cpp compiling ./libsass/src/expand.cpp compiling ./libsass/src/extender.cpp compiling ./libsass/src/extension.cpp compiling ./libsass/src/file.cpp compiling ./libsass/src/fn_colors.cpp compiling ./libsass/src/fn_lists.cpp compiling ./libsass/src/fn_maps.cpp compiling ./libsass/src/fn_miscs.cpp compiling ./libsass/src/fn_numbers.cpp compiling ./libsass/src/fn_selectors.cpp compiling ./libsass/src/fn_strings.cpp compiling ./libsass/src/fn_utils.cpp compiling ./libsass/src/inspect.cpp compiling ./libsass/src/json.cpp compiling ./libsass/src/lexer.cpp compiling ./libsass/src/listize.cpp compiling ./libsass/src/memory/allocator.cpp compiling ./libsass/src/memory/shared_ptr.cpp compiling ./libsass/src/operators.cpp compiling ./libsass/src/output.cpp compiling ./libsass/src/parser.cpp compiling ./libsass/src/parser_selectors.cpp compiling ./libsass/src/plugins.cpp compiling ./libsass/src/position.cpp compiling ./libsass/src/prelexer.cpp compiling ./libsass/src/remove_placeholders.cpp compiling ./libsass/src/sass.cpp compiling ./libsass/src/sass2scss.cpp compiling ./libsass/src/sass_context.cpp compiling ./libsass/src/sass_functions.cpp compiling ./libsass/src/sass_values.cpp compiling ./libsass/src/source.cpp compiling ./libsass/src/source_map.cpp compiling ./libsass/src/stylesheet.cpp compiling ./libsass/src/to_value.cpp compiling ./libsass/src/units.cpp compiling ./libsass/src/utf8_string.cpp compiling ./libsass/src/util.cpp compiling ./libsass/src/util_string.cpp compiling ./libsass/src/values.cpp linking shared-object sassc/libsass.so current directory: /usr/local/bundle/gems/sassc-2.4.0/ext "make \"DESTDIR=\" install" /usr/bin/install -c -m 0755 libsass.so ./.gem.20200712-167-sm6aue/sassc current directory: /usr/local/bundle/gems/sassc-2.4.0/ext /usr/local/bin/ruby -I /usr/local/lib/ruby/2.7.0 -r ./siteconf20200712-167-n5du3e.rb extconf.rb current directory: /usr/local/bundle/gems/sassc-2.4.0/ext make "DESTDIR=" clean current directory: /usr/local/bundle/gems/sassc-2.4.0/ext make "DESTDIR=" current directory: /usr/local/bundle/gems/sassc-2.4.0/ext make "DESTDIR=" install Successfully installed sassc-2.4.0 1 gem installed real 2m21.017s user 2m11.993s sys 0m8.384s |
This has always taken a lot of time to install, however, for some reason, lately this started taking over 10 minutes to install in Travis, which makes it cancel the build completely. Although I can work around this, it's odd that this should really take over 10 minutes to install. It also wasn't a one-off thing, travis quit when attempting to install sassc 10+ times in a row now. Are there any more clever work arounds than increasing Travis' timeout limit? |
Turns out that it's only bloody slow when it is installing with "native extensions". 🤔 |
Got the same issue on netlify, took 5-10 minutes to install sassc 2.4.0. |
same case here, it takes more than 9 minutes to install causing the cancelation of the bundle install :/ |
Similar story here, our build time is clocking in at 13mins at the moment which is mostly spent compiling sassc (with native extensions) |
Up to version 2.1.0, sassc shipped precompiled Linux binaries, but as of 2.2.0, the only precompiled versions are for mingw32. The problem, apparently (#141) was that on Alpine Linux (common in Docker images) rubygems would download the "Linux" version, precompiled with Other gems (Nokogiri is one I've noticed in particular) seem to get around this somehow, though, using the precompiled version on Debian and RedHat and other In the meantime, a workaround might be to pin |
Regarding precompiled binaries, see #189 (comment) and before. |
A good way forward would be to consider the libc in RubyGems when checking for precompiled gems. Anyone interested to fix that? |
A workaround until then could be to use separate release versions for "precompiled" and "not", like libv8 does. |
It's definitely not a guarantee enough, see my comment over here. From experience maintaining a We have another binary gem, called
IIRC the reason is that on some Alpine systems, Ruby ends up being set up to pick the non-binary gems only, and so never reaches to the |
Hi there, we had this issue and found some others already mentioned by @lloeki. We avoid rebuilding binary gems altogether by hosting our own gem repo with geminabox and gem-compiler, but due to rubygems/rubygems#3174 the repo can only host binary gems built for musl (and a single musl version at that). |
This is still an ongoing issue on new installs for me as well. |
Are there plans to address this, specifically shipping pre-compiled binaries for Debian or other popular distros? |
For me it took longer, but it worked perfectly. |
I'm not sure if this is any use, but the wkhtmltopdf-binary gem includes precompiled binaries for a numbers of platforms, and will just pick the most appropriate one at runtime. This of course trades disk space for cpu cycles, but it could be a nice option to offer? I know I'd take it. |
Holy cow...this took over 13 mins to install |
ideally we'd remove sassc as we make no use of it but in the meantime: sass/sassc-ruby#189 (comment)
ideally we'd remove sassc as we make no use of it but in the meantime: sass/sassc-ruby#189 (comment)
ideally we'd remove sassc as we make no use of it but in the meantime: sass/sassc-ruby#189 (comment)
ideally we'd remove sassc as we make no use of it but in the meantime: sass/sassc-ruby#189 (comment)
ideally we'd remove sassc as we make no use of it but in the meantime: sass/sassc-ruby#189 (comment)
ideally we'd remove sassc as we make no use of it but in the meantime: sass/sassc-ruby#189 (comment)
ideally we'd remove sassc as we make no use of it but in the meantime: sass/sassc-ruby#189 (comment)
Recent updates of Alpine / Sassc has resulted in very slow compile time for this version. Temporarily revert to 2.1.0 until this issue has been fixed upstream. More here: sass/sassc-ruby#189
Recent updates of Alpine / Sassc has resulted in very slow compile time for this version. Temporarily revert to 2.1.0 until this issue has been fixed upstream. More here: sass/sassc-ruby#189
Recent updates of Alpine / Sassc has resulted in very slow compile time for this version. Temporarily revert to 2.1.0 until this issue has been fixed upstream. More here: sass/sassc-ruby#189
For those dealing with this issue in their Rails app(s), I was able to replace this gem with https://github.com/rails/cssbundling-rails by following this helpful article: https://dev.to/kolide/how-to-migrate-a-rails-6-app-from-sass-rails-to-cssbundling-rails-4l41 |
This is still an issue, it takes about 20 minutes on my docker machine. |
Still an issue |
I think the damage this issue is doing to the adoption of RoR and Ruby and contributing to the downfall of these tools is underestimated. Unfortunately I don't have enough knowledge to collaborate on a solution. It's pitiful... |
@Pablushka @dancingMonkey @aamejia @h0jeZvgoxFepBQ2C *** ATTENTION *** LibSass is deprecated. SASSC-RUBY depends on LibSass. Ruby on Rails has moved away from using this gem. You should not be using this gem. *** WHAT TO DO *** Most people have experienced this issue during an upgrade. Most gems and apps that previously required or depended on this library are now using a new library. Consider updating any gems or apps that depend on this library to a newer version and it will likely no longer require this gem. Updating your various required gems or Rails version is often enough to fix this issue as the new versions shouldn't be requiring or referencing this gem.Sometimes just commenting out the "sassc-ruby" or "sassc" gem requirements in your Gemfile may be enough, although this may cause other errors to then trace and resolve. Dart Sass is a new implementation of Sass if you want to look into it. https://github.com/rails/dartsass-rails Note: This advice is provided without any warranties or represenations of any kind. |
The problem is that we are using the sass-rails gem, which is dependent on sassc-rails. |
also you can use gem-compiler to build sassc an prevent this and other
binary gems to build every time.
|
It looks like there is a lot of interest in this issue, can we come up with a solution as a community? What needs to be done here, what can I do? |
@arianitu TBH since libsass is deprecated, I think the direction people are going is to stop using If you have Sprockets or other libraries that still depend on |
the only maintainer of this gem is silent for 3 years, so I don't really expect any solution. The only option would be to fork the gem. or use an alternative. Even if it isn't 100% compatible https://github.com/ntkme/sass-embedded-host-ruby does work with sprockets or standalone. It shouldn't take much effort to migrate a legacy project, it works with all ruby implementations and the installation is quick because it's precompiled, see #220 |
FWIW, here are numbers from today on my current Linux desktop on CRuby 3.1.3:
So setting |
For an older app, we were spending ~8 mins on sassc in our Docker installs. It was painful because any Gemfile change invalidated the Docker layer for the Since this gem feels unlikely to get a new release, we took the lowest lift approach here and are doing a This means the sassc install is cached in its own layer and the bundle install uses the sassc gem on disk. While the flag changes suggested here save real time, having the install cached means future builds spend zero seconds on sassc. |
Thanks this is a really great hint! ❤️ |
Thank you @semanticart |
@glebm A lot of time has passed, and things have gotten better in the toolchain.
(Note that the It may be worth giving precompiled builds another try, I'd be happy to help if this is still interesting to the maintainers. |
When doing a
bundle install
for a new Rails 6 app, I noticed most of the time is spent compilingsassc
(libsass really).This takes easily up to 2 minutes on Linux, which feels really slow for one gem.
A bit of a Nokogiri-like experience if you see what I mean.
Speaking of Nokogiri, they now have a prerelease gem installing in just 1 second, maybe we can use a similar approach?
I'm not sure what's the best way to address this but here are some ideas:
-flto
might slow things down but actually it seems to speed up compilation withg++ 8.3.1
!time gem install sassc -- --disable-lto
takes113.71s user 6.01s system 99% cpu 2:00.70 total
.Disabling all flags gives:
time gem install sassc -- --disable-lto --disable-march-tune-native --disable-static-stdlib
=>109.80s user 5.63s system 99% cpu 1:56.12 total
.That already builds quite a bit faster:
I would think the main gain there is that's compiled with
-O2
:instead of (with
gem install sassc
):We can also parallelize it (I have 4 cores + 4 hyperthreads, i7-7700HQ CPU @ 2.80GHz):
That's a reasonable install time!
Using just the MAKEFLAGS approach with
gem install
is not quite enough:cc @bolandrm @glebm
Relates to #132
The text was updated successfully, but these errors were encountered: