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
Work around compilation failure with old Apple SDKs #6602
Conversation
When building fish-shell with the macOS 10.12 SDK, <sys/proc.h> does not include <sys/time.h> but references `struct itimerval`. This causes a compilation failure if we don't import <sys/time.h> ourselves. This was previously masked by an import of <sys/sysctl.h>, which was removed in fc0c39b.
@@ -17,6 +17,7 @@ | |||
#include <procfs.h> | |||
#endif | |||
#if __APPLE__ | |||
#include <sys/time.h> // Required to build with old SDK versions |
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.
possibly make this an IWYU pragma?
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'm not set up to run IWYU so I don't know if it would even flag this. We do use something from this file, it's just that in newer SDKs it's redundant because <sys/proc.h>
includes it.
Could hide it behind a check specifically for the 10.12 SDK or older before including it. Not really going to make a difference though. |
@floam I don't know which SDK added the |
SGTM! I think we're definitely going to have to do a 3.1.1, so I'll add this to the milestone and cherry-pick it when I get a chance. |
I've just merged this now, as-is, because it fixes what it purports properly. I think we'd have to re-check a bunch of includes anyway if we reran IWYU (I think the last time was in 2017?). |
When building fish-shell with the macOS 10.12 SDK,
<sys/proc.h>
does not include<sys/time.h>
but referencesstruct itimerval
. This causes a compilation failure if we don't import<sys/time.h>
ourselves.This was previously masked by an import of
<sys/sysctl.h>
, which was removed in fc0c39b.This fixes a build failure when building Fish using Nix, as Nix is currently on the macOS 10.12 SDK.