-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Fix inotify support to work with FreeBSD libinotify #39680
Conversation
FreeBSD provides a kqueue-inotify shim in the form of devel/libinotify. However, because it is not in an expected system location, it requires the full path. Otherwise it will fail as though inotify were not present. With this modification, corefx now accepts the libinotify shim, correctly identifies supported functions, and Just Works (for generous values of Works.)
should we add /usr/local/include to include path? cc: @joperator |
@wfurt this is actually a rather... odd one. There's some intentional kludginess with
It's something about that specific location that seems to throw things off. If I copy |
It looks like
So, I think we should better investigate why this is not being applied to the failed project ( |
BTW what version do you use @rootwyrm? I was mostly working on 11.1 |
@wfurt 11.1 is EOL, so should be upgraded to 11.2-RELEASE at minimum (11.3 is the latest.) I've been testing with both 11.3 and 12.0 plus -CURRENT intermittently (expected to not work, of course.) Also, are you using the base compiler (clang) or a compiler from ports? My suspicion is that something in there is just not at all happy with |
When I was working on this 12.x was not out yet :) And yes, I was using clang from distro. I also was not aware of libinotify. I'll give it try over the weekend. There were some cases when we had to pull in more headers. (like check_struct_has_member) With the source-build work, what version of FreeBSD do you have in mind @joperator? If 11.x is too old I can upgrade my VMs so we are more in sync. |
Ha! I know that feeling. 11.2, 11.3, and 12.0 are the current supported releases though, so the hope is for it to work on all of those (but failing to work on unsupported versions is entirely accepted, and failing to work on 11.x would also be accepted but not preferred.) I'm happy to help any way I can there as I have an existing internal poudriere infrastructure so I can test multiple versions easily. Pulling in the headers like you're talking about is definitely over my head - I'm not at all familiar with CMake. If you've got an idea there, I'm happy to test it. |
I put up #40202. |
I'm getting
when trying to run |
@@ -33,7 +33,10 @@ | |||
#elif HAVE_SENDFILE_4 | |||
#include <sys/sendfile.h> | |||
#endif | |||
#if HAVE_INOTIFY | |||
#if defined(__FreeBSD__) & defined(HAVE_INOTIFY) |
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.
This should not be defined(HAVE_NOTIFY), but rather just HAVE_INOTIFY. The cmake configuration always define that symbol, only its value indicates whether the config time check succeeded or not.
I think this got replaced with #40202. With work at dotnet/source-build#1139, we should be able to run corefx tests again and verify functionality. But I did not get to it. |
Yes, this was completed by #40202. I have tested and confirmed that is working as intended on FreeBSD - at least from within Mono builds - without any supplementary patching. Never did get any success with dotnet-install.sh due to missing FreeBSD binaries though. |
FreeBSD provides a kqueue-inotify shim in the form of devel/libinotify. However, because it is not in an expected system location, it requires the full path. Otherwise it will fail as though inotify were not present. With this modification, corefx now accepts the libinotify shim, correctly identifies supported functions, and Just Works (for generous values of Works.)