DmitryOlshansky / photon

Photon - an experimental transparent Fiber scheduler and event-loop for DLang
Boost Software License 1.0
37 stars 3 forks source link

Support OS X #20

Closed belm0 closed 6 months ago

belm0 commented 6 years ago

Here are immediate compile errors seen on OS X. Pointing to need for event notification (libevent?) and timer abstractions. There's also a shared issue with OS X pthread_t.

$ ninja
[7/21] Compiling D object 'src/src@@photon@sha/photon_linux_core.d.o'.
FAILED: src/src@@photon@sha/photon_linux_core.d.o
dmd -Isrc/src@@photon@sha -Isrc -I../src -color=on -wi -g -fPIC   -of'src/src@@photon@sha/photon_linux_core.d.o' -c ../src/photon/linux/core.d
../src/photon/linux/core.d(94): Error: undefined identifier `itimerspec`
../src/photon/linux/core.d(98): Error: undefined identifier `timerfd_settime`
../src/photon/linux/core.d(102): Error: undefined identifier `itimerspec`
../src/photon/linux/core.d(103): Error: undefined identifier `timerfd_settime`
../src/photon/linux/core.d(112): Error: undefined identifier `timerfd_create`
../src/photon/linux/core.d(548): Error: undefined identifier `epoll_event`
../src/photon/linux/core.d(551): Error: undefined identifier `epoll_ctl`
../src/photon/linux/core.d(113): Error: template instance `photon.linux.core.interceptFd!cast(Fcntl)1048575` error instantiating
../src/photon/linux/core.d(403): Error: undefined identifier `epoll_create1`
../src/photon/linux/core.d(409): Error: undefined identifier `signalfd`, did you mean function `signal`?
../src/photon/linux/core.d(411): Error: undefined identifier `epoll_event`
../src/photon/linux/core.d(414): Error: undefined identifier `epoll_ctl`
../src/photon/linux/core.d(419): Error: undefined identifier `epoll_ctl`
../src/photon/linux/core.d(434): Error: cannot implicitly convert expression `pthread_create(& eventLoop, null, & processEventsEntry, null)` of type `int` to `shared(_opaque_pthread_t*)`
../src/photon/linux/core.d(440): Error: function `core.sys.posix.pthread.pthread_join(_opaque_pthread_t*, void**)` is not callable using argument types `(shared(_opaque_pthread_t*), void**)`
../src/photon/linux/core.d(440):        cannot pass argument `eventLoop` of type `shared(_opaque_pthread_t*)` to parameter `_opaque_pthread_t*`
../src/photon/linux/core.d(446): Error: undefined identifier `epoll_event`
../src/photon/linux/core.d(446): Error: undefined identifier `epoll_event`
../src/photon/linux/core.d(447): Error: undefined identifier `signalfd_siginfo`
../src/photon/linux/core.d(447): Error: undefined identifier `signalfd_siginfo`
../src/photon/linux/core.d(450): Error: undefined identifier `epoll_wait`
[12/21] Generating symbol file '3rd-pa...ser@sha/libhttp-parser.dylib.symbols'.
ninja: build stopped: subcommand failed.
DmitryOlshansky commented 6 years ago

Yes, OSX is not supported yet, quite explicitly so :) It’s part of supporting FreeBSD and its ilk. Truth be told not a priority but I will gladly help sombody to add it (merge PRs, can guide to the relevant man pages etc).

The fireworks during compilation are mildly interesting but thanks for trying ;)

Simply put OSX and *BSD support is more or less the same code. The difference is likely syscall ABI / assortment.

DmitryOlshansky commented 6 years ago

And honestly ‘kqueue’ is looking so much nicer then ‘epool’ from Linux as user-land interface...

DmitryOlshansky commented 6 months ago

Now OSX is supported