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

Avoid using the FSEventStream API on iOS #239

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest, windows-latest, macos-13]
dc: [dmd-latest, ldc-latest, dmd-2.086.0, ldc-1.16.0, ldc-1.17.0]
arch: [x86_64]
config: [select, epoll, cfrunloop, winapi]
exclude:
- {os: ubuntu-latest, config: cfrunloop}
- {os: ubuntu-latest, config: winapi}
- {os: macOS-latest, config: epoll}
- {os: macOS-latest, config: winapi}
- {os: macos-13, config: epoll}
- {os: macos-13, config: winapi}
- {os: windows-latest, config: cfrunloop}
- {os: windows-latest, config: epoll}
# macOS fails up to FE 2.086.x, so we test on a slightly newer
# version instead
# "dyld: lazy symbol binding failed: Symbol not found: _dyld_enumerate_tlv_storage"
- {os: macOS-latest, dc: dmd-2.086.0}
- {os: macOS-latest, dc: ldc-1.16.0}
- {os: macos-13, dc: dmd-2.086.0}
- {os: macos-13, dc: ldc-1.16.0}
- {os: windows-latest, dc: ldc-1.16.0, config: select}
- {os: windows-latest, dc: ldc-1.17.0}
- {os: ubuntu-latest, dc: ldc-1.17.0}
Expand All @@ -40,10 +40,10 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install D compiler
uses: dlang-community/setup-dlang@v1
uses: dlang-community/setup-dlang@v2
with:
compiler: ${{ matrix.dc }}

Expand Down
6 changes: 4 additions & 2 deletions source/eventcore/drivers/posix/driver.d
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ final class PosixEventDriver(Loop : PosixEventLoop) : EventDriver {
version (Posix) alias PipeDriver = PosixEventDriverPipes!Loop;
else alias PipeDriver = DummyEventDriverPipes!Loop;
version (linux) alias WatcherDriver = InotifyEventDriverWatchers!EventsDriver;
else version (EventcoreCFRunLoopDriver) alias WatcherDriver = FSEventsEventDriverWatchers!EventsDriver;
else alias WatcherDriver = PollEventDriverWatchers!EventsDriver;
else version (EventcoreCFRunLoopDriver) {
version (OSX) alias WatcherDriver = FSEventsEventDriverWatchers!EventsDriver;
else alias WatcherDriver = PollEventDriverWatchers!EventsDriver;
} else alias WatcherDriver = PollEventDriverWatchers!EventsDriver;
version (Posix) alias ProcessDriver = PosixEventDriverProcesses!Loop;
else alias ProcessDriver = DummyEventDriverProcesses!Loop;

Expand Down
3 changes: 1 addition & 2 deletions source/eventcore/drivers/posix/watchers.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module eventcore.drivers.posix.watchers;
import eventcore.driver;
import eventcore.drivers.posix.driver;
import eventcore.internal.utils : mallocT, freeT, nogc_assert;
import eventcore.internal.corefoundation : isAppleOS;


final class InotifyEventDriverWatchers(Events : EventDriverEvents) : EventDriverWatchers
Expand Down Expand Up @@ -201,7 +200,7 @@ final class InotifyEventDriverWatchers(Events : EventDriverEvents) : EventDriver
}
}

static if (isAppleOS)
version (OSX) // NOTE: Although this works on iOS, too, this is a private API there
final class FSEventsEventDriverWatchers(Events : EventDriverEvents) : EventDriverWatchers {
@safe: /*@nogc:*/ nothrow:
import eventcore.internal.corefoundation;
Expand Down