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

fsevents fails to build on darwin macos sonoma 14.6 with error header file not found #65

Open
iamQ0 opened this issue Aug 20, 2024 · 0 comments

Comments

@iamQ0
Copy link

iamQ0 commented Aug 20, 2024

I'm trying to run testcontainers on sonoma 14.6.1 but fsevents which is listed as one of the dependencies, fails to build with the below error:

# github.com/fsnotify/fsevents
../../go/pkg/mod/github.com/fsnotify/[email protected]/wrap.go:7:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Below is my machine info:

❯ uname -v
Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6030

I have tried updating/installing XCode and CLTs but still it fails to build.

macOS: 14.6.1-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.4
Rosetta 2: false

Possible issue being :
In the newer versions of MacOS the headers files have been moved from/usr/include to Xcode bundle under /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk.
So fsevents is failing to build since its possibly trying to find the files in the original location.

This changed has been applied for new Mac and Xcode versions 10 and above.
Check release notes.

If you are the maintainer of such software, we encourage you to update your project to work with the SDK or file a bug report for issues that are preventing you from doing so

I have even tried setting appropriate CGO_CFLAGS and CGO_LDFLAGS before running :

#cgo CFLAGS: -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/System/Library/Frameworks/CoreServices.framework/Headers

#cgo LDFLAGS: -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -L/usr/lib -framework CoreServices

#include <CoreServices/CoreServices.h>
#include <sys/stat.h>

for cgo to find the header files under the Xcode.app location but the issue remains the same.

Please advice. Thank you!

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

No branches or pull requests

1 participant