-
Notifications
You must be signed in to change notification settings - Fork 25
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
Reorganize the project as a nimble package? #26
Comments
I've been aware that the file/directory layout is non-canonical since I began the project, and I read that #libraries bit. I think I disagree with nimble's views on this where two names are somehow much worse than one (my original hope was to get parseopt3 into stdlib and only have argcvt and cligen). Also, there is nothing to build - your |
That's odd. Note that I am just learning to code in Nim, but using nimble has been fine. For example, all I needed to create a binary for the nistow project was to clone it, cd to it, and
Yes, I realized that, once I reorganized your project locally into a nimble approved structure :P. As I said, I am not experienced in Nim, but may be organizing it in nimble-friendly way would allow easy "nimble install" for folks who want to use this even as a library? Copying @dom96 for more insight. |
This is all I did (ofcourse, would need to refactor your tests, etc. too): Now doing
And |
I'm always open to discussions about this. But you've got to realise that Nimble's enforcement of these rules is there to ensure packages are not polluting each other's namespaces. This is important and I don't see any better way to achieve this short of enforcing these package structures (like I said, I'm open to suggestions and discussions around this).
How did it crash? :/
That looks perfect to me. |
Right now it crashes with a "SEGV/attempt to read from nil" on most any invocation other than Is it really necessary to have two whole new levels ( |
@dom96 can answer the nimble questions. But regarding:
I mentioned it as a disclaimer as I did not run your tests after that re-organization. So if you are importing just After the re-org, That will create this:
Folks can then just do
I might be wrong, but why would you want to ship (as part of nimble installs) the tests to cligen users who would never run those tests. |
btw, I needed refactoring few more imports.. here's the force-pushed commit: kaushalmodi@3805ef5 After that, and # Time-stamp: <2018-05-09 12:54:48 kmodi>
proc foobar(foo=1, bar=2.0, baz="hi", verb=false, paths: seq[string]): int =
##Some existing API call
result = 1 # Of course, real code would have real logic here
when isMainModule: import cligen; dispatch(foobar) # Whoa...Just one line?? If I want to package that code as a nimble package and want to auto-install
|
Ok. I re-orged it a bunch myself (but thanks for the PR suggestions). As for the |
@c-blake Thanks! I am already using it here: kaushalmodi-forks/nistow@e6c0cfb :D Now I only need to figure out how to replicate the old behavior below using if paramCount() == 0:
writeHelp()
quit(0) .. and so I opened #27. |
Interesting. If you can reproduce it then please report an issue :) |
FWIW, it seems to come and go just based on whether I have Anyway, this is not some great use case since I shouldn't set experimental mode so globally, but I was lazy, and it's off now. I'm not sure if you can reproduce the failure in your own environment from that description, but this is at least more to go on than my first report. I'm not quite sure why nimble even reads |
Also, here is a backtrace from gdb which supports my "crashes while reading nim.cfg" thesis:
|
Hello,
Can you please reorganize the project contents so that the below Just WorksTM:
At the moment, doing so gives:
Nimble Project Structure
The text was updated successfully, but these errors were encountered: