binhonglee / coco

Code coverage for Nim lang (CLI + library)
MIT License
46 stars 3 forks source link

Compatible with Nim 1.0.0? #18

Closed dcurrie closed 3 years ago

dcurrie commented 5 years ago

After upgrading to Nim 1.0.0, my project no longer works with coco.

Environment: MacOS 10.14.6; Nim installed with choosenim

My repo: https://github.com/dcurrie/nim-bbtree

There seems to be a non-existent file referenced from lconv.info called generated_not_to_break_here. Searching the nimcache, it appears that Nim generates a line in some intermediate C files

#line 999999 "generated_not_to_break_here"

and this seems to be confusing lcov. Running nimble coverage results in

...
Writing .css and .png files.
Generating output.
Processing file /Users/e/Dev/Nim/eNim/nim-bbtree/generated_not_to_break_here
genhtml: ERROR: cannot read /Users/e/Dev/Nim/eNim/nim-bbtree/generated_not_to_break_here
fatal.nim(39)            sysFatal
Error: unhandled exception: coco.nim(16, 14) `execShellCmd(command) == 0` command failed: genhtml  --branch-coverage --legend -o coverage lcov.info [AssertionError]
stack trace: (most recent call last)
/private/var/folders/qh/nlnjny3j2j92d1nf2t9rx0pm0000gn/T/nimblecache/nimscriptapi.nim(165, 16)
/Users/e/Dev/Nim/eNim/nim-bbtree/bbtree_13189.nims(29, 8) coverageTask
/Users/e/.choosenim/toolchains/nim-1.0.0/lib/system/nimscript.nim(252, 7) exec
/Users/e/.choosenim/toolchains/nim-1.0.0/lib/system/nimscript.nim(252, 7) Error: unhandled exception: FAILED: coco --verbose --branch [OSError]
     Error: Exception raised during nimble script execution

This is probably an lcov problem, but I'm not sure; perhaps there is a setting or argument to lcov that would avoid the issue, or perhaps coco could patch the lconv.info to eliminate the file reference.

samuelroy commented 4 years ago

Hi, sorry for my late answer.

As this library hit a wall (see https://github.com/samuelroy/coco/issues/13) I didn't take the time to work on it much further.

Now that Nim reached 1.0.0, I might decide to invest some time in the community but Coco will not be my priority.

If anybody wants to take over. Let me know.

binhonglee commented 3 years ago

Hey @samuelroy, I'm happy to take over and/or merge it into my other existing project and maintain it though I'll likely need some time to get familiar with the code base.

samuelroy commented 3 years ago

Hey @binhonglee, I'm happy to transfer the project to you. This library was my take with the Nim language et I don't maintain it anymore as it wasn't useful to people in its current state.

samuelroy commented 3 years ago

@binhonglee can you rename your fork so I can transfer the ownership of this repo to you?

binhonglee commented 3 years ago

@samuelroy done!

samuelroy commented 3 years ago

@binhonglee done! Have fun with Coco 😄

binhonglee commented 3 years ago

Closing this since its addressed with #20. Could probably reopen once nim#12376 is fixed but as of now that workaround should work just fine.