Skip to content

Commit

Permalink
Merge pull request #239 from vibe-d/fix_ios_private_api
Browse files Browse the repository at this point in the history
Avoid using the FSEventStream API on iOS
  • Loading branch information
s-ludwig authored Jul 8, 2024
2 parents 515edf9 + b57ba56 commit 038e01d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
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

0 comments on commit 038e01d

Please sign in to comment.