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

avoid Taskpool.spawn within {.async.} for Nim 2.0 #5393

Merged
merged 3 commits into from
Sep 5, 2023

Conversation

etan-status
Copy link
Contributor

In Nim 2.0, attempting to use Taskpool.spawn inside {.async.} proc leads to Error: cannot generate destructor for generic type: Isolated.

Add an intermediate wrapper proc that performs the spawn operation to workaround the problem.

In Nim 2.0, attempting to use `Taskpool.spawn` inside `{.async.}` `proc`
leads to `Error: cannot generate destructor for generic type: Isolated`.

Add an intermediate wrapper `proc` that performs the `spawn` operation
to workaround the problem.
@etan-status
Copy link
Contributor Author

@mratsim in Nim 2.0 there is weird interaction between toTask / spawn and async macro and the isolate. Not sure what it is, have linked a possible reason in the code comment.

make -j update && make -j deps NIM_COMMIT=version-2-0 && make -j nimbus_beacon_node NIM_COMMIT=version-2-0

@etan-status
Copy link
Contributor Author

While the extra wrapper is ugly, it unblocks Nim 2.0 CI in #5142

@mratsim
Copy link
Contributor

mratsim commented Sep 5, 2023

An upstream bug should be filed. I'd assume it can be reproduced with just std/tasks and std/asyncdispatch or plain closure iterators.

@tersec
Copy link
Contributor

tersec commented Sep 5, 2023

An upstream bug should be filed. I'd assume it can be reproduced with just std/tasks and std/asyncdispatch or plain closure iterators.

nim-lang/Nim#22305 looks likely. If it's not that, when that's fixed, this can be investigated more and a new bug filed.

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

Unit Test Results

         9 files  ±0    1 089 suites  ±0   43m 5s ⏱️ + 4m 37s
  3 845 tests ±0    3 566 ✔️ ±0  279 💤 ±0  0 ±0 
15 886 runs  ±0  15 581 ✔️ ±0  305 💤 ±0  0 ±0 

Results for commit c85a1b0. ± Comparison against base commit dbb1a63.

@etan-status etan-status merged commit 8ffb80e into unstable Sep 5, 2023
@etan-status etan-status deleted the dev/etan/cc-spawnasync branch September 5, 2023 19:36
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

Successfully merging this pull request may close these issues.

3 participants