Skip to content

Commit 836afd4

Browse files
committed
remove chronos dependency
The `chronos` backend currently does not work as it relies on nesting `waitFor` calls, which is not supported by chronos itself - as such, this PR disables the backend in testing and prints a recommendation to users to avoid it until the problem has been resolved. faststreams used without `async` continues to work as normal, which also is the most common way to use it - the dependency on chronos in the nimble file is unattractive from a user perspective since it also leads to the the downloading of bearssl and other deps. Hopefully, by the time the chronos backend can be used, we can also specify conditional dependencies in nimble files.
1 parent 3576a15 commit 836afd4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

faststreams.nimble

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ skipDirs = @["tests"]
99

1010
requires "nim >= 1.2.0",
1111
"stew",
12-
"chronos",
1312
"unittest2"
1413

1514
let nimc = getEnv("NIMC", "nim") # Which nim compiler to use
@@ -31,7 +30,8 @@ proc run(args, path: string) =
3130

3231
task test, "Run all tests":
3332
# TODO asyncdispatch backend is broken / untested
34-
for backend in ["-d:asyncBackend=none", "-d:asyncBackend=chronos"]:
33+
# TODO chronos backend uses nested waitFor which is not supported
34+
for backend in ["-d:asyncBackend=none"]:
3535
for threads in ["--threads:off", "--threads:on"]:
3636
for mode in ["-d:debug", "-d:release", "-d:danger"]:
3737
run backend & " " & threads & " " & mode, "tests/all_tests"

faststreams/async_backend.nim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const
2020
when asyncBackend == "none":
2121
discard
2222
elif asyncBackend == "chronos":
23+
{.warning: "chronos backend uses nested calls to `waitFor` which is not supported by chronos - it is not recommended to use it until this has been resolved".}
24+
2325
import
2426
chronos
2527

@@ -30,6 +32,8 @@ elif asyncBackend == "chronos":
3032
await f
3133

3234
elif asyncBackend == "asyncdispatch":
35+
{.warning: "asyncdispatch backend currently fails tests - it may or may not work as expected".}
36+
3337
import
3438
std/asyncdispatch
3539

0 commit comments

Comments
 (0)