c-blake / cligen

Nim library to infer/generate command-line-interfaces / option / argument parsing; Docs at
https://c-blake.github.io/cligen/
ISC License
501 stars 23 forks source link

textUt.nim(4, 28) Error: cannot open file: cligen/mslice #155

Closed narimiran closed 4 years ago

narimiran commented 4 years ago

The error from the title is shown when our CIs try to run nim c -o:cligenn -r cligen.nim with Nim v1.2.x, and it is the same for me locally.

The culprit is in this line. If the cligen/mslice import is changed to mslice (import critbits, re, mslice, math # ^), it works on my machine.

c-blake commented 4 years ago

For me that -o:cligenn command works on all Nim after 0.20.0 with both nim c and nim cpp. It should be cligen/mslice, no? Or at least ./mslice to be clear to a reader it is expected in the same directory as textUt.nim itself. Does the dot-slash version of the import work for you? (Since I cannot reproduce the failure, I have to ask you to try.)

c-blake commented 4 years ago

I guess I probably have a --path:path-to-cg-repo in my ~/.config/nim/nim.cfg which may explain the difference in behavior we see, but it should definitely be possible to do a namespaced import however search paths are set up or there's a bona fide Nim bug, I'd say.

Also, that import has been there for almost a week. Has it been breaking your CI that whole time?

narimiran commented 4 years ago

Does the dot-slash version of the import work for you?

Yes, import ./mslice works fine.

Since I cannot reproduce the failure, I have to ask you to try.

Note that on devel branch there is also no problem with the way it is currently (cligen/mslice), it is just version-1-2 branch that has that problem.
We should (maybe) also take into an account that packages in version-1-2 are tested via Azure Pipelines, while in devel they are tested via Github Actions.

c-blake commented 4 years ago

Ok. Well, I am ok with the dot-slash version. Just want some way to indicate it is expected to come from a local module. I do other import cligen/ in places, but maybe not in ways that would be tickled by the CI.