From 86563cbddd3a44c02a7f9367c2639e98442148ad Mon Sep 17 00:00:00 2001 From: diegomrsantos Date: Wed, 10 Jul 2024 14:24:12 +0200 Subject: [PATCH] chore: enable Nim 2.0.x and fix compilation issues (#1146) 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 --- .github/workflows/ci.yml | 2 +- libp2p.nimble | 2 +- tests/commontransport.nim | 4 ++-- tests/config.nims | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81d199777..6d5e06912 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/libp2p.nimble b/libp2p.nimble index 15dae7b09..2ef10db92 100644 --- a/libp2p.nimble +++ b/libp2p.nimble @@ -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 diff --git a/tests/commontransport.nim b/tests/commontransport.nim index cd2a7a249..9c30f4d79 100644 --- a/tests/commontransport.nim +++ b/tests/commontransport.nim @@ -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)) @@ -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() diff --git a/tests/config.nims b/tests/config.nims index 34385ea62..25930fa27 100644 --- a/tests/config.nims +++ b/tests/config.nims @@ -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