Reputation: 13177
I've created a nimble library package as per the documentation. When I try to build it using nimble build
I get the following error.
Error: Nothing to build. Did you specify a module to build using the
bin
key in your .nimble file?
I can do this and it does fix the error but according to the documentation adding the bin
key to the .nimble
file turns my package into a binary package.
Other things I have tried:
nimble install
: This does not appear to verify that my code will actually compile and will happily install anything to the local package directory (I added a C# class to my .nim
file, for example, and it was successfully installed).nimble c
: This works but I have to pass in the path to the nim
file I want to compile and the binDir
entry in the .nimble
file is ignored resulting in the output being placed in the same directory as the file being built. This complicates the development cycle because I have to manually clean up after the compiler.I guess I could also create a separate .nim
file and import my library after it is installed but this is a big overhead for just wanting to verify that a package in the early stages of development will actually compile.
I just want to be able to verify that the source code in my library package is syntactically correct and will compile. How is this meant to be done for library packages?
Upvotes: 6
Views: 2357
Reputation: 164
From your provided link to the nimble package manager documentation I have the feeling that
https://github.com/nim-lang/nimble#tests
is what you are looking for. But I have never used the test command, so I am not sure. I do my test manually still, I read the nimble docs maybe 4 years ago and can not really remember. And currently there is much package manager related work going on, I heard there is a new, alternative package manager called nimph, and from a forum thread I think I read something that nimble is going to change and improve also. Maybe you should consider subscribing to the Nim forum, that is the place where the bright Nim devs are. Well, at least a few of them.
Upvotes: 3