This PR reuses the `install_nim` action from `nim-libp2p`to install Nim
`i386`. We aren't running the test on `i386`- as GitHub runners are
amd64, but only using Nim `i386`.
It also uses `int64` instead of `int` for `VarIntCompatible` and
`PacketNumber` to support `i386`.
- Add Nim 2.0.8 to CI.
- Increase CI timeout to 30 minutes as the macOS building was timing out
during Nim installation.
- Use `refc` memory management.
- Upgrade ngtcp2 to a version that works with Nim 2.0.8.
- Use int instead of uint64 for `PacketNumber` and `VarIntCompatible` as
it makes implementation easier and avoids a lot of casts.
- Add required {.gcsafe.} in some procs.
fixes https://github.com/vacp2p/nim-quic/issues/43
Using this in nim-libp2p creates the error:
`/Users/runner/work/nim-libp2p/nim-libp2p/nimbledeps/pkgs/json_serialization-#85b7ea093cb85ee4f433a617b97571bd709d30df/json_serialization/writer.nim(249,
12) Error: fatal error: Failed to convert to JSON an unsupported type:
Port`
Also
```nim
import json_serialization/writer
import chronos
toJSON(initTAddress("127.0.0.1:1234"))
```
fails with
/nim-libp2p/nimbledeps/pkgs/json_serialization-#8a4ed98bbd0a9479df15af2fa31da38a586ea6d5/json_serialization/writer.nim(203,
8) template/generic instantiation of enumInstanceSerializedFields from
here
/nim-libp2p/nimbledeps/pkgs/serialization-#298a9554a885b2df59737bb3461aac8d0d339724/serialization/object_serialization.nim(48,
40) Error: type mismatch: got <uint16>
but expected one of:
iterator fieldPairs[S: tuple | object; T: tuple | object](x: S; y: T):
tuple[
key: string, a, b: RootObj]
first type mismatch at position: 1
required type for x: S: tuple or object
but expression 'value' is of type: uint16
iterator fieldPairs[T: tuple | object](x: T): tuple[key: string, val:
RootObj]
first type mismatch at position: 1
required type for x: T: tuple or object
but expression 'value' is of type: uint16
expression: fieldPairs(value)
Those are the last commits for nim-json-serialization and
nim-serialization
As required by latest version of Chronos.
Uses `upraises` for exception tracking across Nim 1.2 and 1.4.
Fixes Ngtcp2 error hierarchy to match that of Nim.
Writing to streams is blocked when the maximum stream offset
is reached. Previously we extended this offset when data was
*added* to the read queue of the receiving peer. Now we only
extend it once data has been *removed* from the queue,
thereby limiting the queue size.