When using go-libsass on a Mac on OSX 14.1.1, it would fail with "File to import not found or unreadable: " errors.
The issue is in libsass in the read_file function in file.cpp. On non-_WIN32 OS's it uses std::ifstream to read the file. On OSX it always fails with strerror(errno) saying "Failure: too many open files".
On my system, ulimit and ulimit -n return the default "unlimited" / 256. So I tried raising it in /Library/LaunchDaemons/limit.maxfiles.plist but it still didn't help.
I tried reverting the most recent change in file.cpp which used fopen instead of std::ifstream. It still failed.
So, I tried using the Darwin open/read and it works!
When using go-libsass on a Mac on OSX 14.1.1, it would fail with "File to import not found or unreadable: " errors.
The issue is in libsass in the
read_file
function infile.cpp
. On non-_WIN32 OS's it usesstd::ifstream
to read the file. On OSX it always fails withstrerror(errno)
saying "Failure: too many open files".On my system,
ulimit
andulimit -n
return the default "unlimited" / 256. So I tried raising it in/Library/LaunchDaemons/limit.maxfiles.plist
but it still didn't help.I tried reverting the most recent change in
file.cpp
which usedfopen
instead ofstd::ifstream
. It still failed.So, I tried using the Darwin
open
/read
and it works!