-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
feat: Set darwin cflags fd_setsize
and darwin_unlimited_select
#480
feat: Set darwin cflags fd_setsize
and darwin_unlimited_select
#480
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will not comment on the specific added cflags because I do not know darwin.
To avoid duplication, you should add cflags here.
To support __structuredAttrs
, those flags should be added like this:
env = old.env or { } // {
CFLAGS = env.CFLAGS or "" + self.lib.optionalString self.stdenv.hostPlatform.isDarwin " -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT ";
}
Probably, CFLAGS
should be changed to NIX_CFLAGS_COMPILE
.
fc0a950
to
80cc298
Compare
@jian-lin, thank you for your review and guidance. I couldn’t get Please let me know if there are any other changes that are needed. |
What is the error when you try Ah, I had a typo in my previous code: I just tested the following code and it compiled fine. env = old.env or { } // {
NIX_CFLAGS_COMPILE = (old.env.NIX_CFLAGS_COMPILE or "") + self.lib.optionalString self.stdenv.hostPlatform.isDarwin " -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT ";
}; Please use this code if it works. This PR should be created in Nixpkgs instead of emacs-overlay and modify this code. I searched github for nix code containing |
@jian-lin there were no errors I just didn't see I know this isn't nix but but it is specific to macOS only: railwaycat/homebrew-emacsmacport#338 Let me see if there is a better way to test and show emacs behaving when these options are passed in or not passed in. |
I believe both
|
80cc298
to
d443751
Compare
EDIT I switched to your nix code and it is working. Only way I know to confirm is by running in emacs gu: Only a build without One reason I would say use CFLAGS:
|
LGTM As I said above, this change should go into Nixpkgs instead of emacs-overlay. Could you create a PR there? I am happy to merger it. |
Thanks for the review. Hoping to have a pr to nixpkgs master today. |
@jian-lin closing this since I have opened NixOS/nixpkgs#391407 |
Great, so the sane people should go back to a completely custom overlay to remove this hack? This screams of a severe local misconfiguration. |
I’m not sure if you’re open to this change. If not, we can close this PR.
I’ve been having issues with macOS when I have too many files open. I’ve been testing this for a few weeks, and I haven’t encountered any more errors from Emacs about too many files open.
Prior work
d12frosted/homebrew-emacs-plus@4b34ed7
Context
https://en.liujiacai.net/2022/09/03/emacs-maxopenfiles/