Skip to content
Snippets Groups Projects

Switch to sassc-rails

Merged Richard Macklin requested to merge rmacklin/gitlab-ce:switch-to-sassc into master
All threads resolved!

What does this MR do?

It replaces the sass-rails gem with the sassc-rails gem for faster compilation.

Are there points in the code the reviewer needs to double check?

No, the diff is straightforward.

Why was this MR needed?

It was requested in issue #18432 (closed), and generally faster compilation is a good thing :)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #18432 (closed)

More information

Without attempting to be very scientific here are some numbers I got:

Using sassc-rails:

[1] pry(main)> Benchmark.bm { |bm| bm.report { Rails.application.assets["application.css"] } }
user system total real
1.430000 0.380000 1.810000 ( 1.830753)

Using sass-rails:

[1] pry(main)> Benchmark.bm { |bm| bm.report { Rails.application.assets["application.css"] } }
user system total real
12.320000 0.530000 12.850000 ( 12.909684)

The result is faster page loads when changing CSS in development and faster precompilation.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    Compare with previous version

  • Richard Macklin resolved all discussions

    resolved all discussions

  • Robert Speicher enabled an automatic merge when the pipeline for d5e996d1 succeeds

    enabled an automatic merge when the pipeline for d5e996d1 succeeds

  • @rmacklin Great, thanks! :sparkles:

  • Robert Speicher mentioned in commit e7fdb1aa

    mentioned in commit e7fdb1aa

  • mentioned in issue #26762 (closed)

  • Contributor

    This is causing build failures on centos 6: https://gitlab.com/gitlab-org/gitlab-ce/issues/26762

  • Author Contributor

    Ah sorry, wasn't aware of the broad OS support. We can revert this to get it passing and then discuss how to proceed.

    Edited by Richard Macklin
  • Author Contributor

    Ok, so looking at https://gitlab.com/gitlab-org/gitlab-development-kit/blob/562538829153823ff628b376e09243b0460bc473/doc/prepare.md it seems GitLab supports a pretty wide variety of linux distros. Some questions from an outsider (totally fine if we don't have all the answers):

    Do we have any kind of automated way to test all supported environments against infrastructure changes like this one?

    If not, do we know (or have documented somewhere) what supported distros use older packages, and therefore are likely more susceptible to issues like this?

    From https://github.com/sass/libsass/pull/848#issuecomment-70639304, the libass maintainers mention that:

    Notably older CentOS users have very old compilers, lower than even we support.

    so is it possible that CentOS 6 is the only one we need to worry about for sassc?

    If that's the case, how would we feel about updating CentOS requirements to include installing a newer GCC (if on CentOS 6; it seems CentOS 7 isn't affected)?

    If we're against that, how would we feel about conditionally using sassc-rails and falling back to sass-rails in environments that can't compile libsass?

    As mentioned in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8556#note_21458451 I could also make it such that sassc-rails is only used in development; however if it's really only one distro that doesn't work with sassc-rails I'd probably lean towards making that environment the exception (but of course I'm not claiming to know best).

    As mentioned, it's okay if we don't have answers to all of this right now; just trying to share the questions that came to mind. Sorry for breaking builds :(

    Edited by Richard Macklin
  • @twk3 I haven't picked this into stable yet (so it may not go into rc4) - let me know if I should? I see the new issue is still open. /cc @rymai @dbalexandre @rspeicher

  • James Lopez mentioned in merge request !8642 (merged)

    mentioned in merge request !8642 (merged)

  • @jameslopez No need to pick if you follow the process I suggest in the linked comment.

  • Please register or sign in to reply
    Loading