sass / sassc-ruby

Use libsass with Ruby!
MIT License
366 stars 156 forks source link

debug usefulness #211

Open epipheus opened 4 years ago

epipheus commented 4 years ago

I have been noticing a pattern in sassc segfaults that every is having. There are several interesting ones and I think I can help eliminate most of them. 99% of the time, it crashes in engine.rb at the line status = Native.compile_data_context(data_context)

error messages look like this at compile time:

SassC::SyntaxError: Error: Invalid CSS after "}": expected 1 selector or at-rule, was ".,.check-success,.c"
        on line 23:2 of stdin
>> }

This is totally useless most of the time. Like I can't really look at line 23 of every single file and I should have to run scripts to find all files with the tiny snippet above. Sometimes a selector can be use in 100s of files!!

More often than not there is some stupid offending line in one of 30,000 files in a gemified vendor set of assets which is quite annoying to track down. I tend to track them down quite quickly by old school print statements. 100% of the time I track things down by printing out the full template being compiled before it crashes. The last one before the crash is the one. With the full template its much easier to fid the offending file but this is still quite ridiculous. Literally if your error message included the file name it would be lifechanging for all of us!!!

so why is filename ALWAYS nil in engine.rb!!!! This would save us soooo much! Is it always stdin from sassc's perspective and not a file? How is this fed from the rails asset precompile?

facundofarias commented 3 years ago

Hello @epipheus, any news on this? Thanks