Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Latest commit generates code that does not compiles for nwaku #145

Open
NagyZoltanPeter opened this issue Mar 4, 2024 · 0 comments

Comments

@NagyZoltanPeter
Copy link

NagyZoltanPeter commented Mar 4, 2024

I had ran into a strange bug when tried to use the latest nim-chronicles in nwaku.
From commit: ccbb756 to ab3ab54

After bumping to new version one of our test suit did not compiled.

Steps to repdroduce:

  • clone latest nwaku master: git clone https://github.com/waku-org/nwaku.git nwaku_compile_issue
  • cd nwaku_compile_issue
  • make update
  • source env.sh
  • get use lates chronicles: git submodule update --remote --merge -- vendor/nim-chronicles
  • make testwaku

Check error:

/home/nzp/dev/status/nwaku-third/waku/waku_api/rest/store/client.nim(70, 17) template/generic instantiation of `rest` from here
/home/nzp/dev/status/nwaku-third/vendor/nim-presto/presto/client.nim(512, 17) template/generic instantiation of `async` from here
/home/nzp/dev/status/nwaku-third/vendor/nim-presto/presto/client.nim(1161, 20) template/generic instantiation of `setResult` from here
/home/nzp/dev/status/nwaku-third/vendor/nim-presto/presto/client.nim(1170, 44) template/generic instantiation of `error` from here
/home/nzp/dev/status/nwaku-third/vendor/nim-results/results.nim(890, 24) template/generic instantiation of `raiseResultDefect` from here
/home/nzp/dev/status/nwaku-third/vendor/nim-results/results.nim(372, 63) template/generic instantiation of `$` from here
/home/nzp/dev/status/nwaku-third/vendor/nimbus-build-system/vendor/Nim/lib/system/dollars.nim(111, 15) template/generic instantiation of `addQuoted` from here
/home/nzp/dev/status/nwaku-third/vendor/nimbus-build-system/vendor/Nim/lib/system/dollars.nim(153, 21) template/generic instantiation of `collectionToString` from here
/home/nzp/dev/status/nwaku-third/vendor/nimbus-build-system/vendor/Nim/lib/system/dollars.nim(136, 13) template/generic instantiation of `addQuoted` from here
/home/nzp/dev/status/nwaku-third/vendor/nimbus-build-system/vendor/Nim/lib/system/dollars.nim(111, 15) template/generic instantiation of `addQuoted` from here
/home/nzp/dev/status/nwaku-third/vendor/nimbus-build-system/vendor/Nim/lib/pure/options.nim(361, 11) template/generic instantiation of `addQuoted` from here
/home/nzp/dev/status/nwaku-third/vendor/nimbus-build-system/vendor/Nim/lib/system.nim(2929, 11) Error: type mismatch: got <Base64String>
but expected one of:
func `$`(a: Duration): string
first type mismatch at position: 1
required type for a: Duration
but expression 'x' is of type: Base64String
func `$`(a: Moment): string
first type mismatch at position: 1
required type for a: Moment
but expression 'x' is of type: Base64String
func `$`(u: Uri): string
first type mismatch at position: 1
required type for u: Uri
but expression 'x' is of type: Base64String
...
required type for x: set[T]
but expression 'x' is of type: Base64String
template `$`(s: JsonString): string
first type mismatch at position: 1
required type for s: JsonString
but expression 'x' is of type: Base64String

This code compiles just fine with the ccbb756 version. I think latest commit introduced a change in code generation template that cause this error.
##In nwaku side the change might be related to this issue:
https://github.com/waku-org/nwaku/blob/361fe2cdc7c48e458a9cd3bb1b38df28f3cda65e/waku/waku_api/rest/store/types.nim#L45
There is a new Option[Base64String] field added.
From the compile fail stack I think the issue is when there is a contained type stringify should happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant