2019-02-06 14:49:11 +00:00
|
|
|
packageName = "chronos"
|
2021-04-09 21:39:54 +00:00
|
|
|
version = "3.0.2"
|
2018-05-16 08:22:34 +00:00
|
|
|
author = "Status Research & Development GmbH"
|
2019-02-06 14:49:11 +00:00
|
|
|
description = "Chronos"
|
2018-05-16 08:22:34 +00:00
|
|
|
license = "Apache License 2.0 or MIT"
|
2019-02-06 15:24:57 +00:00
|
|
|
skipDirs = @["tests"]
|
2018-05-16 08:22:34 +00:00
|
|
|
|
|
|
|
### Dependencies
|
|
|
|
|
2020-07-12 16:22:47 +00:00
|
|
|
requires "nim > 1.2.0",
|
|
|
|
"stew",
|
2021-01-30 18:17:22 +00:00
|
|
|
"bearssl",
|
exception tracking (#166)
* exception tracking
This PR adds minimal exception tracking to chronos, moving the goalpost
one step further.
In particular, it becomes invalid to raise exceptions from `callSoon`
callbacks: this is critical for writing correct error handling because
there's no reasonable way that a user of chronos can possibly _reason_
about exceptions coming out of there: the event loop will be in an
indeterminite state when the loop is executing an _random_ callback.
As expected, there are several issues in the error handling of chronos:
in particular, it will end up in an inconsistent internal state whenever
the selector loop operations fail, because the internal state update
functions are not written in an exception-safe way. This PR turns this
into a Defect, which probably is not the optimal way of handling things
- expect more work to be done here.
Some API have no way of reporting back errors to callers - for example,
when something fails in the accept loop, there's not much it can do, and
no way to report it back to the user of the API - this has been fixed
with the new accept flow - the old one should be deprecated.
Finally, there is information loss in the API: in composite operations
like `poll` and `waitFor` there's no way to differentiate internal
errors from user-level errors originating from callbacks.
* store `CatchableError` in future
* annotate proc's with correct raises information
* `selectors2` to avoid non-CatchableError IOSelectorsException
* `$` should never raise
* remove unnecessary gcsafe annotations
* fix exceptions leaking out of timer waits
* fix some imports
* functions must signal raising the union of all exceptions across all
platforms to enable cross-platform code
* switch to unittest2
* add `selectors2` which supercedes the std library version and fixes
several exception handling issues in there
* fixes
* docs, platform-independent eh specifiers for some functions
* add feature flag for strict exception mode
also bump version to 3.0.0 - _most_ existing code should be compatible
with this version of exception handling but some things might need
fixing - callbacks, existing raises specifications etc.
* fix AsyncCheck for non-void T
2021-03-24 09:08:33 +00:00
|
|
|
"httputils",
|
|
|
|
"https://github.com/status-im/nim-unittest2.git#head"
|
2018-05-16 08:22:34 +00:00
|
|
|
|
|
|
|
task test, "Run all tests":
|
2021-03-03 18:04:09 +00:00
|
|
|
var commands = @[
|
2020-08-15 22:45:41 +00:00
|
|
|
"nim c -r -d:useSysAssert -d:useGcAssert tests/",
|
exception tracking (#166)
* exception tracking
This PR adds minimal exception tracking to chronos, moving the goalpost
one step further.
In particular, it becomes invalid to raise exceptions from `callSoon`
callbacks: this is critical for writing correct error handling because
there's no reasonable way that a user of chronos can possibly _reason_
about exceptions coming out of there: the event loop will be in an
indeterminite state when the loop is executing an _random_ callback.
As expected, there are several issues in the error handling of chronos:
in particular, it will end up in an inconsistent internal state whenever
the selector loop operations fail, because the internal state update
functions are not written in an exception-safe way. This PR turns this
into a Defect, which probably is not the optimal way of handling things
- expect more work to be done here.
Some API have no way of reporting back errors to callers - for example,
when something fails in the accept loop, there's not much it can do, and
no way to report it back to the user of the API - this has been fixed
with the new accept flow - the old one should be deprecated.
Finally, there is information loss in the API: in composite operations
like `poll` and `waitFor` there's no way to differentiate internal
errors from user-level errors originating from callbacks.
* store `CatchableError` in future
* annotate proc's with correct raises information
* `selectors2` to avoid non-CatchableError IOSelectorsException
* `$` should never raise
* remove unnecessary gcsafe annotations
* fix exceptions leaking out of timer waits
* fix some imports
* functions must signal raising the union of all exceptions across all
platforms to enable cross-platform code
* switch to unittest2
* add `selectors2` which supercedes the std library version and fixes
several exception handling issues in there
* fixes
* docs, platform-independent eh specifiers for some functions
* add feature flag for strict exception mode
also bump version to 3.0.0 - _most_ existing code should be compatible
with this version of exception handling but some things might need
fixing - callbacks, existing raises specifications etc.
* fix AsyncCheck for non-void T
2021-03-24 09:08:33 +00:00
|
|
|
"nim c -r -d:chronosStackTrace -d:chronosStrictException tests/",
|
2020-08-15 22:45:41 +00:00
|
|
|
"nim c -r -d:release tests/",
|
|
|
|
"nim c -r -d:release -d:chronosFutureTracking tests/"
|
2019-03-24 16:57:36 +00:00
|
|
|
]
|
2021-03-03 18:04:09 +00:00
|
|
|
when (NimMajor, NimMinor) >= (1, 5):
|
|
|
|
commands.add "nim c -r --gc:orc -d:chronosFutureTracking -d:release -d:chronosStackTrace tests/"
|
|
|
|
|
2020-07-06 06:33:13 +00:00
|
|
|
for testname in ["testall"]:
|
|
|
|
for cmd in commands:
|
|
|
|
let curcmd = cmd & testname
|
|
|
|
echo "\n" & curcmd
|
|
|
|
exec curcmd
|