Skip to content

Commit 5d084c0

Browse files
committed
Try this one trick to remove seg faults
Using Sassc and Sprockets seems somewhat prone to segmentation faults which seems to be a common issue with Sprockets 4. As per rails/sprockets#633 and sass/sassc-ruby#207, switching concurrent asset generation seems to resolve the problem. The unproven theory is that this reflects that Sprockets 4 uses threads which causes problems for sassc. A consequence of this is that asset pre-compilation may be slower than it could be.
1 parent f20caa5 commit 5d084c0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

config/initializers/assets.rb

+7
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,10 @@
1515
#{__dir__}/../../node_modules/govuk-frontend/
1616
#{__dir__}/../../node_modules/
1717
]
18+
19+
# We've experienced segmentation faults when pre-compiling assets with libsass.
20+
# Disabling Sprockets 4's export_concurrent setting seems to resolve the issues
21+
# see: https://github.com/rails/sprockets/issues/633
22+
Rails.application.config.assets.configure do |env|
23+
env.export_concurrent = false if env.respond_to?(:export_concurrent=)
24+
end

0 commit comments

Comments
 (0)