Skip to content
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

Fix for "too many open files" error on OSX. #3183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tom-un
Copy link

@tom-un tom-un commented Dec 4, 2023

When using go-libsass (which uses libsass) 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!

bep added a commit to bep/golibsass that referenced this pull request Aug 28, 2024
bep added a commit to bep/golibsass that referenced this pull request Aug 28, 2024
bep added a commit to bep/golibsass that referenced this pull request Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant