Benjamin Gale
Benjamin Gale

Reputation: 13177

How do I build Nim library packages

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:

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

Answers (1)

Salewski
Salewski

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

Related Questions