-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support for nimble dependencies #51
Comments
I'm not sure I get your point. Why not just list the needed libs in your nimble file, and import them to the nakefile? E.g. I'm using jester in my nakefile. |
Which nimble file do you mean? Say, you are building your project for the first time - then there are no packages in I don't think it makes sense to depend on presence of certain packages in the local repository if they are not explicitly specified as dependencies of the nakefile. Frankly, I think the current behaviour of nim(ble) with considering the local packages to be in path of every compiled project doesn't make sense - a package should only be added to path if there is an explicit dependency on it. That helps to have reproducible builds and ensure that if something compiles on one machine then it will also compile on any other machine. |
IMO, you're mixing several issues here.
|
Yes, I know I also mixed the nimble dependency management topic into this, but the original post was about the first bullet in your comment. I find what you describe to be a workaround rather than final solution:
What do you think? |
Thats not an issue to me, but I agree that making everything needed in one single command would be fancier, if that doesn't come at the cost of build times. I guess nimble will want to have some command like
Some while ago we discussed with @dom96 that there should be "develop" dependencies that would be installed for your root package, but not its dependencies. Cargo does this similarly. That looks like should cover your case. However I'm not sure about the scenario when your build tools dependencies would conflict with project dependencies. All of those are managed within the same repo anyway, so the maintainer should likely have no problems with keeping those versions coherent. |
Cargo has a notion of build scripts and you can specify What I'm talking about is a way to specify build dependencies when using The idea I expressed in the original post is to make |
I was talking about Cargo development dependencies, please have a look at that. I'm not sure that your suggestion (namely a separate nimble file) is conceptually correct/consistent because (a) i think there should be one nimble file per package (arguable) and (b) i have my nakefiles next to my nimble files, and thus I can not introduce a new nimble file because nimble allows only one nimble file per dir, also it is likely that different tools may rely on searching of nimble file by recursively going upwards, and thus they can hit your nakefile nimble file which you may not want. Does that make sense? |
I agree that there should be one nimble file per package. But |
Hrm, I was not aware of that. If that's true I see nothing wrong. To summarize: compile nakefile.nim with |
Yes, that's precise, thank you. Should we also consider looking for .nimble file upwards to cover the case you described? I've noticed |
I don't have a strong opinion regarding that one. Should we? =) Probably that would be more intuitively consistent behavior?
Should not |
Yeah I guess you are right, it makes sense to explicitly specify nake as a dependency. As about going upwards - I think it makes sense to follow this logic: "if |
I don't remember how nimble behaves here, but yeah, I agree that consistency with nimble is a good reference. |
This is how Nimble works. It's the very difference between compiling with Nim vs. Nimble.
This is planned. Actually now that I've looked into this: all dependencies in a Nimble file are build dependencies, no? So I don't see the need to change anything, just specify |
Hah. I see you guys have reached the same conclusions, so can't we close this issue? |
We can't until nake runs |
@dom96 It's not resolved yet, so no (i.e. it requires implementation in nake). And no, not all dependencies are build dependencies. There are dependencies needed to build the project (required by nakefile or another build tool) and dependencies that are needed for the project itself - that's the distinguishment I was making and it is also made by Cargo as I noted above. |
oh right, cause Why not just create a
That's a distinction that Nimble won't make for Nimble packages. Because all dependencies are build dependencies as far as Nim is concerned. |
There is a concept of "foreign dependencies" in Nimble: https://github.com/nim-lang/nimble#external-dependencies. And these are actually runtime dependencies. |
Building complex projects often requires libraries that may not be found in Nim's stdlib. Currently there is no good way (known to me) to use external libraries from nakefile - a workaround is to have a separate tool built and launched from nakefile. But it would make build process simpler if the intermediary is removed.
A simple way to implement this is for
nake
to look fornakefile.nimble
and, if it is present, runnimble c nakefile.nim
instead ofnim c nakefile.nim
.The text was updated successfully, but these errors were encountered: