Skip to content

Commit

Permalink
chore: enable Nim 2.0.x and fix compilation issues (#1146)
Browse files Browse the repository at this point in the history
This PR enables Nim 2.0.x with `refc` garbage collector on CI.

The following compilation error had to be fixed: Error: undeclared
identifier: 'acceptHandler`gensym435'; if declared in a template, this
identifier may be inconsistently marked inject or gensym
  • Loading branch information
diegomrsantos authored Jul 10, 2024
1 parent be80160 commit 86563cb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cpu: amd64
#- os: windows
#cpu: i386
branch: [version-1-6]
branch: [version-1-6, version-2-0]
include:
- target:
os: linux
Expand Down
2 changes: 1 addition & 1 deletion libp2p.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ task examples_build, "Build the samples":
buildSample("tutorial_5_discovery", true)
exec "nimble install -y nimpng@#HEAD"
# this is to fix broken build on 1.7.3, remove it when nimpng version 0.3.2 or later is released
exec "nimble install -y nico"
exec "nimble install -y nico@#af99dd60bf2b395038ece815ea1012330a80d6e6"
buildSample("tutorial_6_game", false, "--styleCheck:off")

# pin system
Expand Down
4 changes: 2 additions & 2 deletions tests/commontransport.nim
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ template commonTransportTest*(prov: TransportProvider, ma1: string, ma2: string
let transport1 = transpProvider()
await transport1.start(addrs)

proc acceptHandler() {.async.} =
proc acceptHandler() {.async, gensym.} =
while true:
let conn = await transport1.accept()
await conn.write(newSeq[byte](0))
Expand Down Expand Up @@ -208,7 +208,7 @@ template commonTransportTest*(prov: TransportProvider, ma1: string, ma2: string
let transport1 = transpProvider()
await transport1.start(ma)

proc acceptHandler() {.async.} =
proc acceptHandler() {.async, gensym.} =
let conn = await transport1.accept()
await conn.close()

Expand Down
3 changes: 3 additions & 0 deletions tests/config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import strutils, os
--d:
unittestPrintTime
--skipParentCfg
--mm:
refc
# reconsider when there's a version-2-2 branch worth testing with as we might switch to orc

# Only add chronicles param if the
# user didn't specify any
Expand Down

0 comments on commit 86563cb

Please sign in to comment.